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.
Kill Animations
Watch a bullet fly across your terminal when a process gets slayed.
Graceful Shutdown
SIGTERM first, escalate to SIGKILL only if the process refuses to die.
Watch Mode
Keep polling and auto-kill processes that respawn on your port.
Process Trees
Kill the entire process tree, children first, for clean teardown.
JSON Output
Pipe NDJSON to jq for scripting, CI pipelines, and automation.
Smart Labels
Auto-detects Node, Python, Docker, PostgreSQL, Vite, and 20+ more.
Zero Dependencies
No bloat. Ships only what it needs. Installs in under a second.
Cross-Platform
Works on macOS (lsof), Linux (lsof), and Windows (netstat + taskkill).
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 import { findByPort, killProcess } from 'slay-port' See it in action
Twelve ways to slay.
Basic Kill
Interactive Mode
Watch Mode
Force Kill
Graceful Shutdown
Multi-port
Dry Run
Process Tree
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