/install codex-switcher
Codex Switcher
Use this skill to manage multiple local Codex accounts on one OpenClaw host with a simple snapshot workflow.
Bundled executable:
scripts/cs.sh
What this skill is
This is a small local account manager for Codex on OpenClaw.
Core idea:
- keep OpenClaw's active Codex slot as
openai-codex:default - store each account as a separate snapshot under
~/.openclaw/auth-snapshots/ - switch accounts by injecting snapshot credentials into
~/.openclaw/agents/main/agent/auth-profiles.json - inspect account identity and quota from the active token itself
- refresh snapshot tokens before expiry
This avoids filling openclaw.json with a growing roster of Codex aliases.
Commands
cs list
Show all saved snapshots with:
- alias
- decoded email
- remaining time before expiry
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 \x3Calias>
Switch to a saved account snapshot by updating only the active Codex credentials in:
~/.openclaw/agents/main/agent/auth-profiles.json
After switching, show:
- current active email
- current quota summary
cs add [alias]
Start a new OAuth login flow for a brand-new account.
Workflow:
- run
cs addorcs add \x3Calias> - sign in in browser
- run
cs add --apply '\x3Ccallback-url>' [alias] - if alias was omitted, derive it from the email automatically
- create a new snapshot file for that account
cs refresh \x3Calias>
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/*- temporary pending OAuth state files under
~/.openclaw/
Treat all snapshot files as secrets. Never expose full access tokens or refresh tokens in chat.
Safety rules
- Do not run
curl | bashinstallers. - Do not fetch and execute third-party account-switch scripts blindly.
- Prefer local reviewed logic only.
- Back up auth material before risky operations.
- Validate alias names before writing files.
- Use atomic writes for snapshot and auth updates.
- Do not edit unrelated OpenClaw config unless truly required.
- Do not assume a snapshot alias is truthful; decode token email when verifying.
Recommended workflow
Add a new account
cs addorcs add \x3Calias>- finish browser login
cs add --apply '\x3Ccallback-url>' [alias]cs list
Switch accounts
cs switch \x3Calias>- verify output shows the expected email and quota
Keep snapshots fresh
Run cs refresh-all from cron once or twice per day.
References
- For security concerns around third-party relogin installers, read
references/security-notes.md. - For local implementation notes, read
scripts/README-local-flow.md.
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install codex-switcher - 安装完成后,直接呼叫该 Skill 的名称或使用
/codex-switcher触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
Codex Switcher 是什么?
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... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 242 次。
如何安装 Codex Switcher?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install codex-switcher」即可一键安装,无需额外配置。
Codex Switcher 是免费的吗?
是的,Codex Switcher 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
Codex Switcher 支持哪些平台?
Codex Switcher 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Codex Switcher?
由 ppaibb(@ppaibb)开发并维护,当前版本 v1.0.0。