CLI 使用文档
Semibot CLI 完整命令参考。
核心命令速查:init(初始化)、doctor(健康检查)、up(启动)、down(停止)、status(状态)、logs(日志)、chat(对话)、run(执行任务)、ui(打开界面)、upgrade(升级)、version(版本)、configure(配置)。
服务管理
semibot up — 启动所有服务。支持 --api-port、--web-port、--runtime-host、--runtime-port、--name-prefix、--no-wait、--health-timeout、--no-runtime。
semibot down — 停止所有服务。支持 --name-prefix、--api-port、--web-port、--runtime-port、--no-runtime。
semibot status — 查看服务状态。支持 --name-prefix、--api-port、--web-port、--runtime-port。
semibot logs [service] — 查看日志,service 可选 runtime/api/web/all,--lines 指定行数。
semibot serve start/stop/restart — 通过内置 supervisor 管理 Runtime 服务。
semibot ui — 启动 UI/API 并自动打开浏览器。支持 start/stop/restart 子命令、--no-open、--no-runtime。
semibot upgrade — 安装或切换版本。支持 --release-dir、--release-url、--sha256、--version。
semibot version — 显示 CLI 版本号。会话与对话
semibot chat — 启动交互式对话。支持 --agent-id、--session-id、--model、--system-prompt、--server-url、--message(单轮执行后退出)、--json。
semibot run <task> — 执行单次任务。支持 --agent-id、--session-id、--server-url。
semibot sessions list — 列出会话。
semibot sessions show <id> — 查看会话时间线。
semibot sessions export <id> --out file.md — 导出会话。
semibot sessions resume <id> — 恢复会话。配置管理
semibot configure — 交互式配置向导。
semibot configure show — 显示完整配置。
semibot configure get <key> — 获取配置值(如 llm.default_model)。
semibot configure set <key> <value> — 设置配置值,支持 --type 指定类型。
semibot configure unset <key> — 删除配置项。Gateway 管理
semibot gateway list — 列出 Gateway 实例。
semibot gateway show <id> — 查看实例详情。
semibot gateway create --provider telegram/feishu/discord/whatsapp/imessage — 创建实例。
semibot gateway update <id> --patch '{...}' — 更新实例。
semibot gateway delete <id> — 删除实例。
semibot gateway test <id> — 发送测试消息。
semibot gateway webhook-set --provider telegram --url <url> — 注册 Webhook。
semibot gateway webhook-check — 检查 Webhook 状态。
semibot gateway doctor — 验证 Gateway 配置。
semibot gateway migrate-env — 迁移环境变量到本地 SQLite 配置。
semibot gateway batch --action enable/disable/delete — 批量管理实例。技能与工具
semibot skills list — 列出可用技能。
semibot skills install <source> — 安装技能目录。
semibot skills validate <target> — 验证技能。
semibot skills remove <name> — 移除技能。
semibot tools list — 列出内建工具。
semibot tools run <name> --args '{...}' — 执行工具。
semibot mcp list — 列出 MCP 服务器。
semibot mcp test <server> — 测试 MCP 连接。
semibot mcp call <server> <tool> --args '{...}' — 调用 MCP 工具。事件与规则
semibot events list — 列出事件,支持 --since、--type、--limit。
semibot events show <id> — 查看事件详情。
semibot events replay <id> — 回放事件。
semibot events publish <type> --payload '{...}' — 发布自定义事件。
semibot rules list — 列出规则。
semibot rules show <id> — 查看规则。
semibot rules enable/disable <id> — 启用/禁用规则。
semibot rules create --file rule.json — 创建规则。
semibot rules test --event event.json --rules rules.json — 测试规则匹配。审批管理
semibot approvals list — 列出审批,支持 --status pending/approved/rejected。
semibot approvals show <id> — 查看审批详情。
semibot approvals approve <id> --reason '...' — 通过审批。
semibot approvals reject <id> --reason '...' — 拒绝审批。
semibot approvals watch — 实时监听审批变更。记忆管理
semibot memory search <query> — 搜索记忆,支持 --category、--limit。
semibot memory write --content '...' — 写入记忆,支持 --category、--importance。
semibot memory sessions <id> — 查看会话记忆上下文。
semibot memory consolidate <id> — 整合会话记忆。
semibot memory stats — 查看记忆统计。全局选项
--output json/table/yaml/ndjson — 输出格式。
--json — 强制 JSON 输出。
--verbose — 包含 CLI 元数据。
--no-color — 禁用 ANSI 颜色。
--log-level DEBUG/INFO/WARNING/ERROR — 日志级别。
--yes — 跳过确认提示。
退出码:0 成功、1 一般错误、2 参数错误。
Semibot