A CLI tool that automatically manages multiple dev servers per git worktree with automatic port allocation, environment variable injection, and subdomain routing.
When working on multiple feature branches simultaneously using git worktrees, managing separate dev servers for each branch becomes tedious. You need to manually track ports, configure environment variables, and remember which server is running where.
portree solves this by automatically managing multiple dev servers per git worktree—with hash-based port allocation, environment variable injection, and *.localhost subdomain routing via a built-in reverse proxy.

In a typical monorepo setup with frontend and backend services:
branch-name.localhost:<port> without editing /etc/hosts$PORT, $PT_BRANCH, $PT_BACKEND_URL, etc. are injected automatically┌─────────────────────────────────────────────────────────────┐
│ git repository │
│ │
│ main worktree feature/auth worktree │
│ ┌───────────────┐ ┌───────────────┐ │
│ │ frontend :3100│ │ frontend :3117│ │
│ │ backend :8100│ │ backend :8104│ │
│ └───────────────┘ └───────────────┘ │
│ │ │ │
└─────────┼──────────────────────┼────────────────────────────┘
│ │
┌─────▼──────────────────────▼─────┐
│ portree reverse proxy │
│ │
│ :3000 ← *.localhost:3000 │
│ :8000 ← *.localhost:8000 │
└──────────────────────────────────┘
│ │
▼ ▼
main.localhost:3000 feature-auth.localhost:3000
main.localhost:8000 feature-auth.localhost:8000
FNV32(branch:service) % range. Stable across restarts..portree/logs/.proxy_port. Routes based on Host header subdomain.*.localhost — Modern browsers resolve *.localhost to 127.0.0.1 automatically per RFC 6761.
# Initialize in your project
portree init
# Start services for current worktree
portree up
# Start services for ALL worktrees
portree up --all
# Start the reverse proxy
portree proxy start
# Open the TUI dashboard
portree dash
# Check status
portree ls
Manage all your services from an interactive terminal UI:

PT_BACKEND_URL, etc.) allows services to find each other without hardcoded portsbrew install fairy-pitta/tap/portree