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
curl -fsSL https://router.direct/install.sh | shiwr https://router.direct/install.ps1 -UseBasicParsing | iexThe 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:
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.
router run --server 77.42.121.237:2333 --token sk_live_... --subdomain myapp --local 127.0.0.1:3000router run --server 77.42.121.237:2333 --token sk_live_... --tcp-port 14090 --local 127.0.0.1:22install
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
RunAtLoadandKeepAlive; logs go to~/Library/Logs/RouterDirect/. - Windows — a scheduled task that runs at logon with an auto-restart wrapper script in
%APPDATA%\RouterDirect\.
router install --server 77.42.121.237:2333 --token sk_live_... --subdomain myapp --local 127.0.0.1:3000--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.
router uninstall # default service
router uninstall --service-name blogstatus
Prints whether the installed service is running, stopped, or failed.
router statusupdate
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.
router update # interactive (asks for confirmation)
router update --yes # skip the promptConfiguration 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
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.