Documentation Index
Fetch the complete documentation index at: https://openclaw.zhcndoc.com/llms.txt
Use this file to discover all available pages before exploring further.
openclaw agent 从命令行运行单个 agent 回合,无需传入
聊天消息。可用于脚本化工作流、测试和
程序化投递。
快速开始
标志
| Flag | Description |
|---|---|
--message \<text\> | 要发送的消息(必填) |
--to \<dest\> | 从目标(电话、聊天 id)派生 session key |
--agent \<id\> | 目标为已配置的 agent(使用其 main 会话) |
--session-id \<id\> | 按 id 复用现有会话 |
--local | 强制使用本地嵌入式运行时(跳过 Gateway) |
--deliver | 将回复发送到聊天渠道 |
--channel \<name\> | 投递渠道(whatsapp、telegram、discord、slack 等) |
--reply-to \<target\> | 覆盖投递目标 |
--reply-channel \<name\> | 覆盖投递渠道 |
--reply-account \<id\> | 覆盖投递账号 id |
--thinking \<level\> | 为所选模型配置文件设置 thinking 级别 |
--verbose \<on|full|off\> | 设置详细输出级别 |
--timeout \<seconds\> | 覆盖 agent 超时时间 |
--json | 输出结构化 JSON |
行为
- 默认情况下,CLI 会通过 Gateway 运行。添加
--local可强制在当前机器上使用 嵌入式运行时。 - 如果 Gateway 不可达,CLI 会回退到本地嵌入式运行。
- 会话选择:
--to会派生 session key(群组/频道目标保持隔离;直接聊天会折叠为main)。 - thinking 和 verbose 标志会持久保存到会话存储中。
- 输出:默认输出纯文本,或使用
--json输出结构化负载 + 元数据。
示例
相关内容
- Agent CLI reference
- Sub-agents — 后台 sub-agent 启动
- Sessions — session key 的工作方式