{
  "title": "Auth monitoring",
  "content": "OpenClaw exposes OAuth expiry health via `openclaw models status`. Use that for\nautomation and alerting; scripts are optional extras for phone workflows.\n\n## Preferred: CLI check (portable)\n\n* `0`: OK\n* `1`: expired or missing credentials\n* `2`: expiring soon (within 24h)\n\nThis works in cron/systemd and requires no extra scripts.\n\n## Optional scripts (ops / phone workflows)\n\nThese live under `scripts/` and are **optional**. They assume SSH access to the\ngateway host and are tuned for systemd + Termux.\n\n* `scripts/claude-auth-status.sh` now uses `openclaw models status --json` as the\n  source of truth (falling back to direct file reads if the CLI is unavailable),\n  so keep `openclaw` on `PATH` for timers.\n* `scripts/auth-monitor.sh`: cron/systemd timer target; sends alerts (ntfy or phone).\n* `scripts/systemd/openclaw-auth-monitor.{service,timer}`: systemd user timer.\n* `scripts/claude-auth-status.sh`: Claude Code + OpenClaw auth checker (full/json/simple).\n* `scripts/mobile-reauth.sh`: guided re‑auth flow over SSH.\n* `scripts/termux-quick-auth.sh`: one‑tap widget status + open auth URL.\n* `scripts/termux-auth-widget.sh`: full guided widget flow.\n* `scripts/termux-sync-widget.sh`: sync Claude Code creds → OpenClaw.\n\nIf you don’t need phone automation or systemd timers, skip these scripts.",
  "code_samples": [],
  "headings": [
    {
      "level": "h2",
      "text": "Preferred: CLI check (portable)",
      "id": "preferred:-cli-check-(portable)"
    },
    {
      "level": "h2",
      "text": "Optional scripts (ops / phone workflows)",
      "id": "optional-scripts-(ops-/-phone-workflows)"
    }
  ],
  "url": "llms-txt#auth-monitoring",
  "links": []
}