A powerful Go CLI tool to manage network ports across macOS, Linux, and Windows.
- Cross-Platform Support: Works on macOS, Linux, and Windows
- Port Listing: List all listening ports with detailed information
- Port Information: Get comprehensive details about specific ports
- Port Management: Close ports with graceful shutdown options
- Real-time Monitoring: Watch ports for changes in real-time
- Advanced Filtering: Filter by interface, protocol, user, and more
- Rich Output: Color-coded output with tables and detailed information
go install# List all ports
portman list
# Show detailed information
portman list --verbose
# Filter by interface
portman list --interface lo0
# Filter by protocol
portman list --protocol TCP
# Filter by user
portman list --user root# Get detailed info about a specific port
portman info 8080# Close port with confirmation
portman close 8080
# Try graceful shutdown first
portman close 8080 --graceful
# Skip confirmation prompt
portman close 8080 --force# Watch all ports every 5 seconds
portman watch
# Watch every 2 seconds
portman watch --interval 2s
# Watch specific port
portman watch --port 8080
# Watch for 10 iterations
portman watch --count 10# Show version information
portman version
# Show help
portman --help- Go 1.24+
- macOS/Linux:
lsofandpscommands - Windows:
netstatcommand - Sudo access for closing ports (Unix systems)
portman/
├── cmd/ # CLI commands
├── internal/ # Core port management logic
├── main.go # Application entry point
└── go.mod # Go module definition
- Cross-platform support for Windows, macOS, and Linux
- Graceful shutdown with SIGTERM before SIGKILL
- Real-time monitoring with change detection
- Advanced filtering by interface, protocol, and user
- Enhanced information including process start time and uptime
- Better error messages with helpful guidance
- Verbose output for detailed port information
Feel free to submit issues and enhancement requests!