How to check what is running on port 3000
Run port 3000 in your terminal and Port Hero shows the process name, PID, memory usage, working directory and even the git branch of the project holding the port. It also traces the causality chain, so you see that the process was launched by npm run dev and not by some hidden daemon.
You can filter by process name with port node, target a specific PID with port --pid 4821 --why, or list every listener with the interactive TUI. Every answer arrives without remembering lsof flags.
- Process name, PID and full command line
- Git project and branch, detected without calling git
- Causality chain showing what launched the process
- Memory and CPU usage at a glance
- Container detection on Linux (Docker)
How to kill a process on a port safely
Instead of kill -9, which can corrupt data and leave orphaned children, Port Hero sends SIGTERM first, waits 1.5 seconds for a graceful shutdown, and only escalates to SIGKILL if the process ignores it. The whole process tree is handled child-first, so children do not keep the port open.
The Safety Shield refuses to touch PID 1, kernel threads, processes owned by other users or the terminal itself, and asks for confirmation before anything is terminated. Use port 3000 --kill for a graceful stop, port 3000 --force to skip the grace period, and port 3000 --restart to launch the command again detached. Keep your environment files in sync with Envy.
CI/CD integration for port management
Port Hero is designed for shell pipelines and CI workflows. port --check 3000 exits 0 if the port is busy and 2 if it is free — perfect for conditional logic in build scripts. port --wait 3000 blocks until the port is free (with a configurable timeout), and port --next 3000 prints the first available port starting from a given number.
Every action supports --json output for machine parsing, and the built-in --jq filter lets you extract exactly the fields you need without installing an external jq binary. Structured logging with --log-level debug --log-format json provides full audit trails for CI pipelines.
- port --check 3000 — test if a port is busy (exit 0) or free (exit 2)
- port --wait 3000 — block until a port is free (default 30s timeout)
- port --next 3000 — find the first available port
- port 3000 --kill --json — machine-readable kill results for CI
- port --json --jq '.[].name' — filter JSON with built-in jq engine