OpenClaw Operations
Comprehensive reference for administering OpenClaw via CLI. Covers channels, agents, models, config, gateway, security, and maintenance.
Golden Rules
- 1. Never edit
openclaw.json directly. Use openclaw config set/get/unset or dedicated subcommands. - Always restart gateway after config changes: INLINECODE2
- Telegram accounts: NO
agent field inside account config. Route via bindings array instead. - Telegram
streaming: must be string "off", not boolean false. - JSON values in
config set need --strict-json. - Verify after every change. Run
openclaw status or the relevant status command.
Quick Diagnostics
CODEBLOCK0
Deep Audit with Claude Code
Load the docs before turning it loose — the difference is night and day.
CODEBLOCK1
CLI Reference
For the full CLI cheatsheet covering all commands, config paths, and examples:
→ Read references/cli-cheatsheet.md
Security Audit Reference
For security findings, applied fixes, and remaining remediation items:
→ Read references/security-audit.md
Common Pitfalls
| Mistake | Fix |
|---|
Put agent field in Telegram account config | Use bindings array at top level |
Set streaming: false (boolean) |
Must be
streaming: "off" (string) |
| Edited openclaw.json directly | Use CLI commands;
openclaw config set |
| Forgot gateway restart after config | Always
openclaw gateway restart |
| Used
jared@ for VPS SSH | Must use
root@clawdbot |
| Set
dmPolicy: "open" with
allowFrom: ["*"] | Use
"pairing" or explicit user IDs |
| Set
controlUi.allowedOrigins: ["*"] | Restrict to
["http://localhost:PORT"] |
Online Docs
- - Full docs: https://docs.openclaw.ai
- CLI: https://docs.openclaw.ai/cli
- Channels: https://docs.openclaw.ai/cli/channels
- Agents: https://docs.openclaw.ai/cli/agents
- Models: https://docs.openclaw.ai/cli/models
- Config: https://docs.openclaw.ai/cli/config
OpenClaw 运维操作
通过 CLI 管理 OpenClaw 的全面参考指南。涵盖频道、代理、模型、配置、网关、安全与维护。
黄金法则
- 1. 切勿直接编辑 openclaw.json。 请使用 openclaw config set/get/unset 或专用子命令。
- 配置更改后务必重启网关: openclaw gateway restart
- Telegram 账号:账号配置中不得包含 agent 字段。 请改用 bindings 数组进行路由。
- Telegram streaming:必须使用字符串 off,而非布尔值 false。
- config set 中的 JSON 值需使用 --strict-json。
- 每次更改后请验证。 运行 openclaw status 或相关状态命令。
快速诊断
bash
openclaw status # 概览
openclaw status --deep # 详细信息
openclaw doctor # 查找问题
openclaw doctor --fix # 自动修复可修复项
openclaw gateway health # 网关健康检查
openclaw security audit # 安全扫描
openclaw security audit --deep --fix # 深度扫描 + 自动修复
使用 Claude Code 进行深度审计
在放开操作前先加载文档——效果天差地别。
bash
cd ~/.openclaw
claude
阅读 https://docs.openclaw.ai/cli —— 完整的 CLI 参考文档。
现在也阅读配置和架构页面。
然后:审计此工作区的安全问题。
CLI 参考
如需涵盖所有命令、配置路径和示例的完整 CLI 速查表:
→ 阅读 references/cli-cheatsheet.md
安全审计参考
关于安全发现、已应用修复及剩余整改项:
→ 阅读 references/security-audit.md
常见陷阱
| 错误 | 修复方法 |
|---|
| 在 Telegram 账号配置中放入 agent 字段 | 在顶层使用 bindings 数组 |
| 设置 streaming: false(布尔值) |
必须使用 streaming: off(字符串) |
| 直接编辑 openclaw.json | 使用 CLI 命令;openclaw config set |
| 配置后忘记重启网关 | 始终执行 openclaw gateway restart |
| 使用 jared@ 进行 VPS SSH 连接 | 必须使用 root@clawdbot |
| 设置 dmPolicy: open 并搭配 allowFrom: [*] | 使用 pairing 或显式用户 ID |
| 设置 controlUi.allowedOrigins: [*] | 限制为 [http://localhost:PORT] |
在线文档
- - 完整文档:https://docs.openclaw.ai
- CLI:https://docs.openclaw.ai/cli
- 频道:https://docs.openclaw.ai/cli/channels
- 代理:https://docs.openclaw.ai/cli/agents
- 模型:https://docs.openclaw.ai/cli/models
- 配置:https://docs.openclaw.ai/cli/config