docs/start/setup.md
Pick a setup workflow based on how often you want updates and whether you want to run the Gateway yourself:
~/.openclaw/openclaw.json and ~/.openclaw/workspace/ so repo updates don't touch them.pnpm gateway:watch, then let the macOS app attach in Local mode.22.14+, still supported)pnpm required for source checkouts. OpenClaw loads bundled plugins from the
extensions/* pnpm workspace packages in dev mode, so root npm install does
not prepare the full source tree.If you want “100% tailored to me” and easy updates, keep your customization in:
~/.openclaw/openclaw.json (JSON/JSON5-ish)~/.openclaw/workspace (skills, prompts, memories; make it a private git repo)Bootstrap once:
openclaw setup
From inside this repo, use the local CLI entry:
openclaw setup
If you don’t have a global install yet, run it via pnpm openclaw setup.
After pnpm build, you can run the packaged CLI directly:
node openclaw.mjs gateway --port 18789 --verbose
openclaw channels login
openclaw health
If onboarding is not available in your build:
openclaw setup, then openclaw channels login, then start the Gateway manually (openclaw gateway).Goal: work on the TypeScript Gateway, get hot reload, keep the macOS app UI attached.
If you also want the macOS app on the bleeding edge:
./scripts/restart-mac.sh
pnpm install
# First run only (or after resetting local OpenClaw config/workspace)
pnpm openclaw setup
pnpm gateway:watch
gateway:watch starts or restarts the Gateway watch process in a named tmux
session and auto-attaches from interactive terminals. Non-interactive shells stay
detached and print tmux attach -t openclaw-gateway-watch-main; use
OPENCLAW_GATEWAY_WATCH_ATTACH=0 pnpm gateway:watch to keep an interactive run
detached, or pnpm gateway:watch:raw for foreground watch mode. The watcher
reloads on relevant source, config, and bundled-plugin metadata changes. If the
watched Gateway exits during startup, gateway:watch runs
openclaw doctor --fix --non-interactive once and retries; set
OPENCLAW_GATEWAY_WATCH_AUTO_DOCTOR=0 to disable that dev-only repair pass.
pnpm openclaw setup is the one-time local config/workspace initialization step for a fresh checkout.
pnpm gateway:watch does not rebuild dist/control-ui, so rerun pnpm ui:build after ui/ changes or use pnpm ui:dev while developing the Control UI.
In OpenClaw.app:
openclaw health
ws://127.0.0.1:18789; keep app + CLI on the same port.~/.openclaw/credentials/~/.openclaw/agents/<agentId>/agent/auth-profiles.json~/.openclaw/agents/<agentId>/sessions//tmp/openclaw/Use this when debugging auth or deciding what to back up:
~/.openclaw/credentials/whatsapp/<accountId>/creds.jsonchannels.telegram.tokenFile (regular file only; symlinks rejected)channels.slack.*)~/.openclaw/credentials/<channel>-allowFrom.json (default account)~/.openclaw/credentials/<channel>-<accountId>-allowFrom.json (non-default accounts)~/.openclaw/agents/<agentId>/agent/auth-profiles.json~/.openclaw/secrets.json~/.openclaw/credentials/oauth.json
More detail: Security.~/.openclaw/workspace and ~/.openclaw/ as “your stuff”; don’t put personal prompts/config into the openclaw repo.git pull + pnpm install + keep using pnpm gateway:watch.Linux installs use a systemd user service. By default, systemd stops user services on logout/idle, which kills the Gateway. Onboarding attempts to enable lingering for you (may prompt for sudo). If it’s still off, run:
sudo loginctl enable-linger $USER
For always-on or multi-user servers, consider a system service instead of a user service (no lingering needed). See Gateway runbook for the systemd notes.