`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 dns`

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

`openclaw docs`

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

`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 health`

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

`openclaw hooks`

管理智能体钩子(针对 /new、/reset 等命令以及 Gateway 网关启动的事件驱动自动化)。 相关内容: 钩子:钩子 插件钩子:插件 列出所有钩子 openclaw hooks list 列出从工作区、托管目录和内置目录中发现的所有钩子。 选项: --eligible:仅显示符合条件的钩子(满足要求) --json:以 JSON 格式输出 -v, --verbose:显示详细信息,包括缺失的要求 示例输出: Hooks (3/3 ready) Ready: 🚀 boot-md ✓ - Run BOOT.md on gateway startup 📝 command-logger ✓ - Log all command events to a centralized audit file 💾 session-memory ✓ - Save session context to memory when /new command is issued 示例(详细模式): openclaw hooks list --verbose 显示不符合条件的钩子缺失的要求。 示例(JSON): openclaw hooks list --json 返回结构化 JSON,供程序化使用。 ...

`openclaw logs`

通过 RPC 跟踪 Gateway 网关文件日志(在远程模式下可用)。 相关内容: 日志概述:日志 示例 openclaw logs openclaw logs --follow openclaw logs --json openclaw logs --limit 500

`openclaw memory`

管理语义记忆的索引和搜索。 由活跃的记忆插件提供(默认:memory-core;设置 plugins.slots.memory = "none" 可禁用)。 相关内容: 记忆概念:记忆 插件:插件 示例 openclaw memory status openclaw memory status --deep openclaw memory status --deep --index openclaw memory status --deep --index --verbose openclaw memory index openclaw memory index --verbose openclaw memory search "release checklist" openclaw memory status --agent main openclaw memory index --agent main --verbose 选项 通用选项: --agent <id>:限定到单个智能体(默认:所有已配置的智能体)。 --verbose:在探测和索引期间输出详细日志。 说明: memory status --deep 探测向量存储和嵌入模型的可用性。 memory status --deep --index 在存储有未同步变更时运行重新索引。 memory index --verbose 打印每个阶段的详细信息(提供商、模型、数据源、批处理活动)。 memory status 包含通过 memorySearch.extraPaths 配置的所有额外路径。

`openclaw message`

用于发送消息和渠道操作的单一出站命令 (Discord/Google Chat/Slack/Mattermost(插件)/Telegram/WhatsApp/Signal/iMessage/MS Teams)。 用法 openclaw message <subcommand> [flags] 渠道选择: 如果配置了多个渠道,则必须指定 --channel。 如果只配置了一个渠道,则该渠道为默认值。 可选值:whatsapp|telegram|discord|googlechat|slack|mattermost|signal|imessage|msteams(Mattermost 需要插件) 目标格式(--target): WhatsApp:E.164 或群组 JID Telegram:聊天 ID 或 @username Discord:channel:<id> 或 user:<id>(或 <@id> 提及;纯数字 ID 被视为频道) Google Chat:spaces/<spaceId> 或 users/<userId> Slack:channel:<id> 或 user:<id>(接受纯频道 ID) Mattermost(插件):channel:<id>、user:<id> 或 @username(纯 ID 被视为频道) Signal:+E.164、group:<id>、signal:+E.164、signal:group:<id> 或 username:<name>/u:<name> iMessage:句柄、chat_id:<id>、chat_guid:<guid> 或 chat_identifier:<id> MS Teams:会话 ID(19:[email protected])或 conversation:<id> 或 user:<aad-object-id> 名称查找: 对于支持的提供商(Discord/Slack 等),如 Help 或 #help 之类的频道名称会通过目录缓存进行解析。 缓存未命中时,如果提供商支持,OpenClaw 将尝试实时目录查找。 通用标志 --channel <name> --account <id> --target <dest>(用于 send/poll/read 等的目标渠道或用户) --targets <name>(可重复;仅限广播) --json --dry-run --verbose 操作 核心 send ...

`openclaw models`

模型发现、扫描和配置(默认模型、回退、认证配置)。 相关内容: 提供商 + 模型:模型 提供商认证设置:快速开始 常用命令 openclaw models status openclaw models list openclaw models set <model-or-alias> openclaw models scan openclaw models status 显示已解析的默认模型/回退配置以及认证概览。 当提供商使用快照可用时,OAuth/令牌状态部分会包含提供商使用头信息。 添加 --probe 可对每个已配置的提供商配置运行实时认证探测。 探测会发送真实请求(可能消耗令牌并触发速率限制)。 使用 --agent <id> 可检查已配置智能体的模型/认证状态。省略时, 命令会使用 OPENCLAW_AGENT_DIR/PI_CODING_AGENT_DIR(如已设置),否则使用 已配置的默认智能体。 注意事项: models set <model-or-alias> 接受 provider/model 或别名。 模型引用通过在第一个 / 处拆分来解析。如果模型 ID 包含 /(OpenRouter 风格),需包含提供商前缀(示例:openrouter/moonshotai/kimi-k2)。 如果省略提供商,OpenClaw 会将输入视为别名或默认提供商的模型(仅在模型 ID 不包含 / 时有效)。 models status 选项: --json --plain --check(退出码 1=已过期/缺失,2=即将过期) --probe(对已配置的认证配置进行实时探测) --probe-provider <name>(探测单个提供商) --probe-profile <id>(可重复或逗号分隔的配置 ID) --probe-timeout <ms> --probe-concurrency <n> --probe-max-tokens <n> --agent <id>(已配置的智能体 ID;覆盖 OPENCLAW_AGENT_DIR/PI_CODING_AGENT_DIR) 别名 + 回退 openclaw models aliases list openclaw models fallbacks list 认证配置 openclaw models auth add openclaw models auth login --provider <id> openclaw models auth setup-token openclaw models auth paste-token models auth login 运行提供商插件的认证流程(OAuth/API 密钥)。使用 openclaw plugins list 查看已安装的提供商。 ...