| Crates.io | portkill |
| lib.rs | portkill |
| version | 1.1.3 |
| created_at | 2025-12-22 07:06:55.568028+00 |
| updated_at | 2025-12-22 15:05:31.604839+00 |
| description | A fast CLI tool to kill processes running on specified ports |
| homepage | https://github.com/jofftiquez/pk |
| repository | https://github.com/jofftiquez/pk |
| max_upload_size | |
| id | 1999216 |
| size | 43,939 |
_ _ _ _ _
_ __ ___ _ _| |_| | _(_) | |
| '_ \ / _ \| '_| _| |/ / | | |
| |_) | (_) | | | |_| <| | | |
| .__/ \___/|_| \__|_|\_\_|_|_|
|_|
portkill — kill processes on ports, fast.
https://github.com/user-attachments/assets/3ba50634-ed24-4ed3-b1fa-231dfcf8017f
Because lsof -i :3000 -t | xargs kill -9 is too long to type.
# Before
lsof -i :3000 -t | xargs kill -9
# After
portkill 3000
cargo install portkill
brew tap jofftiquez/tap
brew install portkill
git clone https://github.com/jofftiquez/pk.git
cd pk
cargo install --path .
Run without arguments to see all listening ports and select which to kill:
$ portkill
PORT PID PROCESS COMMAND
------------------------------------------------------------
â—‹ 3000 12345 node node server.js
â—‹ 5432 12346 postgres /usr/local/opt/postgresql...
â—‹ 8080 12347 python python -m http.server 8080
# Use ↑↓ to navigate, Space to select, Enter to confirm
Use -s to filter by process name, command, or port:
$ portkill -s node
PORT PID PROCESS COMMAND
------------------------------------------------------------
â—‹ 3000 12345 node node server.js
â—‹ 9000 12348 node node api.js
$ portkill 3000
✓ Killed node (PID 12345) on port 3000
$ portkill 3000 8080 9000
✓ Killed node (PID 12345) on port 3000
✓ Killed python (PID 12346) on port 8080
✗ No process found on port 9000
$ portkill -n 3000
~ Would kill node (PID 12345) on port 3000
$ portkill -f 3000
✓ Killed node (PID 12345) on port 3000
| Flag | Long | Description |
|---|---|---|
-s |
--search |
Filter ports by process name or command |
-f |
--force |
Force kill (SIGKILL) |
-n |
--dry-run |
Show what would be killed |
-h |
--help |
Show help |
-V |
--version |
Show version |
| Feature | portkill | killport | lsof + kill |
|---|---|---|---|
| Interactive mode | Yes | No | No |
| Search/filter | Yes | No | Manual |
| Dry run | Yes | Yes | No |
| Force kill | Yes | Yes | Manual |
MIT