CLI Reference • TutorialHeader.readTime
Doctor
CLI reference for `openclaw doctor` (health checks + guided repairs)
Health checks and quick fixes for the Gateway and channels.
Related:
- Troubleshooting:Troubleshooting
- Security audit:Security
Tutorial.step
Examples
Bash
openclaw doctor openclaw doctor --repair openclaw doctor --deep
Notes:
- Interactive prompts (e.g. keychain/OAuth repairs) only run when stdin is a TTY and not running with --non-interactive. Headless runs (cron, Telegram, no terminal) skip prompts.
- --fix (alias for --repair) writes a backup to ~/.openclaw/openclaw.json.bak, removes unknown config keys, and lists each removal.
Tutorial.step
macOS: `launchctl` environment overrides
If you previously ran launchctl setenv OPENCLAW_GATEWAY_TOKEN ... (or ...PASSWORD), that value overrides your config file and can cause persistent "Unauthorized" errors.
Bash
launchctl getenv OPENCLAW_GATEWAY_TOKEN launchctl getenv OPENCLAW_GATEWAY_PASSWORD launchctl unsetenv OPENCLAW_GATEWAY_TOKEN launchctl unsetenv OPENCLAW_GATEWAY_PASSWORD