CLI Reference
Complete reference for the relayplane command-line interface. Every command, flag, and subcommand documented.
Basic Usage
1npx @relayplane/proxy [command] [options]2relayplane [command] [options]Global Options
These flags apply when starting the proxy server (the default command).
| Flag | Default | Description |
|---|---|---|
--port <number> | 4100 | Port to listen on (1–65535) |
--host <string> | 127.0.0.1 | Host/IP to bind to. Default 127.0.0.1 keeps admin endpoints local; only use 0.0.0.0 behind firewall/reverse proxy/auth. |
--offline | false | Disable all network calls except LLM API endpoints. No telemetry, no cloud sync, no update checks. |
--audit | false | Print telemetry payloads to stdout before they are sent. Useful for verifying what data is collected. |
-v, --verbose | false | Enable verbose logging (routing decisions, cache hits, config reloads). |
-h, --help | — | Print help text and exit. |
--version | — | Print version number and exit. |
--host 0.0.0.0 exposes admin and control endpoints to your network. Prefer localhost by default:
1# Recommended (local-only)2relayplane --host 127.0.0.1 --port 410034# If you must bind all interfaces, put it behind firewall + reverse proxy + auth5relayplane --host 0.0.0.0 --port 4100Commands
(default) / start
Start the proxy server. This is the default action when no command is specified. The proxy listens for incoming LLM API requests and routes them according to config.
1# Start on default port 4100 (localhost-only, safest)2relayplane34# Explicit start command (equivalent)5relayplane start67# Localhost-first custom binding8relayplane --port 3002 --host 127.0.0.1910# Network-exposed binding (only behind firewall/reverse proxy/auth)11relayplane --port 3002 --host 0.0.0.01213# Audit mode — see telemetry before it's sent14relayplane --audit1516# Offline mode — no telemetry, no cloud sync17relayplane --offline1819# Verbose logging20relayplane -vRequires at least one provider API key set as an environment variable (e.g. ANTHROPIC_API_KEY). The proxy checks for updates on startup (non-blocking).
--host 0.0.0.0 should be treated as an internet/LAN exposure mode. Protect sensitive admin routes such as /control/*, /v1/config, and /dashboard/config with firewall + reverse proxy + auth.init
Initialize the RelayPlane config file at ~/.relayplane/config.json. Creates default config if it doesn't exist.
1relayplane initExample output:
1✅ RelayPlane initialized2 Config: /home/user/.relayplane/config.json34Next steps:5 1. Start the proxy:6 relayplane start7 2. Point your agent at the proxy:8 export ANTHROPIC_BASE_URL=http://localhost:41009 export OPENAI_BASE_URL=http://localhost:410010 3. Check your costs:11 relayplane statslogin
Log in to RelayPlane cloud using a device OAuth flow. Opens a browser for approval. Credentials are stored at ~/.relayplane/credentials.json.
1relayplane loginExample output:
1 🔐 Logging in to RelayPlane...23 Your one-time code:45 📋 ABCD-123467 ✅ Browser opened to: https://relayplane.com/device8 Paste the code above and approve.910 Waiting for approval (expires in 15 minutes)...1112 ✅ Login successful!13 Team: My Team14 Plan: pro1516 ☁️ Cloud sync will activate on next proxy start.logout
Clear stored credentials. Cloud sync stops on next proxy restart.
1relayplane logoutstatus
Show proxy status, login state, plan info, and cloud sync status. Checks if the proxy process is reachable on the default port.
1relayplane statusExample output:
1 📊 RelayPlane Status2 ════════════════════34 Proxy: 🟢 Running5 Autostart: ✅ Enabled6 Account: ✅ Logged in (user@example.com)7 Plan: pro8 API Key: ••••abcd9 Cloud sync: ☁️ Activeupgrade
Check for proxy updates and install the latest version.
1relayplane upgradeenable / disable
Enable or disable RelayPlane proxy routing. When disabled, the proxy enters passthrough mode: requests are forwarded unmodified to the original provider. Updates ~/.openclaw/openclaw.json.
1relayplane enable2relayplane disabletelemetry [on|off|status]
Manage anonymous telemetry collection. Telemetry is on by default. Use telemetry off to disable.
1relayplane telemetry status # Check current setting2relayplane telemetry on # Enable telemetry3relayplane telemetry off # Disable telemetryExample output for telemetry status:
1📊 Telemetry Status2───────────────────3 Enabled: ✅ Yes4 Data file: /home/user/.relayplane/telemetry.json56 To enable: relayplane telemetry on7 To disable: relayplane telemetry off8 To audit: relayplane --auditstats
Show usage statistics: total requests, actual cost, baseline cost (what you would have spent using Opus for everything), savings percentage, and per-model/task-type breakdowns.
1relayplane statsExample output:
1📊 Usage Statistics2═══════════════════34 Total requests: 1425 Actual cost: $1.23406 Without RP: $8.56007 💰 You saved: $7.3260 (85.6%)8 Success rate: 99.3%910 By Model:11 claude-sonnet-4-6: 120 requests, $0.8200 (saved $6.1800 vs Opus)12 claude-haiku-4-5: 22 requests, $0.4140 (saved $1.1460 vs Opus)1314 By Task Type:15 code_generation: 89 requests, $0.780016 question_answering: 53 requests, $0.4540config [show|set-key <key>]
View current configuration or set the RelayPlane API key for Pro features.
1relayplane config # Show current config2relayplane config set-key rp_sk_abc123 # Set API keyExample output for config:
1⚙️ Configuration2═════════════════34 Config file: /home/user/.relayplane/config.json5 Device ID: anon_a1b2c3d4e5f6g7h86 Telemetry: ✅ Enabled7 API Key: ••••bc238 Created: 2025-01-15T10:30:00.000Z910 To set API key: relayplane config set-key <your-key>budget [status|set|reset]
Manage spend budgets. The budget system tracks daily and hourly spend windows and can block, warn, or downgrade requests when limits are exceeded.
1# Show current budget status2relayplane budget status34# Set budget limits5relayplane budget set --daily 25 --hourly 5 --per-request 167# Reset spend counters for current window8relayplane budget resetExample output for budget status:
1💰 Budget Status2 Enabled: ✅3 Daily: $12.3400 / $50 (24.7%)4 Hourly: $3.1200 / $10 (31.2%)5 Per-request: max $26 On breach: downgrade| Flag | Description |
|---|---|
--daily <usd> | Set daily spend limit in USD |
--hourly <usd> | Set hourly spend limit in USD |
--per-request <usd> | Set per-request spend limit in USD |
alerts [list|counts]
View cost alerts, anomaly detections, and budget breach history.
1# List recent alerts (default: last 20)2relayplane alerts list3relayplane alerts list 50 # Last 50 alerts45# Show alert counts by type6relayplane alerts countsExample output for alerts list:
1🔔 Recent Alerts2═════════════════3 🟡 [2025-02-25T18:30:00] threshold: Daily spend reached 80% ($40.00/$50.00)4 🔴 [2025-02-25T19:00:00] breach: Hourly limit breached ($10.50/$10.00)Example output for alerts counts:
1🔔 Alert Counts2 Threshold: 33 Anomaly: 14 Breach: 0cache [on|off|status|clear|stats]
Manage the response cache. The cache stores LLM responses locally to avoid duplicate API calls. By default only caches deterministic requests (temperature=0).
1relayplane cache status # Show cache status2relayplane cache on # Enable cache3relayplane cache off # Disable cache4relayplane cache clear # Delete all cached responses5relayplane cache stats # Detailed cache statisticsExample output for cache status:
1📦 Response Cache Status2 Enabled: ✅3 Entries: 2344 Size: 12.5 MB5 Hit rate: 34.2%6 Saved: $8.45Example output for cache stats:
1📊 Cache Statistics2 Total entries: 2343 Total size: 12.50 MB4 Hit rate: 34.2%5 Hits: 80 Misses: 154 Bypasses: 126 Saved: $8.4500 across 80 requests78 By Model:9 claude-sonnet-4-6: 180 entries, 60 hits, $6.2000 saved10 claude-haiku-4-5: 54 entries, 20 hits, $2.2500 savedservice [install|uninstall|status]
Manage RelayPlane as a system service. Supports Linux (systemd) and macOS (launchd). The service auto-starts on boot and restarts on crash.
1# Check service status2relayplane service status34# Install as system service (Linux: requires sudo)5sudo relayplane service install67# Preview what would be installed (dry run)8sudo relayplane service install --dry-run910# Remove system service11sudo relayplane service uninstallOn Linux, installs a systemd unit at /etc/systemd/system/relayplane-proxy.service with watchdog support and automatic restart. On macOS, installs a launchd plist at ~/Library/LaunchAgents/com.relayplane.proxy.plist. Current environment API keys are baked into the service file.
autostart [on|off|status]
Legacy command for managing autostart on Linux with systemd. Prefer service install for new setups.
1relayplane autostart status2sudo relayplane autostart on3sudo relayplane autostart offmesh [status|on|off|sync|contribute]
Manage the mesh learning layer (Osmosis). The mesh captures routing data locally and optionally syncs anonymized patterns to improve routing for all users.
1# Show mesh status (queries running proxy if available)2relayplane mesh status34# Enable/disable mesh5relayplane mesh on6relayplane mesh off78# Force a sync now9relayplane mesh sync1011# Manage contribution (sharing anonymized data)12relayplane mesh contribute status13relayplane mesh contribute on14relayplane mesh contribute offExample output for mesh status (proxy running):
1🧠 Mesh Learning Layer2══════════════════════3 Enabled: ✅4 Atoms (local): 14205 Atoms (synced): 8906 Last sync: 2025-02-25T18:00:00.000Z7 Endpoint: https://osmosis-mesh-dev.fly.devPort Note
The CLI default port is 4100. When using the proxy programmatically via the startProxy() function (without the CLI), the default port is 4801. The CLI always passes the port explicitly, so when running via relayplane, port 4100 is used unless overridden with --port.
Security notes
127.0.0.1 unless you explicitly need remote access. When binding to 0.0.0.0, assume /control/*, /v1/config, and /dashboard/configare sensitive admin surfaces and protect them with network and auth controls.Quick Start Examples
1# 1. Start the proxy2export ANTHROPIC_API_KEY=sk-ant-api-...3relayplane45# 2. Point your agent at it6export ANTHROPIC_BASE_URL=http://localhost:41007export OPENAI_BASE_URL=http://localhost:410089# 3. Run your agent as usual — RelayPlane routes automatically10claude # or cursor, aider, etc.1112# 4. Check savings13relayplane stats