A surgical port killer - find and terminate processes using specific ports.
- Port investigation - Instantly see what's running on any port
- Process tree view - Visualize parent/child process relationships
- Parent chain - Trace process ancestry back to init
- Detailed info - View memory, CPU, uptime, command, and more
- Surgical kill - Terminate just the process or the entire tree
- Port scanning - Scan common development ports at once
- Interactive mode - Explore and act on processes interactively
curl -fsSL https://raw.githubusercontent.com/yigiterdev/portk/main/install.sh | shcargo install portkcargo install --git https://github.com/yigiterdev/portkgit 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 3000Output:
info: Found 1 process on port 3000:
╭──────┬───────┬─────────┬─────────┬────────╮
│ Port │ PID │ Process │ Address │ State │
├──────┼───────┼─────────┼─────────┼────────┤
│ 3000 │ 21974 │ node │ *:3000 │ LISTEN │
╰──────┴───────┴─────────┴─────────┴────────╯
portk --scanScans ports commonly used in development: 3000, 3001, 4000, 4200, 5000, 5173, 8000, 8080, 9000, and more.
portk 3000 --infoOutput:
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 --treeOutput:
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 --parentsOutput:
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 childrenportk 3000 --kill -y # Kill without confirmationUsage: 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 3000portk 8080 --kill -yportk --scanportk 3000 --info --tree --parentsportk 3000 --kill-tree --force -y- Port Detection: Uses
lsof(macOS) orss/netstat(Linux) to find processes bound to ports - Process Info: Uses the
sysinfocrate to gather detailed process information - Process Tree: Builds parent/child relationships by scanning
/proc(Linux) or using system APIs - Kill Signals: Sends SIGTERM (graceful) or SIGKILL (force) to terminate processes
| 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 testThe pre-commit hook will automatically run cargo fmt --check and cargo clippy before each commit.
To create a new release:
- Update version in
Cargo.toml - Commit the change:
git commit -am "Bump version to x.y.z" - Create a tag:
git tag vx.y.z - Push with tags:
git push && git push --tags
GitHub Actions will automatically build binaries for all platforms and create a release.