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.

Usage
prevbox

prevbox 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).

Usage
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 time

If 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:

1DashboardOverview of tunnels, requests and activity
2TunnelsList and manage all of your tunnels
3ServeStart a new tunnel (type a target, press Enter)
4LogsLive request logs from all active tunnels
5SettingsServer config, account and connection status

Press h inside the TUI to open the built-in help page.

Keyboard shortcuts

1–5Switch to a TUI page
↑ / ↓Move the selection in the sidebar
EnterSelect the highlighted page / submit input
EscGo back to the Dashboard
sStop all running tunnels (on the Serve page)
qQuit the TUI (stops all tunnels)

Configuration

All CLI state lives in ~/.previewbox/:

~/.previewbox/config.jsonServer URL, frontend URL and base domain
~/.previewbox/tokenYour 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.