kill processes by port.
Beautifully.
A blazing-fast CLI that finds and kills processes hogging your ports. Interactive TUI, watch mode, process trees, and zero dependencies.
Why slay?
Everything you need to reclaim your ports.
Interactive TUI
Search, browse, and multi-select processes with keyboard navigation.
slay -iKill Animations
Watch a bullet fly across your terminal when a process gets slayed.
slay 3000Graceful Shutdown
SIGTERM first, escalate to SIGKILL only if the process refuses to die.
slay -g 3000Watch Mode
Keep polling and auto-kill processes that respawn on your port.
slay -w 3000Process Trees
Kill the entire process tree, children first, for clean teardown.
slay --tree 3000JSON Output
Pipe NDJSON to jq for scripting, CI pipelines, and automation.
slay --json 3000Smart Labels
Auto-detects Node, Python, Docker, PostgreSQL, Vite, and 20+ more.
slay --allZero Dependencies
No bloat. Ships only what it needs. Installs in under a second.
npm i -g slay-portCross-Platform
Works on macOS (lsof), Linux (lsof), and Windows (netstat + taskkill).
works everywhere ✓Profile Presets
Save port combos and flags as named profiles. Run slay --profile dev.
slay --profile devPort Ranges
Kill a range of ports with slay 8000-8010.
slay 8000-8010Port Info
Inspect ports without killing. See PID, CPU, memory, and uptime.
slay info 3000Shell Completions
Tab-complete commands, flags, and profile names in bash, zsh, and fish.
slay completions zshKill by Name
Target processes by name with regex support. Exclude specific processes from bulk kills.
slay --name "node.*"Post-Kill Hooks
Automatically run commands after killing — restart servers, trigger builds, or notify your team.
slay 3000 --then "npm start"Port Availability
Check if ports are free, find the next available port. Perfect for CI scripts and automation.
slay check 3000Stop guessing PIDs
The old way is painful. The slay way is one command.
The old way
The slay way
Get started
Up and running in one command.
npx slay-port 3000 npm i -g slay-port && slay 3000 pnpm dlx slay-port 3000 pnpm add -g slay-port && slay 3000 yarn dlx slay-port 3000 yarn global add slay-port && slay 3000 bunx slay-port 3000 bun add -g slay-port && slay 3000 brew install hammadxcm/slay/slay-port brew install hammadxcm/slay/slay-port && slay 3000 sudo snap install slay-it --classic sudo snap install slay-it --classic && slay 3000 sudo apt install slay-port sudo apt install slay-port && slay 3000 scoop bucket add slay https://github.com/hammadxcm/scoop-slay && scoop install slay scoop install slay && slay 3000 winget install hammadxcm.slay-port winget install hammadxcm.slay-port && slay 3000 import { findByPort, killProcess } from 'slay-port' See it in action
Fifteen ways to slay.
Basic Kill
Interactive Mode
Watch Mode
Force Kill
Graceful Shutdown
Multi-port
Dry Run
Process Tree
Kill by Name
Post-Kill Hook
Port Check
Init Config
Run Profile
Port Range
JSON Output
UDP Ports
All Listeners
Verbose Mode
Programmatic API
Use slay as a library in your Node.js projects.
Exports
-
findByPort(platform, port)Find processes on a specific port -
findByPorts(platform, ports)Find processes on multiple ports -
findAllListening(platform)Find all listening processes -
killProcess(platform, proc)Kill a single process -
killAll(platform, procs)Kill multiple processes -
enrichLabel(proc)Add smart labels to a process