Setup & Installation
Or with the ClawHub CLI, for registry-managed skill folders outside a full OpenClaw workspace:
Version History
### Safety & Reliability - Interactive confirmation before clearing `~/.codex/auth.json` — script now prompts `Continue? [y/N]` so you can abort - Trap handler automatically restores Codex CLI auth if the script is interrupted mid-run (EXIT/INT/TERM) - Backup verification — script checks that backup files were actually created before proceeding - Security & Safety section added to SKILL.md documenting exactly which files are accessed, how, and why ### Dependencies - Dropped `python3` and `jq` — the inline script now uses `node` (already present via the codex npm package), eliminating two external dependencies. Only `codex` is required. ### Metadata - SKILL.md frontmatter now declares `requires`, `files_read`, and `files_write` per OpenClaw review requirements ### Documentation - Cron job marked as optional — Step 4 heading and description now make clear that auto-switch is entirely optional, with a "before enabling" checklist - UUID/epoch helpers in config templates updated to use `node -e` instead of `python3 -c`
What This Skill Does
Configures multiple OpenAI Codex OAuth profiles in OpenClaw and sets up automatic failover between them when a provider hits a rate limit. Includes a script for device-flow login that imports tokens into OpenClaw's auth-profiles store without exposing them externally. An optional cron job can auto-switch the active model when a provider enters cooldown.
Eliminates manual account switching by letting OpenClaw fail over to a backup Codex profile automatically when one account is rate-limited.
When to use it
- Adding a second OpenAI Codex account to avoid rate limit interruptions
- Rotating between Codex profiles during heavy coding sessions
- Setting failover priority order across multiple OpenAI accounts
- Automating model switching when a Codex session hits cooldown
- Importing fresh OAuth tokens into OpenClaw without manual JSON editing
Example Workflow
Here's how your AI assistant might use this skill in practice.
User asks: add my second OpenAI account as a fallback Codex profile named 'work'
- 1Runs codex-add-profile.sh work to start the import process
- 2Creates timestamped backups of ~/.codex/auth.json and auth-profiles.json
- 3Clears Codex CLI auth and triggers device-flow login via browser
- 4Extracts access token, refresh token, and expiry from the new session
- 5Writes the new 'work' profile into auth-profiles.json and restores original Codex auth
OpenClaw auth-profiles.json updated with a second Codex OAuth profile named 'work', ready for failover
Requirements
Accounts, API keys, or tools you or your AI assistant may need to set up while using this skill.