A fast port monitoring utility for macOS that tracks development ports and their processes.
- 🚀 Fast scanning - Optimized lsof queries for 3x performance improvement
- 📊 Multiple display modes - Table view, interactive TUI, and history view
- 🎯 Smart filtering - Focus on development ports (3000+, 4000+, 8000+)
- 📝 Launch history - Automatic logging of project starts with timestamps
- 🔍 Interactive mode - Navigate, hide, kill processes, and open in browser/editor
- ⚙️ Configurable - Hide unwanted ports, customize editor
go install github.com/inem/portage@latestOr clone and build locally:
git clone https://github.com/inem/portage.git
cd portage
go installDisplay all active ports in monitored ranges:
portageOutput shows: PORT, COMMAND, PID, UPTIME, ADDRESS, PATH
Navigate and manage ports with keyboard controls:
portage -iKeybindings:
↑/↓orj/k- NavigateEnteroro- Open port in browserf- Open project path in Findere- Open project path in editorh- Hide selected portu- Unhide all portsK- Kill selected process (capital K for safety)a- Toggle show all portsq- Quit
View all discovered ports and when they were started:
portage --historyShows launch history with actual start times (calculated from process uptime).
Sort by port (ascending):
portage --sort=portDebug mode with timing information:
portage --debugHidden Ports
Hide unwanted ports using h in interactive mode. Hidden ports are saved to ~/.portage.json and persist across sessions.
Set your preferred editor using environment variables (in order of priority):
export PORTAGE_EDITOR=cursor # Portage-specific
export EDITOR=code # Fallback to system defaultDefault editor: cursor
~/.portage.json- Hidden ports configuration~/.portage.log- Discovery history log
Portage monitors ports in development ranges (3000-3999, 4000-4999, 8000-8999) by:
- Running optimized
lsofqueries to find listening ports - Getting working directory and uptime for each process
- Filtering by port ranges and hidden ports
- Logging new discoveries with actual start times
- Displaying in your chosen format
- Initial scan: ~2-3 seconds
- Uses caching for repeated PID lookups
- Optimized
lsof -a -d cwd -Fnqueries (3x faster) - Debug mode available to identify slow processes
Monitor ports sorted by uptime:
portage # Default sort is by uptime (longest first)Interactive management:
portage -i
# Navigate to a port, press 'o' to open in browser
# Press 'e' to open project in editor
# Press 'h' to hide a port you don't want to seeCheck project launch history:
portage --history
# See when each project was started and on which portMIT
Issues and pull requests welcome at https://github.com/inem/portage