`moltbot agent`(直接代理运行)
适用范围
在以下情况使用本页面:
- 添加或修改代理 CLI 入口点
moltbot agent 运行单个代理轮次,而无需入站聊天消息。
默认情况下,它通过网关;添加 --local 以强制在当前机器上使用嵌入式运行时。
行为
- 必需:
--message <text> - 会话选择:
--to <dest>派生会话密钥(群组/频道目标保持隔离;直接聊天折叠为main),或--session-id <id>按 id 重用现有会话,或--agent <id>直接定向到已配置的代理(使用该代理的main会话密钥)
- 运行与正常入站回复相同的嵌入式代理运行时。
- 思考/详细标志持久化到会话存储。
- 输出:
- 默认:打印回复文本(加上
MEDIA:<url>行) --json:打印结构化有效负载 + 元数据
- 默认:打印回复文本(加上
- 使用
--deliver+--channel可选地投递回频道(目标格式匹配moltbot message --target)。 - 使用
--reply-channel/--reply-to/--reply-account覆盖投递而不更改会话。
如果网关不可达,CLI 将回退到嵌入式本地运行。
示例
moltbot agent --to +15555550123 --message "status update"
moltbot agent --agent ops --message "Summarize logs"
moltbot agent --session-id 1234 --message "Summarize inbox" --thinking medium
moltbot agent --to +15555550123 --message "Trace logs" --verbose on --json
moltbot agent --to +15555550123 --message "Summon reply" --deliver
moltbot agent --agent ops --message "Generate report" --deliver --reply-channel slack --reply-to "#reports"标志
--local:本地运行(需要在 shell 中配置模型提供商 API 密钥)--deliver:将回复发送到选定的频道--channel:投递频道(whatsapp|telegram|discord|googlechat|slack|signal|imessage,默认:whatsapp)--reply-to:投递目标覆盖--reply-channel:投递频道覆盖--reply-account:投递账户 id 覆盖--thinking <off|minimal|low|medium|high|xhigh>:持久化思考级别(仅限 GPT-5.2 + Codex 模型)--verbose <on|full|off>:持久化详细级别--timeout <seconds>:覆盖代理超时--json:输出结构化 JSON