| Crates.io | portk |
| lib.rs | portk |
| version | 0.1.1 |
| created_at | 2026-01-25 19:12:26.757133+00 |
| updated_at | 2026-01-25 19:23:48.495463+00 |
| description | A surgical port killer - find and terminate processes using specific ports |
| homepage | https://github.com/yigiterdev/portk |
| repository | https://github.com/yigiterdev/portk |
| max_upload_size | |
| id | 2069350 |
| size | 66,045 |
A surgical port killer - find and terminate processes using specific ports.
curl -fsSL https://raw.githubusercontent.com/yigiterdev/portk/main/install.sh | sh
cargo install portk
cargo install --git https://github.com/yigiterdev/portk
git clone https://github.com/yigiterdev/portk.git
cd portk
cargo install --path .
Download the latest release for your platform from Releases.
| Platform | Architecture | Download |
|---|---|---|
| macOS | Apple Silicon (M1/M2/M3) | portk-aarch64-apple-darwin.tar.gz |
| macOS | Intel | Use cargo install portk |
| Linux | x64 | portk-x86_64-unknown-linux-gnu.tar.gz |
| Windows | x64 | portk-x86_64-pc-windows-msvc.zip |
# macOS (Apple Silicon)
curl -LO https://github.com/yigiterdev/portk/releases/latest/download/portk-aarch64-apple-darwin.tar.gz
tar xzf portk-aarch64-apple-darwin.tar.gz
sudo mv portk /usr/local/bin/
# Linux (x64)
curl -LO https://github.com/yigiterdev/portk/releases/latest/download/portk-x86_64-unknown-linux-gnu.tar.gz
tar xzf portk-x86_64-unknown-linux-gnu.tar.gz
sudo mv portk /usr/local/bin/
portk 3000
Output:
info: Found 1 process on port 3000:
╭──────┬───────┬─────────┬─────────┬────────╮
│ Port │ PID │ Process │ Address │ State │
├──────┼───────┼─────────┼─────────┼────────┤
│ 3000 │ 21974 │ node │ *:3000 │ LISTEN │
╰──────┴───────┴─────────┴─────────┴────────╯
portk --scan
Scans ports commonly used in development: 3000, 3001, 4000, 4200, 5000, 5173, 8000, 8080, 9000, and more.
portk 3000 --info
Output:
info: Process Details:
PID: 21974
Name: node
User: ahmetyigiter
CWD: /Users/ahmetyigiter/projects/myapp
Memory: 81.8 MB
CPU: 0.0%
Uptime: 22h 46m
Command:
node server.js
portk 3000 --tree
Output:
info: Process Tree:
[21974] node (81.8MB) node server.js
├── [21980] node (45.2MB) node worker.js
└── [21981] node (32.1MB) node watcher.js
portk 3000 --parents
Output:
info: Parent Chain:
[21974] node
↳ [21964] node
↳ [21949] node
↳ [5114] zsh
↳ [2404] Terminal
↳ [1] launchd
portk 3000 --kill # Graceful kill (SIGTERM)
portk 3000 --kill --force # Force kill (SIGKILL)
portk 3000 --kill-tree # Kill process and all children
portk 3000 --kill -y # Kill without confirmation
Usage: portk [OPTIONS] [PORT]
Arguments:
[PORT] Port number to investigate (e.g., 3000, 8080)
Options:
-s, --scan Scan common development ports
-t, --tree Show process tree for the port's process
-p, --parents Show parent chain (ancestors) of the process
-k, --kill Kill the process using this port
-f, --force Force kill (SIGKILL instead of SIGTERM)
--kill-tree Kill entire process tree
-y, --yes Non-interactive mode (no confirmations)
-i, --info Show detailed process information
-h, --help Print help
-V, --version Print version
portk 3000
portk 8080 --kill -y
portk --scan
portk 3000 --info --tree --parents
portk 3000 --kill-tree --force -y
lsof (macOS) or ss/netstat (Linux) to find processes bound to portssysinfo crate to gather detailed process information/proc (Linux) or using system APIs| Platform | Status |
|---|---|
| macOS | Full support |
| Linux | Full support |
| Windows | Full support |
MIT License - see LICENSE for details.
Contributions are welcome! Please feel free to submit a Pull Request.
# Clone the repo
git clone https://github.com/yigiterdev/portk.git
cd portk
# Install pre-commit hooks
./scripts/setup-hooks.sh
# Build and test
cargo build
cargo test
The pre-commit hook will automatically run cargo fmt --check and cargo clippy before each commit.
To create a new release:
Cargo.tomlgit commit -am "Bump version to x.y.z"git tag vx.y.zgit push && git push --tagsGitHub Actions will automatically build binaries for all platforms and create a release.