openclaw/docs/automation/auth-monitoring.md

45 lines
1.6 KiB
Markdown
Raw Permalink Normal View History

2026-01-09 00:32:48 +00:00
---
summary: "Monitor OAuth expiry for model providers"
read_when:
- Setting up auth expiry monitoring or alerts
- Automating Claude Code / Codex OAuth refresh checks
title: "Auth Monitoring"
2026-01-09 00:32:48 +00:00
---
2026-01-31 21:13:13 +09:00
2026-01-09 00:32:48 +00:00
# Auth monitoring
2026-01-30 03:15:10 +01:00
OpenClaw exposes OAuth expiry health via `openclaw models status`. Use that for
2026-01-09 00:32:48 +00:00
automation and alerting; scripts are optional extras for phone workflows.
## Preferred: CLI check (portable)
```bash
2026-01-30 03:15:10 +01:00
openclaw models status --check
2026-01-09 00:32:48 +00:00
```
Exit codes:
2026-01-31 21:13:13 +09:00
2026-01-09 00:32:48 +00:00
- `0`: OK
- `1`: expired or missing credentials
- `2`: expiring soon (within 24h)
This works in cron/systemd and requires no extra scripts.
## Optional scripts (ops / phone workflows)
These live under `scripts/` and are **optional**. They assume SSH access to the
gateway host and are tuned for systemd + Termux.
2026-01-30 03:15:10 +01:00
- `scripts/claude-auth-status.sh` now uses `openclaw models status --json` as the
2026-01-09 00:32:48 +00:00
source of truth (falling back to direct file reads if the CLI is unavailable),
2026-01-30 03:15:10 +01:00
so keep `openclaw` on `PATH` for timers.
2026-01-09 00:32:48 +00:00
- `scripts/auth-monitor.sh`: cron/systemd timer target; sends alerts (ntfy or phone).
2026-01-30 03:15:10 +01:00
- `scripts/systemd/openclaw-auth-monitor.{service,timer}`: systemd user timer.
- `scripts/claude-auth-status.sh`: Claude Code + OpenClaw auth checker (full/json/simple).
2026-01-09 00:32:48 +00:00
- `scripts/mobile-reauth.sh`: guided reauth flow over SSH.
- `scripts/termux-quick-auth.sh`: onetap widget status + open auth URL.
- `scripts/termux-auth-widget.sh`: full guided widget flow.
2026-01-30 03:15:10 +01:00
- `scripts/termux-sync-widget.sh`: sync Claude Code creds → OpenClaw.
2026-01-09 00:32:48 +00:00
If you dont need phone automation or systemd timers, skip these scripts.