Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.ctrlnode.ai/llms.txt

Use this file to discover all available pages before exploring further.

Configure the Bridge with environment variables or a .env file. The open-source runtime reads configuration at startup — it does not prompt for secrets on every launch once ~/.ctrlnode/.env exists.
Install scripts (install.ps1 / install.sh) run the interactive setup and write ~/.ctrlnode/.env for you. Use this page as the reference when editing that file by hand.

Where settings live

Search order for .env (first existing file is loaded; keys already in the process environment are never overwritten from file):
  1. ./.env (current working directory)
  2. {AGENTS_FOLDER}/.ctrlnode/.env
  3. ~/.env
Shell environment always wins over file values. If you export PAIRING_TOKEN=test in PowerShell/bash, that value overrides the token in ~/.ctrlnode/.env — a common cause of auth failures. Recommended persistent location:
~/.ctrlnode/.env
Example minimal file:
PAIRING_TOKEN=your_token_from_app_bridge_setup
SAAS_URL=wss://api.ctrlnode.ai/ws/bridge

Core connection

VariableRequiredDefaultDescription
PAIRING_TOKENYesToken from CtrlNode Bridge Setup (app → project → Bridge Tokens)
SAAS_URLNowss://api.ctrlnode.ai/ws/bridgeWebSocket URL for the control plane
For self-hosted or staging stacks, set SAAS_URL to the wss://…/ws/bridge endpoint your operator provides.

Workspace layout

VariableRequiredDefaultDescription
AGENTS_FOLDERNoUser home directoryParent directory for Bridge data
The Bridge creates {AGENTS_FOLDER}/.ctrlnode/ for task folders, workspace paths, and metadata. Non–OpenClaw providers also use paths under this tree. Install scripts often set AGENTS_FOLDER in your shell profile so every terminal session agrees on the same root.

How providers are loaded

VariableRequiredDefaultDescription
PROVIDERSNoAll built-in providersComma-separated subset to load, e.g. copilot,cursor
PROVIDERNoLegacy alias for a single provider id
Default when unset:
openclaw,claude,claude-sdk,copilot,gemini,codex,cursor
Routing: CtrlNode sends sync_{provider}_agents after connect. The Bridge maps each agent id to the provider that registered it. You normally do not need to restrict PROVIDERS unless you want to disable unused implementations on a small machine.
If you set PROVIDERS=copilot but create a Codex or Cursor agent in the app, tasks for that agent may route incorrectly because sync for other providers never ran. Prefer the full default list unless you intentionally limit the host.
Per-provider install and credentials: Providers.

OpenClaw paths

VariableDefaultDescription
OPENCLAW_GATEWAY_URLhttp://localhost:18789OpenClaw gateway HTTP base URL
OPENCLAW_GATEWAY_TOKENBearer token for gateway /tools/invoke
OPENCLAW_HOME~/.openclaw (resolved)OpenClaw state directory root
OPENCLAW_CONFIG_PATHExplicit path to openclaw.json
OPENCLAW_STATE_DIRAlternative state directory hint for config resolution
If OpenClaw is in PROVIDERS but openclaw.json is missing, the Bridge logs a warning and skips OpenClaw rather than exiting. Other providers can still run.

Provider credentials (summary)

Set only what you use. Full guides: Providers.
Provider idPrimary secrets / setup
openclawOPENCLAW_GATEWAY_TOKEN, optional OPENCLAW_GATEWAY_URL
claudeClaude Code CLI login (subscription)
claude-sdkANTHROPIC_API_KEY or claude login / subscription mode
copilotCOPILOT_GITHUB_TOKEN or copilot login
geminiGEMINI_API_KEY or GOOGLE_API_KEY, or gemini auth login
codexCODEX_API_KEY or codex auth login; optional CODEX_BIN_PATH
cursorCURSOR_API_KEY (required); Node.js for the SDK runner

Connection and session timing

VariableDefaultDescription
HEARTBEAT_MS30000Heartbeat interval to the control plane
RECONNECT_MS5000Delay before reconnect after disconnect
CONNECTION_TIMEOUT_MS10000WebSocket connect timeout
POLL_CONFIG_MS60000Remote config poll interval
AGENT_IDLE_RESET_MS15000Idle threshold for agent session handling
SESSION_HISTORY_POLL_MS5000OpenClaw session history poll interval
SESSION_INACTIVITY_TIMEOUT_MINUTES5Session inactivity cutoff

Per-provider task timeouts

Each provider supports {PROVIDER}_TIMEOUT_MINUTES (default 10), for example:
  • CLAUDE_TIMEOUT_MINUTES, CLAUDE_SDK_TIMEOUT_MINUTES
  • COPILOT_TIMEOUT_MINUTES, GEMINI_TIMEOUT_MINUTES, CODEX_TIMEOUT_MINUTES, CURSOR_TIMEOUT_MINUTES

Claude / Copilot / Codex tuning

VariableProviderDescription
CLAUDE_TOOLSclaudeAllowed tools for CLI (default Read,Write,Edit)
CLAUDE_MAX_TURNSclaudeMax turns (default 20)
CLAUDE_SKIP_PERMISSIONSclaudeDefault true — avoids interactive permission prompts in unattended runs
CLAUDE_SDK_TOOLSclaude-sdkSDK tool allowlist
CLAUDE_SDK_MAX_TURNSclaude-sdkDefault 50
CLAUDE_SDK_PERMISSION_MODEclaude-sdkbypassPermissions, acceptEdits, dontAsk
CLAUDE_SDK_EXECUTABLEclaude-sdkPath to claude binary if not on PATH
CODEX_BIN_PATHcodexAbsolute path when codex is not on PATH

File watcher

VariableDefaultDescription
WATCHER_USE_POLLINGfalseSet true on network filesystems (SMB, NFS)
WATCHER_POLL_INTERVAL1000Poll interval in ms when polling is enabled

Debugging

VariableDescription
BRIDGE_INCOMING_DUMP_PATHOptional directory to dump raw inbound WebSocket payloads for support
Run ctrlnode-bridge in a terminal and watch stderr for JSON logs: handshake_sent, connecting, sync_*_agents, and provider warnings (missing API keys, skipped OpenClaw). Re-run interactive setup only when starting from an empty config: ctrlnode-bridge --setup in a TTY (not used in normal service installs).

Troubleshooting

Confirm ctrlnode-bridge is running, PAIRING_TOKEN in ~/.ctrlnode/.env is current, and no stale shell PAIRING_TOKEN overrides the file. Regenerate the token in Bridge Setup if needed.
Check the provider’s API key or CLI login. The task may show Failed or Blocked; see Events in the app for CLI output.
Ensure the agent exists in Team and the Bridge completed handshake (sync_*_agents). Reconnect the Bridge and refresh Team.
Verify the project’s agent type matches the CLI you installed. Avoid restricting PROVIDERS to a single id unless every agent in that project uses that CLI. See Providers.
CtrlNode requires a live Bridge for run, clone, and rerun. Connect the Bridge first — see Install.
Pasting tokens sometimes adds a second PAIRING_TOKEN= line. Keep one line; installers normalize common mistakes.