Interactive CLI tool to find and kill processes by port. No more memorizing lsof -i :8080 or netstat flags.
# Using bun (recommended)
bun install -g offmyport
# Using npm
npm install -g offmyport
# Run without installing
npx offmyportgit clone https://github.com/HelgeSverre/offmyport.git
cd offmyport
# Install dependencies and make it accessible globally
bun install
bun link
# List all listening ports, pick one to kill
offmyport
# Filter to a specific port
offmyport 8080
# Filter multiple ports (comma-separated)
offmyport 80,443,8080
# Filter port ranges (inclusive)
offmyport 3000-3005
# Mix and match
offmyport 80,443,3000-3005# Kill all processes on port(s) with confirmation prompt
offmyport 3000 --kill
# Skip confirmation (use with caution)
offmyport 3000 --kill --force
# Shorthand flags
offmyport 3000 -k -f# Output process info as JSON (no TUI)
offmyport --json
# Filter and output as JSON
offmyport 3000-3005 --json- Lists all TCP listening ports with process info
- Interactive selection with arrow keys
- Choose between SIGTERM (gentle) or SIGKILL (force)
- Filter by single port, multiple ports, or port ranges
- Non-interactive mode with
--killfor scripting - JSON output with
--jsonfor scripting and piping - Press
qto quit during selection - Graceful cancellation with Ctrl+C or ESC
$ offmyport 3000
Found 1 listening process (q to quit)
? Select a process to kill:
❯ Port 3000 │ node │ PID 12345 │ user
? Kill node (PID 12345) with:
❯ SIGTERM (gentle - allows cleanup)
SIGKILL (force - immediate)
Sent SIGTERM to PID 12345 (node on port 3000)$ offmyport 3000-3005 --kill
Processes to kill (3):
Port 3000 │ node │ PID 12345 │ user
Port 3001 │ python │ PID 12346 │ user
Port 3002 │ ruby │ PID 12347 │ user
? Kill 3 processes? (y/N)$ offmyport 3000 --json
[
{
"pid": 12345,
"name": "node",
"port": 3000,
"protocol": "TCP",
"user": "helge",
"cpuPercent": 0.5,
"memoryBytes": 46137344,
"startTime": "2025-12-31T10:30:15.000Z",
"path": "/usr/local/bin/node server.js",
"cwd": "/Users/helge/projects/myapp"
}
]
| Flag | Shorthand | Description |
|---|---|---|
--json |
Output as JSON (no TUI, for scripting) | |
--kill |
-k |
Non-interactive mode, kills matching processes |
--force |
-f |
Skip confirmation prompt (use with --kill) |
--version |
-v |
Show version number |
--help |
-h |
Show help |
- macOS: Works out of the box (uses
lsof) - Linux: Uses
lsofor falls back toss(from iproute2) - Windows: Requires PowerShell 5.0+ (uses
Get-NetTCPConnection) - Node.js 18+ or Bun
This project is licensed under the MIT License - see the LICENSE.md file for details.