portkill

Crates.ioportkill
lib.rsportkill
version1.1.3
created_at2025-12-22 07:06:55.568028+00
updated_at2025-12-22 15:05:31.604839+00
descriptionA fast CLI tool to kill processes running on specified ports
homepagehttps://github.com/jofftiquez/pk
repositoryhttps://github.com/jofftiquez/pk
max_upload_size
id1999216
size43,939
Joff Tiquez (jofftiquez)

documentation

README

portkill 🔪🩸

                  _   _    _ _ _
  _ __   ___  _ _| |_| | _(_) | |
 | '_ \ / _ \| '_|  _| |/ / | | |
 | |_) | (_) | | | |_|   <| | | |
 | .__/ \___/|_|  \__|_|\_\_|_|_|
 |_|                             

portkill — kill processes on ports, fast.

https://github.com/user-attachments/assets/3ba50634-ed24-4ed3-b1fa-231dfcf8017f

Why portkill?

Because lsof -i :3000 -t | xargs kill -9 is too long to type.

# Before
lsof -i :3000 -t | xargs kill -9

# After
portkill 3000

Installation

Cargo (Recommended)

cargo install portkill

Homebrew

brew tap jofftiquez/tap
brew install portkill

From Source

git clone https://github.com/jofftiquez/pk.git
cd pk
cargo install --path .

Usage

Interactive mode (default)

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

Filter ports

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

Kill a specific port

$ portkill 3000
✓ Killed node (PID 12345) on port 3000

Kill multiple ports

$ portkill 3000 8080 9000
✓ Killed node (PID 12345) on port 3000
✓ Killed python (PID 12346) on port 8080
✗ No process found on port 9000

Dry run (see what would be killed)

$ portkill -n 3000
~ Would kill node (PID 12345) on port 3000

Force kill (SIGKILL instead of SIGTERM)

$ portkill -f 3000
✓ Killed node (PID 12345) on port 3000

Options

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

Comparison

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

Platform Support

  • macOS (Intel + Apple Silicon)
  • Linux (x64 + ARM)

License

MIT

Commit count: 0

cargo fmt