命令参考
以下示例以 OpenClaw 全局 CLI 为例。QClaw 下请把 openclaw 替换为 QClaw 提供的 wrapper。
认证
bash
openclaw ntf auth set-api-key "ock_xxx"
openclaw ntf auth show
openclaw ntf auth clearset-token 是 set-api-key 的兼容别名(历史命名),两者行为完全一致。api-key 写入宿主状态目录下的 credentials.json(0600 权限),支持多把 key(apiKeys[],其中一把标记为 default);YOOOCLAW_API_KEY 环境变量可覆盖文件中的值。
通知查询
bash
openclaw ntf search
openclaw ntf search --app wechat --from 2026-03-01T00:00:00+08:00 --to 2026-03-09T23:59:59+08:00
openclaw ntf search --keyword "开会" --limit 20
openclaw ntf search --sender "张三"
openclaw ntf summary --limit 700
openclaw ntf stats --dim app --from 2026-03-01通知同步
bash
openclaw ntf sync scan
openclaw ntf sync fetch --date 2026-03-09
openclaw ntf sync commit --date 2026-03-09
# 迭代器写法:自动挑下一个待处理批次,直接给出可执行的 commit 命令
openclaw ntf sync next
openclaw ntf sync next --all
openclaw ntf sync next --from-date 2026-03-01 --to-date 2026-03-09sync next 是给记忆同步流程用的便捷封装:自动定位下一个未处理的日期/批次,返回里带一条现成的 commitCommand,不用自己算 --date / --end-index。
通知监控
bash
openclaw ntf monitor create boss-alert \
--description "监控重点微信消息" \
--match-rules '{"appName":"wechat","senderKeywords":["张总"]}' \
--schedule "*/30 * * * *"
openclaw ntf monitor list
openclaw ntf monitor show boss-alert
openclaw ntf monitor enable boss-alert
openclaw ntf monitor disable boss-alert
openclaw ntf monitor delete boss-alert --yes录音
bash
openclaw ntf rec list
openclaw ntf rec status <recording-id>
openclaw ntf rec storage-path
openclaw ntf rec setup网页同步查询(浏览器扩展)
浏览器扩展抓取的网页正文经 webPages.save(Gateway Native)或 POST /web-pages 投递到插件,纯读本地已收藏索引,不访问互联网:
bash
openclaw ntf synced-web-page list
openclaw ntf synced-web-page list --from 2026-03-01T00:00:00+08:00 --to 2026-03-09T23:59:59+08:00
openclaw ntf synced-web-page search "关键词" --limit 20
openclaw ntf synced-web-page path <urlHash>
openclaw ntf synced-web-page storage-pathlist 的 --from 包含起点、--to 不包含终点,按 capturedAt 过滤,时间参数需带明确时区;path 支持至少 8 位的唯一哈希前缀。
灯效
bash
openclaw ntf light setup-tools
openclaw ntf light send \
--segments '[{"mode":"wave","duration_s":4,"brightness":192,"color":{"r":255,"g":0,"b":0}}]'light send 最多支持 MAX_LIGHT_SEGMENTS 段(超出会报 light_control supports 1-N segments),repeat_times 必须是 >=0 的整数。
环境切换
bash
openclaw ntf env show # 当前环境(development / test / production)及对应接口地址
openclaw ntf env switch test # 切换环境,会自动触发一次 gateway 重载切到不存在的环境名会报 无效的环境名称: <env>,可选值: development, test, production,不影响当前环境。
诊断与运维
bash
openclaw ntf doctor
openclaw ntf doctor --json
openclaw ntf doctor --fix # 自动修复可自动修复的项(如 stateDir 权限位、危险 flag)
openclaw ntf storage-path
openclaw ntf tunnel-status
openclaw ntf log --keyword error
openclaw ntf log --keyword relay --from 2026-03-01 --to 2026-03-09 --limit 100
openclaw ntf update
openclaw ntf update --beta # 切到 beta 频道;beta 构建的日志不脱敏,便于排错