{
  "title": "dev loop (auto-reload on TS changes):",
  "content": "pnpm gateway:watch\nbash theme={null}\n  ssh -N -L 18789:127.0.0.1:18789 user@host\n  bash theme={null}\nopenclaw --dev setup\nopenclaw --dev gateway --allow-unconfigured",
  "code_samples": [
    {
      "code": "* Config hot reload watches `~/.openclaw/openclaw.json` (or `OPENCLAW_CONFIG_PATH`).\n  * Default mode: `gateway.reload.mode=\"hybrid\"` (hot-apply safe changes, restart on critical).\n  * Hot reload uses in-process restart via **SIGUSR1** when needed.\n  * Disable with `gateway.reload.mode=\"off\"`.\n* Binds WebSocket control plane to `127.0.0.1:<port>` (default 18789).\n* The same port also serves HTTP (control UI, hooks, A2UI). Single-port multiplex.\n  * OpenAI Chat Completions (HTTP): [`/v1/chat/completions`](/gateway/openai-http-api).\n  * OpenResponses (HTTP): [`/v1/responses`](/gateway/openresponses-http-api).\n  * Tools Invoke (HTTP): [`/tools/invoke`](/gateway/tools-invoke-http-api).\n* Starts a Canvas file server by default on `canvasHost.port` (default `18793`), serving `http://<gateway-host>:18793/__openclaw__/canvas/` from `~/.openclaw/workspace/canvas`. Disable with `canvasHost.enabled=false` or `OPENCLAW_SKIP_CANVAS_HOST=1`.\n* Logs to stdout; use launchd/systemd to keep it alive and rotate logs.\n* Pass `--verbose` to mirror debug logging (handshakes, req/res, events) from the log file into stdio when troubleshooting.\n* `--force` uses `lsof` to find listeners on the chosen port, sends SIGTERM, logs what it killed, then starts the gateway (fails fast if `lsof` is missing).\n* If you run under a supervisor (launchd/systemd/mac app child-process mode), a stop/restart typically sends **SIGTERM**; older builds may surface this as `pnpm` `ELIFECYCLE` exit code **143** (SIGTERM), which is a normal shutdown, not a crash.\n* **SIGUSR1** triggers an in-process restart when authorized (gateway tool/config apply/update, or enable `commands.restart` for manual restarts).\n* Gateway auth is required by default: set `gateway.auth.token` (or `OPENCLAW_GATEWAY_TOKEN`) or `gateway.auth.password`. Clients must send `connect.params.auth.token/password` unless using Tailscale Serve identity.\n* The wizard now generates a token by default, even on loopback.\n* Port precedence: `--port` > `OPENCLAW_GATEWAY_PORT` > `gateway.port` > default `18789`.\n\n## Remote access\n\n* Tailscale/VPN preferred; otherwise SSH tunnel:",
      "language": "unknown"
    },
    {
      "code": "* Clients then connect to `ws://127.0.0.1:18789` through the tunnel.\n* If a token is configured, clients must include it in `connect.params.auth.token` even over the tunnel.\n\n## Multiple gateways (same host)\n\nUsually unnecessary: one Gateway can serve multiple messaging channels and agents. Use multiple Gateways only for redundancy or strict isolation (ex: rescue bot).\n\nSupported if you isolate state + config and use unique ports. Full guide: [Multiple gateways](/gateway/multiple-gateways).\n\nService names are profile-aware:\n\n* macOS: `bot.molt.<profile>` (legacy `com.openclaw.*` may still exist)\n* Linux: `openclaw-gateway-<profile>.service`\n* Windows: `OpenClaw Gateway (<profile>)`\n\nInstall metadata is embedded in the service config:\n\n* `OPENCLAW_SERVICE_MARKER=openclaw`\n* `OPENCLAW_SERVICE_KIND=gateway`\n* `OPENCLAW_SERVICE_VERSION=<version>`\n\nRescue-Bot Pattern: keep a second Gateway isolated with its own profile, state dir, workspace, and base port spacing. Full guide: [Rescue-bot guide](/gateway/multiple-gateways#rescue-bot-guide).\n\n### Dev profile (`--dev`)\n\nFast path: run a fully-isolated dev instance (config/state/workspace) without touching your primary setup.",
      "language": "unknown"
    }
  ],
  "headings": [
    {
      "level": "h2",
      "text": "Remote access",
      "id": "remote-access"
    },
    {
      "level": "h2",
      "text": "Multiple gateways (same host)",
      "id": "multiple-gateways-(same-host)"
    },
    {
      "level": "h3",
      "text": "Dev profile (`--dev`)",
      "id": "dev-profile-(`--dev`)"
    }
  ],
  "url": "llms-txt#dev-loop-(auto-reload-on-ts-changes):",
  "links": []
}