Codex Switcher
by @ppaibb
Local OpenClaw skill for managing multiple OpenAI Codex accounts through auth snapshots. Use when the user wants to add a Codex account, switch between Codex...
clawhub install codex-switcherπ About This Skill
name: codex-switcher description: Local OpenClaw skill for managing multiple OpenAI Codex accounts through auth snapshots. Use when the user wants to add a Codex account, switch between Codex accounts, inspect which Codex account is active, view remaining Codex quota, refresh expiring Codex tokens, or maintain a local multi-account Codex workflow without relying on third-party installers or bloating openclaw.json.
Codex Switcher
Use this skill to manage multiple local Codex accounts on one OpenClaw host with a simple snapshot workflow.
Bundled executable:
scripts/cs.shWhat this skill is
This is a small local account manager for Codex on OpenClaw.
Core idea:
openai-codex:default~/.openclaw/auth-snapshots/~/.openclaw/agents/main/agent/auth-profiles.jsonThis avoids filling openclaw.json with a growing roster of Codex aliases.
Commands
cs list
Show all saved snapshots with:
cs current
Show the real active account email, not just the internal profile id.cs quota
Read the current active token and query remaining Codex usage quota.cs switch
Switch to a saved account snapshot by updating only the active Codex credentials in:
~/.openclaw/agents/main/agent/auth-profiles.jsonAfter switching, show:
cs add [alias]
Start a new OAuth login flow for a brand-new account.Workflow:
1. run cs add or cs add
2. sign in in browser
3. run cs add --apply '
4. if alias was omitted, derive it from the email automatically
5. create a new snapshot file for that account
cs refresh
Force-refresh one snapshot using its refresh token.cs refresh-all
Scan every snapshot and automatically refresh only those expiring within 24 hours.This is intended for cron usage.
Sensitive files
This skill touches high-sensitivity local auth material. Main files involved:
~/.openclaw/agents/main/agent/auth-profiles.json~/.openclaw/auth-snapshots/*.json~/.openclaw/auth-snapshots/backups/*~/.openclaw/Treat all snapshot files as secrets. Never expose full access tokens or refresh tokens in chat.
Safety rules
curl | bash installers.Recommended workflow
Add a new account
cs add or cs add cs add --apply '' [alias] cs listSwitch accounts
cs switch Keep snapshots fresh
Runcs refresh-all from cron once or twice per day.References
references/security-notes.md.scripts/README-local-flow.md.