身份验证监控
监控模型提供者的 OAuth 过期
OpenClaw 通过 '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'openclaw models status'</code>' 公开 OAuth 到期健康状况。用它来
自动化和警报;脚本是电话工作流程的可选附加功能。
首选:CLI 检查(便携式)
openclaw models status --check
退出代码:
- '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'0'</code>':好的
- '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'1'</code>':凭证过期或丢失
- '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'2'</code>':即将到期(24 小时内)
这在 cron/systemd 中工作并且不需要额外的脚本。
可选脚本(操作/电话工作流程)
这些位于 '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'scripts/'</code>' 下并且是'<strong>'可选的'</strong>'。他们假设通过 SSH 访问
网关主机并针对 systemd + Termux 进行了调整。
- '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'scripts/claude-auth-status.sh'</code>' 现在使用 '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'openclaw models status --json'</code>' 作为
事实来源(如果 CLI 不可用,则回退到直接文件读取),
因此,将 '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'openclaw'</code>' 保留在 PATH 上作为计时器。
- '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'scripts/auth-monitor.sh'</code>':cron/systemd 计时器目标;发送警报(ntfy 或电话)。
- <code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">scripts/systemd/openclaw-auth-monitor.{service,timer}'</code>:systemd 用户计时器。
- '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'scripts/claude-auth-status.sh'</code>':Claude 代码 + OpenClaw 身份验证检查器(完整/json/简单)。
- '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'scripts/mobile-reauth.sh'</code>':通过 SSH 引导重新验证流程。
- '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'scripts/termux-quick-auth.sh'</code>':一键小部件状态 + 打开身份验证 URL。
- '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'scripts/termux-auth-widget.sh'</code>':完整引导的小部件流程。
- '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'scripts/termux-sync-widget.sh'</code>':同步克劳德代码信用 → OpenClaw。
如果您不需要电话自动化或 systemd 计时器,请跳过这些脚本。