Skip to content

命令参考

按 service 列出全部子命令。依赖标记:🟢 不需要 daemon · 🟡 需要 daemon 在跑 · 🔵 管理 daemon 自身。 所有命令支持全局 flags(--profile / --format / --quiet / --no-color),见命令体系与输出

config — 配置管理 🟢

命令说明
config init交互式首次向导,生成 config.json + gateway token,打印手机端配置摘要。支持 --non-interactive --from-file <config.json>- 读 stdin)、--force 覆盖。
config show显示当前 profile 配置(敏感字段遮罩)。--show-secrets 明文输出(需 TTY + 二次确认)。
config set <key> <value>设置单个配置项,支持点号路径(daemon.portnotification.ignoredApps 用逗号分隔)。
config unset <key>删除单个配置项。
bash
yoooclaw config init
yoooclaw config set daemon.port 18789
yoooclaw config show --format json

profile — 多 profile 管理 🟢

命令说明
profile list列出所有 profile,标注 active。
profile use <name>切换 active profile。
profile create <name>新建 profile(走 config init 向导)。
profile delete <name>删除 profile(不允许删 active,需 --yes)。

auth — 凭据与鉴权

命令说明
auth set-api-key <key> 🟢写 account 级 api-key 到共享凭据文件(- 从 stdin 读,避免进 shell history)。--keychain 写 OS keychain。
auth status 🟢显示 api-key / gateway token 是否存在、来源(env/keychain/file)、daemon 是否可达。不调 daemon。
auth token-rotate 🟡生成新 gateway token 并写入(按 auth.tokenRef)。--length <n> 字节长度,默认 32。
auth check 🟡端到端鉴权体检:用本地 token 调 daemon /daemon/status 验证一致性。
bash
echo 'ock_xxx' | yoooclaw auth set-api-key -
yoooclaw auth status --format json

daemon — 守护进程管理 🔵

命令说明
daemon start启动 daemon,默认 fork 到后台 detach。--bind <host>--port <n>--no-detach(systemd/launchd 用)、--log-level <level>
daemon stop发送 SIGTERM,最多等 10s 后 SIGKILL。
daemon restart等同 stop + start,保留原启动参数。
daemon status打印 PID、监听地址、启动时间、relay 状态、灯效规则数、最近 ingest、内存占用。
daemon logs跟踪 daemon 日志。-f, --follow--lines <n>(默认 100)、--level <level>
bash
yoooclaw daemon start
yoooclaw daemon status --format json
yoooclaw daemon logs --lines 200 --level error

notification — 通知查询 🟢

命令说明
notification search按条件查询,时间倒序。--from/--to <iso8601>--app--sender--conversation-type group|private--keyword--limit(默认 100)。
notification summary聚合统计 + 样例摘要,供 Agent 总结。追加 --sample <n>(默认 30)、--top <n>(默认 10)。
notification stats按维度聚合。--from/--to <YYYY-MM-DD>--app--dim date|app|sender|hour|all
notification storage-path打印 notifications 目录绝对路径。
notification +today今日通知。
notification +recent最近 1 小时通知。

--app 支持中英文别名:微信/wechat飞书/feishu/lark钉钉/dingtalk企业微信/wecomqq 等。

bash
yoooclaw notification search --app 微信 --keyword 开会 --format ndjson
yoooclaw notification summary --top 10 --format json

sync — 通知同步给记忆系统 🟢

供外部记忆系统按批次拉取通知的 checkpoint 协议。

命令说明
sync scan扫描未处理通知,返回各日期待同步摘要。
sync fetch --date <YYYY-MM-DD>获取指定日期未处理通知详情。--max-end-index <n> 用于幂等切片。
sync commit --date <YYYY-MM-DD>标记当前批次处理完成。--end-index <n> 精确提交。

recording — 录音管理

命令说明
recording list 🟢列出所有录音。--status <status> 按传输状态过滤。
recording status <id> 🟢单条录音详情(metadata、文件路径、ASR 状态、错误)。
recording storage-path 🟢打印录音存储目录绝对路径。
recording setup-asr 🟢配置 ASR 转写参数。--provider--api-key--non-interactive
recording +latest 🟢展示最新一条录音详情。

image — 图片管理 🟢

图片由 daemon 后台从 OSS 下载到 images/files/;查询命令纯读 images/index.json

命令说明
image list列出图片。--status syncing|synced|sync_failed--app--from/--to <iso8601>--limit
image status <id>单张图片详情。
image path <id>打印本地文件绝对路径(供 Agent 喂多模态模型)。--thumbnail 返回缩略图。未下载完成返回 YOOOCLAW_IMAGE_NOT_READY
image storage-path打印图片存储目录绝对路径。
image +latest展示最新一张图片详情。

light — 灯效硬件控制 🟡

命令说明
light send发送灯效指令。--segments <json>(灯效参数)或 --preset <name>(预设名);--repeat--repeat-times <n>
light +blink灯效连通性测试。

独立 daemon 暂无连接的灯效设备会话时,命令返回 accepted: true, delivered: false(需手机端在线 / relay)。

lightrule — 灯效规则管理 🟡

通知 ingest 后 daemon 评估命中并触发灯效。

命令说明
lightrule list列出所有规则及状态。
lightrule show <id>单条规则详情。
lightrule create创建规则。--from-file <path>- 读 stdin)或 --name/--intent/--light-action/--match-rules
lightrule update <id>更新现有规则,未指定字段保留原值。
lightrule delete <id>删除规则(--yes 跳过确认)。
lightrule enable <id> / disable <id>启用 / 停用单条规则。
lightrule +on / +off启用 / 停用所有规则。
bash
cat rule.json | yoooclaw lightrule create --from-file -
yoooclaw lightrule list --format json

monitor — 定时通知监控任务 🟡

cron 表达式驱动的定时任务定义(当前持久化定义与启用状态)。

命令说明
monitor list列出所有监控任务。
monitor show <name>任务详情。
monitor create <name>创建任务。--description--match-rules <json>--schedule <cron> 均必填。
monitor delete <name>删除任务(--yes)。
monitor enable <name> / disable <name>启用 / 暂停任务。

tunnel — Relay 隧道 🟡

命令说明
tunnel status查询连接状态(当前为 standalone-http 模式)。
tunnel reconnect强制重连。
tunnel +test端到端联通性自检:daemon 通过本地回环给自己发一条 echo 通知,验证 ingest + 鉴权链路。

log — 日志检索 🟢

命令说明
log [keyword]搜索 daemon 日志。--from/--to <YYYY-MM-DD>--limit(默认 50)、--level
log +errors昨天起的 error 级日志。

gateway — 协议自检 🟡

命令说明
gateway test模拟手机端调 daemon /notifications,验证连通 / 鉴权。--from-phone-ip <ip>--via-relay

api — Raw HTTP escape hatch 🟡

bash
yoooclaw api GET /daemon/status
yoooclaw api POST /images --data @img.json
yoooclaw api POST /light/send --data '{"preset":"blink"}'

--data 支持 @filename(读文件)、-(读 stdin)或内联 JSON;--header <key:value> 可重复。

维护命令

命令说明
migrate from-openclaw 🟢~/.openclaw/plugins/phone-notifications/ 的通知 / 录音 / 规则 / 图片与 api-key 迁移到 ~/.yoooclaw/,迁移前自动备份。--dry-run--source <path>
update self 🟢查 npm registry 比对版本并提示(不自动更新)。--beta--json
doctor 🟢/🟡环境自检:Node 版本、目录权限、keychain、daemon、配置。--json--fix。网络类自检(relay / OSS)交给 gateway test / tunnel +test
bash
yoooclaw migrate from-openclaw --dry-run
yoooclaw doctor --format json