Try it in one line โ no install, no signup, no config:
go run github.com/agenticraptor/portspy/cmd/portspy@latest
๐ portspy 7 listening ยท sort: port updated 09:14:02
PORT PROTO PID PROCESS UPTIME ADDRESS WHAT
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
3000 tcp 44213 node 6m localhost Next.js ยท storefront
โ 5173 tcp 44980 node 6m localhost Vite ยท admin-web โ
5432 tcp 1188 postgres 3d localhost PostgreSQL
6379 tcp 1190 redis-server 3d localhost Redis
8080 tcp 52111 java 12m * Spring Boot ยท billing
8765 tcp 61002 python3 2s * api-scratch
9229 tcp 44980 node 6m localhost Vite ยท admin-web
โธ node /Users/me/code/admin-web/node_modules/.bin/vite --port 5173
โ/k up ยท โ/j down ยท enter details ยท x kill ยท / filter ยท s sort ยท ? help ยท q quit
Press enter for the full story behind a port โ including the process lineage โ
or x to kill it:
โญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ โญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ :5173/tcp โ โ Terminate this process? โ
โ โ โ โ
โ Process node (pid 44980) โ โ Port :5173/tcp โ
โ Service Vite โ โ Process node (pid 44980) โ
โ Project admin-web (node) โ โ Uptime 6m โ
โ Root /Users/me/code/admin-web โ โ Project admin-web โ
โ Address localhost โ โ Service Vite โ
โ Started 2026-06-15 09:08:14 (6m) โ โ Parent npm โ zsh โ
โ Parent npm โ zsh โ โ โ
โ โ โ node โฆ/.bin/vite --portโฆ โ
โ node โฆ/.bin/vite --port 5173 โ โ โ
โ โ โ [y] yes [n] cancel โ
โ [x] kill [X] force [esc] close โ โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
The :3000 problem
You run npm run dev. "Port 3000 is already in use." Again. So begins the
ritual: lsof -i :3000, squint at a PID, kill -9, hope it was the right one.
Was that stray process your other project's dev server? A zombie from last
week? A database? lsof won't tell you โ it gives you a number, not a story.
portspy gives you the story: which project, which dev server, which command,
running for how long โ for every port at once โ and one key to end it.
Why you'll like it
- It tells you what it is. Not just
node (44980), but Vite ยท admin-web. portspy reads each process's working directory to find the
owning project (Go, Node, Rust, Python, Ruby, PHP, Javaโฆ) and recognizes
common dev servers and databases (Vite, Next.js, Postgres, Redis, Dockerโฆ).
- Press
enter for the full story. A detail view shows the executable, the
project root, the exact start time, and the process lineage (npm โ zsh)
โ so you know precisely what you're about to kill.
- One-key kill, done safely.
x terminates gracefully (SIGTERM, escalating
to SIGKILL); X force-kills. Both confirm first, and portspy never kills
itself.
- Live & searchable. Auto-refreshing table you can filter (
/) and sort
(s) by port, PID, process, or uptime.
- Spots the exposed ones. Anything bound beyond loopback is flagged, so a
service accidentally listening on
0.0.0.0 jumps out.
- Scriptable too.
portspy list --json for your shell pipelines, and
portspy kill 3000 --yes for your Makefiles.
- One static binary. No runtime, no daemon, no telemetry, no network. Works
on macOS, Linux, and Windows.
Install
go install
go install github.com/agenticraptor/portspy/cmd/portspy@latest
Pre-built binaries
Grab a binary for your OS/arch from the
Releases page.
Homebrew (macOS / Linux)
brew install agenticraptor/tap/portspy
Available once the Homebrew tap is published โ see the note in
.goreleaser.yaml to enable it.
From source
git clone https://github.com/agenticraptor/portspy
cd portspy
make install
Quickstart
# 1. Open the interactive table (this is the whole product)
portspy
# 2. Free a port without the TUI
portspy kill 3000
# 3. See what's listening, as JSON, for scripts
portspy list --json | jq '.[] | select(.exposed)'
# 4. Check what portspy can see on your machine
portspy doctor
Full key bindings, flags, and the JSON schema live in
docs/usage.md.
How it works
listening sockets โโโ
(TCP LISTEN / โ
bound UDP) โโโบ map socket โ PID โโโ
โ โ
per-PID details โโโโโ โโโบ enrich โโโบ render
(name, command, โ โข project from cwd
exe, start time, โ โข service from command
parent lineage) โ โข merge IPv4/IPv6
โ โข flag exposed binds
โโโบ TUI ยท table ยท JSON
โ
kill โโโโโโโโ (SIGTERM โ SIGKILL,
confirmed)
Cross-platform socket and process discovery is handled by
gopsutil; the TUI is built with
Bubble Tea. See
docs/platforms.md for per-OS support and the (small)
privilege caveats.
Privacy
portspy runs entirely on your machine and makes no network connections โ no
telemetry, no update checks, nothing. It reads local socket and process
information and prints it. The only thing it changes about your system is the
processes you explicitly choose to kill.
Contributing
Contributions are very welcome โ see CONTRIBUTING.md. Good
first issues include new service-detection patterns, a --watch mode for
portspy list, and richer Windows process detail. Please also read our
Code of Conduct.
License
MIT ยฉ portspy contributors.