PortForge
Modern cross-platform port inspector & manager for developers
Know what's running on your ports β instantly, with rich developer context.
β¨ Features
- π Blazing fast β <50ms cold start, single static binary (~5-8 MB)
- π₯οΈ Beautiful TUI β Full interactive terminal UI with vim keybindings
- π Web Dashboard β Optional HTMX-powered web interface (feature flag)
- π Project Detection β Auto-detects 20+ languages & 40+ frameworks
- π Git Integration β Shows branch name and dirty status
- π³ Docker/Podman β Native container port mapping via Bollard API
- π₯ Health Checks β HTTP probes with framework-aware endpoints
- π² Process Trees β Drill down into parent/child process hierarchies
- π Resource Monitoring β CPU%, memory, uptime per process
- π§Ή Safe Cleanup β Orphan/zombie detection with dry-run preview
- π€ Export β JSON, CSV, and pretty table output
- βοΈ Configurable β TOML config file for custom behavior
- π» Cross-platform β Linux, macOS, and Windows
π¦ Installation
From Source (Cargo)
From GitHub Releases
Download the latest binary for your platform from Releases.
# macOS / Linux
OS=
[ && OS="macos"
ARCH=
[ && ARCH="aarch64"
|
Build from Source
# With web dashboard
π Quick Start
# Launch interactive TUI (default)
# Show all ports (including non-dev)
# Inspect a specific port
# Kill a process on a port
# Clean orphaned processes
# Live watch mode
# Export as JSON
# Launch web dashboard (requires --features web)
π₯οΈ TUI Keybindings
| Key | Action |
|---|---|
j / β |
Move down |
k / β |
Move up |
g / G |
Go to top / bottom |
Enter / d |
View port details |
K |
Kill process (with confirmation) |
t |
Process tree view |
/ |
Search / filter |
a |
Toggle all / dev ports |
1-8 |
Sort by column |
Tab |
Next tab |
Shift+Tab |
Previous tab |
T |
Cycle theme |
m |
Toggle mouse support |
? |
Help overlay |
q / Esc |
Quit / go back |
While the search bar is open, j and k continue moving through the filtered result set.
π Web Dashboard
Enable the web dashboard with the web feature flag:
The dashboard provides:
- π Real-time stats cards (ports, healthy, docker, memory)
- π Auto-refreshing port table (HTMX, every 3s)
- π Click-to-inspect port details
- π΄ One-click kill with confirmation
- π Client-side search filtering
- π Beautiful dark glassmorphism theme
βοΈ Configuration
Generate a default config file:
Configuration is stored at ~/.config/portforge.toml:
[]
= 2 # Watch mode refresh (seconds)
= false # Show non-dev ports by default
= true # Enable Docker integration
= true # Enable HTTP health probes
= "dark" # Color theme
[]
= 2000 # Health check timeout
[]
= "/api/health"
= "/health"
= "/up"
= "/actuator/health"
= "/health/"
= "grpc:" # TCP connect check
= "ws:" # TCP connect check
# Per-port overrides
# [ports.3000]
# label = "My Frontend"
# health_endpoint = "/api/status"
# hidden = false
# [ports.50051]
# label = "Local gRPC API"
# health_endpoint = "grpc:"
# hidden = false
# [ports.3001]
# label = "Socket Server"
# health_endpoint = "ws:"
# hidden = false
Health endpoint prefixes:
grpc:orgrpc://uses a TCP connection check instead of HTTP for gRPC-style services.ws:,ws://, orwebsocket:uses a TCP connection check instead of HTTP for WebSocket-style services.- Plain values like
/healthcontinue to use normal HTTP probing.
ποΈ Architecture
portforge/
βββ src/
β βββ main.rs # CLI entry point
β βββ lib.rs # Library root
β βββ cli.rs # Clap CLI definitions
β βββ scanner.rs # Core port scanning & enrichment
β βββ models.rs # Data structures
β βββ process.rs # Kill, clean, process tree
β βββ project.rs # Framework detection (20+ languages)
β βββ docker.rs # Bollard Docker/Podman integration
β βββ git.rs # git2 branch/dirty detection
β βββ health.rs # HTTP health probes
β βββ config.rs # TOML configuration
β βββ export.rs # JSON/CSV/table output
β βββ error.rs # Error types (thiserror)
β βββ tui/ # Ratatui interactive TUI
β βββ web/ # Axum + HTMX web dashboard
βββ tests/ # Integration tests
Key dependencies:
ratatuiβ Terminal UI frameworkcrosstermβ Terminal backendsysinfoβ System/process infolistenersβ PortβPID mappingbollardβ Docker API clientgit2β Git integrationaxumβ Web framework (optional)
π€ Contributing
Contributions are welcome! Please read CONTRIBUTING.md for guidelines.
πΊοΈ Roadmap
See ROADMAP.md for the project roadmap.
π License
This project is licensed under the MIT License β see LICENSE for details.
π Security
Please see SECURITY.md for our security policy.