@hehehai/port-audit
v0.1.14
Published
A TUI tool for managing TCP listening ports on macOS.
Readme
port-audit
A TUI tool for managing TCP listening ports on macOS.
Features
- List all TCP listening ports
- Show process source for each port, using the working directory when useful and the app/process name for macOS app services
- Show process uptime for each port, based on process start time
- Infer how a port was launched, such as from a terminal app, Codex, or another macOS app
- Real-time refresh (every 2 seconds)
- Search filter (by port number, process name, source, or launcher)
- Kill processes (SIGTERM → SIGKILL)
- Tokyo Night theme
Requirements
- Bun runtime (development only)
Installation
Homebrew:
brew install hehehai/tap/port-auditNo Bun runtime is required for the prebuilt binary.
npm:
npm i -g @hehehai/port-auditmacOS only. The npm package ships a prebuilt binary.
npx:
npx portauditGitHub Packages:
npm config set @hehehai:registry https://npm.pkg.github.com
npm i -g @hehehai/port-auditGitHub Release (macOS binary):
curl -L -o port-audit.tar.gz https://github.com/hehehai/port-audit/releases/download/vX.Y.Z/port-audit-vX.Y.Z-macos.tar.gz
tar -xzf port-audit.tar.gz
./port --helpGitHub Release (Linux binary):
curl -L -o port-audit.tar.gz https://github.com/hehehai/port-audit/releases/download/vX.Y.Z/port-audit-vX.Y.Z-linux.tar.gz
tar -xzf port-audit.tar.gz
./port --helpGitHub Release (Windows binary):
curl -L -o port-audit.tar.gz https://github.com/hehehai/port-audit/releases/download/vX.Y.Z/port-audit-vX.Y.Z-windows.tar.gz
tar -xzf port-audit.tar.gz
.\port.exe --helpFrom source:
bun install
bun linkOne-line installer:
curl -fsSL https://raw.githubusercontent.com/hehehai/port-audit/main/scripts/install.sh | shUsage
portFor development:
bun run dev:tuiLint:
bun run lintTest:
bun run testCLI
port --help
port list
port list -s 3001
port list -s chrome
port k 3001port list prints:
PORT PID COMMAND UPTIME USER LAUNCHED BY SOURCE NAME
3002 21370 node 1h 2m guanwei Ghostty ~/x/doit/my-app/apps/web [::1]:3002
9222 644 Google 2d 21h guanwei Google Chrome Google Chrome 127.0.0.1:9222UPTIMEis the process runtime, derived from the process start time.LAUNCHED BYis inferred from the process parent chain. It can identify terminal apps, Codex, or app-backed services when that parent chain is still available.SOURCEis the best available source hint. Project services usually show a shortened working directory; app-backed services usually show the app or process name.- The TUI detail row shows the fuller launch chain when available, such as
Ghostty > zsh > pnpm > vite. - Search matches port, command, user, launcher, source, working directory, executable path, and socket name.
Dev CLI:
bun run cli -- --helpKeybindings
| Key | Action |
|---|---|
| ↑/k | Move up |
| ↓/j | Move down |
| / | Search |
| esc | Exit search |
| x/Enter | Kill process |
| r | Refresh |
| q | Quit |
Tech Stack
- OpenTUI - Terminal UI framework
- React 19
- Bun
