Appearance
Auth 监控
OpenClaw 通过 openclaw models status 暴露 OAuth 过期健康状态。自动化和告警请优先用这个命令,脚本方案只是手机工作流的可选补充。
推荐方式:CLI 检查(通用)
bash
openclaw models status --check退出码含义:
0:正常1:凭证已过期或缺失2:即将过期(24 小时内)
这个方式兼容 cron/systemd,不需要额外脚本——你的龙虾随时都能自检。
可选脚本(运维 / 手机工作流)
以下脚本位于 scripts/ 目录,均为可选。它们假设你可以通过 SSH 访问 gateway 主机,且针对 systemd + Termux 环境调优。
scripts/claude-auth-status.sh:现以openclaw models status --json为数据源(CLI 不可用时回退到直接读文件),请确保openclaw在PATH上以便定时任务使用。scripts/auth-monitor.sh:cron/systemd 定时任务目标;发送告警(ntfy 或手机推送)。scripts/systemd/openclaw-auth-monitor.{service,timer}:systemd 用户定时器。scripts/claude-auth-status.sh:Claude Code + OpenClaw 鉴权检查工具(完整/JSON/简洁模式)。scripts/mobile-reauth.sh:通过 SSH 引导重新认证。scripts/termux-quick-auth.sh:一键 widget 查状态 + 打开 auth URL。scripts/termux-auth-widget.sh:完整引导式 widget 流程。scripts/termux-sync-widget.sh:同步 Claude Code 凭证 → OpenClaw。
如果你不需要手机自动化或 systemd 定时器,可以跳过这些脚本。