命令参考
以下示例以 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通知监控
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灯效
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 构建的日志不脱敏,便于排错