CLI Reference
The prevbox CLI is a full-screen terminal app (TUI) for starting, watching and stopping tunnels.
Commands
prevbox
Launches the interactive TUI. From there you can start tunnels, watch logs and manage everything without touching a mouse.
prevboxprevbox serve
Opens the TUI and starts a tunnel to a local server. The target can be a port, anhttp protocol, or tcp for raw TCP services (HTTP is the default).
prevbox serve <target> [options]
Targets:
prevbox serve 3000 # HTTP tunnel to localhost:3000
prevbox serve http 3000 # same, explicit protocol
prevbox serve http://localhost:8080
prevbox serve tcp 25565 # raw TCP tunnel (defaults to 25565)
Options:
-s, --subdomain <name> # custom subdomain, e.g. my-app
-v, --verbose # show every request in real timeIf you're not signed in yet, the CLI opens your browser for one-click authentication automatically.
prevbox config
Opens the dashboard's settings page where you can manage API keys and account settings.
The TUI
The terminal app has five pages, switchable with the number keys:
| 1 | Dashboard | Overview of tunnels, requests and activity |
| 2 | Tunnels | List and manage all of your tunnels |
| 3 | Serve | Start a new tunnel (type a target, press Enter) |
| 4 | Logs | Live request logs from all active tunnels |
| 5 | Settings | Server config, account and connection status |
Press h inside the TUI to open the built-in help page.
Keyboard shortcuts
| 1–5 | Switch to a TUI page |
| ↑ / ↓ | Move the selection in the sidebar |
| Enter | Select the highlighted page / submit input |
| Esc | Go back to the Dashboard |
| s | Stop all running tunnels (on the Serve page) |
| q | Quit the TUI (stops all tunnels) |
Configuration
All CLI state lives in ~/.previewbox/:
| ~/.previewbox/config.json | Server URL, frontend URL and base domain |
| ~/.previewbox/token | Your session token (chmod 600) |
The default server is https://server.previewbox.dev. To sign out, delete ~/.previewbox/token or use the account menu on the dashboard.