# rcmd guide — the complete operator reference rcmd (remotecmd-cli) is a zero-config remote command execution tool. No SSH keys, no open ports, no VPN. A relay hub brokers WebSocket connections between your machine and remote targets (daemons). This is the cloud-hosted version at https://rcmd.intrane.fr. ## How it works You ──wss──► relay ──wss──► target daemon (runs your command, returns output) - The relay is always-on (we run it at https://rcmd.intrane.fr). - Each target runs a daemon (rcmd daemon start) that dials OUT to the relay. - You run the CLI (rcmd exec ...) which also connects to the relay. - No inbound ports needed on the target — the daemon connects outbound. ## Quickstart (cloud) # 1. Sign up (gets you a token + Pro relay access) rcmd signup --email you@example.com # 2. Save your token (from the email) rcmd login # 3. On each remote machine — install + start daemon curl -fsSL https://rcmd.intrane.fr/install.sh?t= | sh rcmd daemon start --token -daemon # 4. From your machine — run commands rcmd exec --target myserver --cmd "uptime" rcmd exec --target myserver --cmd "df -h" --stream ## Command reference ### EXECUTE (single target) rcmd exec --target --cmd [--timeout ] [--stream] rcmd --target --cmd [--timeout ] [--stream] (legacy shorthand) --stream Stream stdout/stderr in real-time (like SSH) --timeout Kill the command after N seconds (default 30) ### EXECUTE (multi-target) rcmd exec --targets t1,t2,t3 --cmd [--timeout ] [--format json|table] rcmd exec --group --cmd [--timeout ] [--format json|table] Returns a result per target. --format json for machine parsing. ### FILE TRANSFER rcmd cp --target --src --dst Copy a file or directory to a remote target (via the relay, no SCP needed). ### TUNNEL (port forwarding — replaces ssh -L) rcmd tunnel --target --local --remote Forwards a local port to a remote address THROUGH the target daemon. Example: rcmd tunnel --target db --local 5432 --remote 127.0.0.1:5432 Then connect to localhost:5432 as if you were on the remote machine. ### SCHEDULED COMMANDS (cron — cloud-only) rcmd cron add --target --schedule --cmd [--timeout 30] rcmd cron list [--json] rcmd cron remove --id rcmd cron logs --id [--limit 10] rcmd cron enable --id rcmd cron disable --id Schedule format: standard 5-field cron — "min hour day month dow" "0 3 * * *" every day at 3am "*/15 * * * *" every 15 minutes "0 0 * * 0" every Sunday at midnight "0 0 1 * *" first of every month at midnight The relay runs a scheduler goroutine. When a job fires, it forwards the command to the target daemon. If the target is offline, the run is logged as "skipped" — no retry queue; the next tick tries again. History: last 500 execution results are stored. Jobs persist across relay restarts (JSON files on the relay). ### TARGET CONFIGURATION rcmd add-target --name --token Add a known target rcmd remove-target --name Remove a target rcmd list-targets [--refresh] [--json] List targets with health status rcmd set-relay --url --name Configure relay connection list-targets auto-probes stale nodes (>1h since last check). --refresh forces a re-probe of all targets. ### GROUP MANAGEMENT rcmd group create --name --targets t1,t2,... rcmd group add --name --targets t1,t2,... rcmd group remove --name --targets t1,t2,... rcmd group delete --name rcmd group list ### ALIASES (shell convenience) rcmd alias install Install: rc, rcx, rcl, rcs, rcc, rcg, rcd, rcr rcmd alias uninstall Remove aliases rc — full rcmd access rcx — execute: rcx [--stream] [timeout] rcl — list targets with health rcs — daemon status on target rcc — copy files: rcc rcg — group management rcd — daemon management rcr — relay management ### DAEMON (run on target machine) rcmd daemon start [--token ] [-daemon] Start daemon (foreground or background) rcmd daemon stop Stop daemon rcmd daemon status Check daemon status rcmd daemon systemd install Install as systemd service (survives reboots) rcmd daemon systemd remove Remove systemd service ### RELAY (run on relay hub — for self-hosting) rcmd relay daemon start [--port 3032] [-daemon] rcmd relay daemon stop rcmd relay daemon status rcmd relay daemon systemd install rcmd relay daemon systemd remove ### CLOUD ACCOUNT rcmd signup --email Sign up for Pro rcmd login Save relay token rcmd signout Sign out rcmd status [--json] Show account + config status rcmd cancel Cancel Pro subscription ### ALERTS & WEBHOOKS (Pro — hook into rcmd events) rcmd cron notify --email you@example.com Enable email alerts for cron failures rcmd cron notify --off Disable email alerts rcmd cron notify Show current alert setting rcmd webhook add --url --events Register a webhook rcmd webhook list [--json] List webhooks rcmd webhook remove --id Remove a webhook rcmd webhook test --id Send a test event Events: cron.failed Scheduled command failed (non-zero exit or target offline) cron.succeeded Scheduled command succeeded command.executed Any command was executed (via exec or cron) team.invite.accepted A team invite was accepted Webhook delivery: - POST request with JSON body - X-Rcmd-Signature: HMAC-SHA256 of body, signed with webhook secret - X-Rcmd-Event: event type - Retry once on 5xx or timeout (2s delay) ### TEAM ACCESS (Pro — scoped sub-tokens for teammates) rcmd team token --role [--targets prod,staging] [--label "Bob"] [--expires 24h] rcmd team invite --email --role [--targets prod,staging] [--label "Bob"] rcmd team accept Accept an email invite (get scoped sub-token) rcmd team list [--json] List team members rcmd team revoke --token Revoke a teammate's access rcmd team audit [--target ] [--since 7d] [--limit 50] [--json] Roles: admin Full access to all targets (except billing). No --targets needed. operator Execute, copy, tunnel, cron on assigned targets. Requires --targets. viewer List targets, check health, view cron logs. No command execution. Two ways to onboard teammates: 1. Email invite: rcmd team invite --email ... (sends an email with a code; they run: rcmd team accept ) 2. Manual token: rcmd team token --role ... (you share the token yourself via Slack/1Password) All command executions are recorded in the audit log. ### OTHER rcmd version Show version rcmd help Show help rcmd guide Print this guide ## Output contract stdout = command output (text) or JSON (--format json) stderr = error messages Exit codes: 0 ok, 3 config error, 4 relay error, 5 target error ## JSON output (--format json) Multi-target exec returns: {"ok":true,"results":{"t1":{"ok":true,"stdout":"...","exit_code":0,"duration_ms":12},...}} Cron list --json returns: {"":{"target":"...","cmd":"...","cron_expr":"...","ok":true,"timeout":10},...} ## HTTP endpoints (if you have no CLI) GET /health Relay health check GET /llms.txt This service's agent map (for AI assistants) GET /guide This document (full operator reference) GET /install.sh?t= Install script (downloads the binary) GET / Landing page (HTML) or WebSocket upgrade POST /stripe-webhook Stripe webhook receiver WSS / WebSocket — relay protocol (register, execute, etc.) ## Plan & pricing Pro: hosted relay, unlimited targets, scheduled commands, tunnels. Sign up: rcmd signup --email Cancel: rcmd cancel (or use the Stripe portal link from rcmd status) ## Recovery (lost token / lost CLI) 1. rcmd signup --email (re-signup recovers your account) 2. Check email for the token 3. rcmd login 4. curl -fsSL https://rcmd.intrane.fr/install.sh?t= | sh (fresh CLI anywhere) ## Gotchas - The daemon connects OUTBOUND — no firewall rules, no open ports on the target. - --stream gives real-time output but uses more bandwidth; use for long commands. - cron jobs only fire when the relay is running (cloud relay is always up). - If a target is offline, cron runs are logged as "skipped" (not retried). - list-targets health probe adds ~1s per target; use --no-health for instant output. - The relay validates tokens against rcmd-customers.json — use your cloud token, not a self-generated one.