419 words
2 minutes
Port Whisperer: A Rust-Built Port Management CLI

When your local dev environment gets “crowded” — port conflicts, zombie processes, can’t find who’s holding which port — it’s a headache. So I built Port Whisperer in Rust, a CLI tool focused on local port management.

What It Does#

Port Whisperer’s core idea is simple: give you a clear view of local port status at a glance, and let you quickly locate and resolve issues.

Typical daily usage looks like this:

  • ports — The dev environment feels a bit “crowded”, want a quick scan
  • ports 3000 — Frontend won’t start, need to find the process occupying the port immediately
  • ports check 3000 5173 8080 — Before launching multiple services, confirm ports are free
  • ports logs 3000 --grep error — Fish out useful signals from noisy logs
  • ports kill --signal SIGINT 3000 — Graceful stop instead of a force kill

It provides two commands: ports and whoisonport. The latter is just an alias for ports <port>, a bit more intuitive.

Installation#

The easiest way is via npm:

Terminal window
npm i -g ports-rs

macOS users can also use Homebrew:

Terminal window
brew install EasyXdc/tap/ports-rs

If you prefer Cargo, installing from source is straightforward:

Terminal window
git clone https://github.com/EasyXdc/PortsWhisper-Rust.git
cd port-whisperer-rust
cargo install --path .

Pre-compiled binaries are also available on the GitHub Releases page.

Feature Overview#

View Dev Ports#

Terminal window
ports

By default, only shows dev-related processes (Node.js, Python, Docker, frontend dev servers, etc.), so you won’t be overwhelmed by system-level port info. Want everything? Add --all.

View Specific Port Details#

Terminal window
ports 3000

Displays process name, PID, health status, framework, memory usage, uptime, working directory, project name, Git branch, process tree, and more. If there’s a listener on that port, you can confirm whether to terminate it directly.

Pre-launch Port Check#

Terminal window
ports check 3000 5173 8080

Exit code is 0 when all ports are free, 1 if any is occupied — great for scripting.

Open Local Service in Browser#

Terminal window
ports open 3000

View Logs#

Terminal window
ports logs 3000 --grep error --since 10m

Port Whisperer auto-discovers redirected stdout/stderr files, .log directories, nohup.out, and system logs (macOS unified log, Linux journalctl). --grep for filtering, --since for time range, --err to prioritize stderr.

Clean Zombie Processes#

Terminal window
ports clean

One command to clean up orphaned ports and zombie processes.

Watch Port Changes in Real-time#

Terminal window
ports watch

Performance#

Local release mode testing (hyperfine --warmup 3):

CommandTime
ports99.8 ms
ports ps96.2 ms
ports 300043.9 ms

Compared to the first-phase baseline, ports dropped from 116ms to 100ms, ports 3000 from 54ms to 44ms. Actual numbers vary by machine and load.

Tech Stack#

LayerTechnology
Core CLIRust
Distributionnpm + Node.js install script
macOS Process Discoverylsof + ps + log
Linux Process Discovery/proc + ss/netstat + ps + journalctl
Windows Process DiscoveryPowerShell + Get-NetTCPConnection/Get-Process + taskkill

Acknowledgments#

This project is a Rust rewrite of LarsenCundric/port-whisperer, preserving the core CLI workflow and user behavior while re-implementing the underlying layer in Rust.

Port Whisperer: A Rust-Built Port Management CLI
https://fuwari.vercel.app/posts/port-whisperer/
Author
EasyXdc
Published at
2026-05-15
License
CC BY-NC-SA 4.0