`openclaw health`

从运行中的 Gateway 网关获取健康状态。 openclaw health openclaw health --json openclaw health --verbose 注意: --verbose 运行实时探测,并在配置了多个账户时打印每个账户的耗时。 当配置了多个智能体时,输出包括每个智能体的会话存储。

`openclaw doctor`

Gateway 网关和渠道的健康检查 + 快速修复。 相关内容: 故障排除:故障排除 安全审计:安全 示例 openclaw doctor openclaw doctor --repair openclaw doctor --deep 注意事项: 交互式提示(如钥匙串/OAuth 修复)仅在 stdin 是 TTY 且未设置 --non-interactive 时运行。无头运行(cron、Telegram、无终端)将跳过提示。 --fix(--repair 的别名)会将备份写入 ~/.openclaw/openclaw.json.bak,并删除未知的配置键,同时列出每个删除项。 macOS:launchctl 环境变量覆盖 如果你之前运行过 launchctl setenv OPENCLAW_GATEWAY_TOKEN ...(或 ...PASSWORD),该值会覆盖你的配置文件,并可能导致持续的"未授权"错误。 launchctl getenv OPENCLAW_GATEWAY_TOKEN launchctl getenv OPENCLAW_GATEWAY_PASSWORD launchctl unsetenv OPENCLAW_GATEWAY_TOKEN launchctl unsetenv OPENCLAW_GATEWAY_PASSWORD

`openclaw docs`

搜索实时文档索引。 openclaw docs browser extension openclaw docs sandbox allowHostControl

`openclaw dns`

用于广域设备发现(Tailscale + CoreDNS)的 DNS 辅助工具。目前专注于 macOS + Homebrew CoreDNS。 相关内容: Gateway 网关设备发现:设备发现 广域设备发现配置:配置 设置 openclaw dns setup openclaw dns setup --apply

`openclaw directory`

对支持目录功能的渠道进行查找(联系人/对等方、群组和"我")。 通用参数 --channel <name>:渠道 ID/别名(配置了多个渠道时为必填;仅配置一个渠道时自动选择) --account <id>:账号 ID(默认:渠道默认账号) --json:输出 JSON 格式 说明 directory 用于帮助你查找可粘贴到其他命令中的 ID(特别是 openclaw message send --target ...)。 对于许多渠道,结果来源于配置(允许列表/已配置的群组),而非实时的提供商目录。 默认输出为以制表符分隔的 id(有时包含 name);脚本中请使用 --json。 将结果用于 message send openclaw directory peers list --channel slack --query "U0" openclaw message send --channel slack --target user:U012ABCDEF --message "hello" ID 格式(按渠道) WhatsApp:+15551234567(私聊),[email protected](群组) Telegram:@username 或数字聊天 ID;群组为数字 ID Slack:user:U… 和 channel:C… Discord:user:<id> 和 channel:<id> Matrix(插件):user:@user:server、room:!roomId:server 或 #alias:server Microsoft Teams(插件):user:<id> 和 conversation:<id> Zalo(插件):用户 ID(Bot API) Zalo Personal / zalouser(插件):来自 zca 的会话 ID(私聊/群组)(me、friend list、group list) Self(“我”) openclaw directory self --channel zalouser Peers(联系人/用户) openclaw directory peers list --channel zalouser openclaw directory peers list --channel zalouser --query "name" openclaw directory peers list --channel zalouser --limit 50 群组 openclaw directory groups list --channel zalouser openclaw directory groups list --channel zalouser --query "work" openclaw directory groups members --channel zalouser --group-id <id>

`openclaw devices`

管理设备配对请求和设备范围的 token。 命令 openclaw devices list 列出待处理的配对请求和已配对的设备。 openclaw devices list openclaw devices list --json openclaw devices approve <requestId> 批准待处理的设备配对请求。 openclaw devices approve <requestId> openclaw devices reject <requestId> 拒绝待处理的设备配对请求。 openclaw devices reject <requestId> openclaw devices rotate --device <id> --role <role> [--scope <scope...>] 为特定角色轮换设备 token(可选更新 scope)。 openclaw devices rotate --device <deviceId> --role operator --scope operator.read --scope operator.write openclaw devices revoke --device <id> --role <role> 为特定角色撤销设备 token。 openclaw devices revoke --device <deviceId> --role node 通用选项 --url <url>:Gateway 网关 WebSocket URL(配置后默认使用 gateway.remote.url)。 --token <token>:Gateway 网关 token(如需要)。 --password <password>:Gateway 网关密码(密码认证)。 --timeout <ms>:RPC 超时。 --json:JSON 输出(推荐用于脚本)。 注意事项 Token 轮换会返回新 token(敏感信息)。请像对待密钥一样对待它。 这些命令需要 operator.pairing(或 operator.admin)scope。

`openclaw dashboard`

使用当前认证信息打开控制界面。 openclaw dashboard openclaw dashboard --no-open

`openclaw cron`

管理 Gateway 网关调度器的 cron 作业。 相关内容: Cron 作业:Cron 作业 提示:运行 openclaw cron --help 查看完整的命令集。 说明:隔离式 cron add 任务默认使用 --announce 投递摘要。使用 --no-deliver 仅内部运行。 --deliver 仍作为 --announce 的弃用别名保留。 说明:一次性(--at)任务成功后默认删除。使用 --keep-after-run 保留。 常见编辑 更新投递设置而不更改消息: openclaw cron edit <job-id> --announce --channel telegram --to "123456789" 为隔离的作业禁用投递: openclaw cron edit <job-id> --no-deliver

`openclaw configure`

用于设置凭证、设备和智能体默认值的交互式提示。 注意:模型部分现在包含一个用于 agents.defaults.models 允许列表的多选项(显示在 /model 和模型选择器中的内容)。 提示:不带子命令的 openclaw config 会打开相同的向导。使用 openclaw config get|set|unset 进行非交互式编辑。 相关内容: Gateway 网关配置参考:配置 Config CLI:Config 注意事项: 选择 Gateway 网关运行位置始终会更新 gateway.mode。如果这是你唯一需要的,可以不选择其他部分直接选择"继续"。 面向渠道的服务(Slack/Discord/Matrix/Microsoft Teams)在设置期间会提示输入频道/房间允许列表。你可以输入名称或 ID;向导会尽可能将名称解析为 ID。 示例 openclaw configure openclaw configure --section models --section channels

`openclaw config`

配置辅助命令:通过路径获取/设置/取消设置值。不带子命令运行将打开 配置向导(与 openclaw configure 相同)。 示例 openclaw config get browser.executablePath openclaw config set browser.executablePath "/usr/bin/google-chrome" openclaw config set agents.defaults.heartbeat.every "2h" openclaw config set agents.list[0].tools.exec.node "node-id-or-name" openclaw config unset tools.web.search.apiKey 路径 路径使用点号或括号表示法: openclaw config get agents.defaults.workspace openclaw config get agents.list[0].id 使用智能体列表索引来定位特定智能体: openclaw config get agents.list openclaw config set agents.list[1].tools.exec.node "node-id-or-name" 值 值会尽可能解析为 JSON5;否则将被视为字符串。 使用 --json 强制要求 JSON5 解析。 openclaw config set agents.defaults.heartbeat.every "0m" openclaw config set gateway.port 19001 --json openclaw config set channels.whatsapp.groups '["*"]' --json 编辑后请重启 Gateway 网关。