CLI Commands

Complete reference for all PortPilot commands.

Tip: Use pp as a shorthand for portpilot — e.g., pp ls, pp start myapp -d

Setup & Status

bash
portpilot init # Download mkcert, install CA, generate SSL certs
portpilot init --tld dev # Initialize with custom TLD (e.g., .dev instead of .test)
portpilot status # Show config, SSL status, proxy status
portpilot sync # Sync hosts file with registered projects

Configuration

bash
portpilot config # View current configuration
portpilot config --tld dev # Change TLD to .dev (run sync afterward)
portpilot config --allow-dots # Allow dots in project names (e.g., emojicopy.com)
portpilot config --no-allow-dots # Disallow dots in project names (default)

Project Management

bash
portpilot add [name] # Register current directory
portpilot add myapp -p /path/to/project # Register specific path
portpilot add myapp --port 4000 # Use a specific port
portpilot add myapp -c "custom command" # Use custom dev command
portpilot remove <name|id> # Unregister project (alias: rm)
portpilot list # Show all projects with ID and status (alias: ls)

Server Control

All server commands accept either the project name or its ID (shown in portpilot list):

bash
portpilot start [name|id] # Run dev server (foreground, shows logs)
portpilot start [name|id] -d # Run in background (detached)
portpilot start --all -d # Start all projects in background
portpilot stop [name|id] # Stop server
portpilot stop --all # Stop all servers
portpilot restart [name|id] # Restart server
portpilot restart [name|id] -d # Restart in background

Examples

bash
portpilot start 4 # Start project with ID 4
portpilot stop triton # Stop project named "triton"

Logs

bash
portpilot logs [name|id] # View logs (background processes)
portpilot logs [name|id] -f # Follow logs live (like tail -f)
portpilot logs [name|id] -n 100 # Show last 100 lines
portpilot logs [name|id] --clear # Clear log file

Proxy Control

bash
portpilot proxy # Run proxy in foreground
portpilot proxy -d # Run proxy in background (daemon)
portpilot proxy stop # Stop background proxy
portpilot proxy status # Check if proxy is running
portpilot proxy logs # View proxy logs
portpilot proxy --https-redirect # Force HTTP to HTTPS redirect

Utilities

bash
portpilot open [name|id] # Open in browser (uses HTTPS if available)
portpilot open [name|id] -s # Force HTTPS

Quick Commands

When inside a registered project directory, you can omit the project name:

bash
cd ~/projects/my-app
portpilot start # Starts my-app
portpilot stop # Stops my-app
portpilot restart # Restarts my-app
portpilot logs # Shows my-app logs
portpilot open # Opens my-app in browser