CLI reference

The router client is a single pure-Rust binary (currently v1.0.0) for macOS, Linux, and Windows. It has five subcommands: run, install, uninstall, status, and update.

Installation

macOS & Linux
curl -fsSL https://router.direct/install.sh | sh
Windows (PowerShell)
iwr https://router.direct/install.ps1 -UseBasicParsing | iex

The installer places the binary at /usr/local/bin/router (macOS/Linux) or %LOCALAPPDATA%\router-direct\router.exe (Windows) and adds it to your PATH. You can also download binaries directly from https://router.direct/bin/.

Shared flags

run and install accept the same tunnel flags:

FlagDescriptionDefault
--server, -sRelay address to connect to, host:port.—
--token, -tAPI key for the tunnel (sk_live_…).—
--local, -lLocal address to forward traffic to. Must be host:port.127.0.0.1:3000
--subdomain, -dRequest an HTTP tunnel on this subdomain.—
--tcp-port, -pRequest a TCP tunnel on this public port.—
--udp-port, -uRequest a UDP tunnel on this public port.—

Exactly one of --subdomain, --tcp-port, or --udp-port must be given, and it must match the tunnel type of the API key you created in the dashboard.

run

Starts the tunnel in the foreground. The connection loop never exits on its own: disconnects are retried with exponential backoff (capped at 60 seconds), a 40-second watchdog reconnects if the relay goes silent, and the client answers relay heartbeats (30-second pings) automatically. Press Ctrl+C to stop.

HTTP example
router run --server 77.42.121.237:2333 --token sk_live_... --subdomain myapp --local 127.0.0.1:3000
TCP example (SSH)
router run --server 77.42.121.237:2333 --token sk_live_... --tcp-port 14090 --local 127.0.0.1:22

install

Registers the tunnel as a persistent system service and starts it immediately. The service invokes router run with the same flags, so it inherits all the reconnection behavior.

  • Linux (systemd) — system-wide unit when run as root, otherwise a user unit with linger enabled; OpenRC script on Alpine.
  • macOS — a launchd agent with RunAtLoad and KeepAlive; logs go to ~/Library/Logs/RouterDirect/.
  • Windows — a scheduled task that runs at logon with an auto-restart wrapper script in %APPDATA%\RouterDirect\.
FlagDescriptionDefault
--service-nameIdentifier for the service. Lets you run multiple tunnels side by side.router-direct
install as a persistent service
router install --server 77.42.121.237:2333 --token sk_live_... --subdomain myapp --local 127.0.0.1:3000
TipRun multiple tunnels by giving each its own --service-name, e.g. router install … --service-name blog.

uninstall

Stops and removes the installed service (and its wrapper files). Tunnel records are not deleted — remove those from the dashboard.

uninstall
router uninstall                # default service
router uninstall --service-name blog

status

Prints whether the installed service is running, stopped, or failed.

status
router status

update

Checks https://dashboard.router.direct/api/version, and if a newer version exists, downloads the matching platform binary and replaces the current executable atomically (with automatic rollback if the swap fails). The same check runs silently on every run startup.

update
router update        # interactive (asks for confirmation)
router update --yes  # skip the prompt

Configuration file

Defaults are stored per OS in config.toml:

  • macOS: ~/Library/Application Support/com.router.direct/config.toml
  • Linux: ~/.config/router-direct/config.toml
  • Windows: %APPDATA%\router-direct\config.toml
config.toml
api_url = "https://dashboard.router.direct/api"
default_server = "77.42.121.237:2333"

[profiles."you@example.com"]
email = "you@example.com"
api_key = "sk_live_..."

If the file is missing, the client falls back to the defaults shown above.