← 返回
开发者工具 中文

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...
本地 OpenClaw 技能,用于通过认证快照管理多个 OpenAI Codex 账户,包括添加和切换账户。
ppaibb
开发者工具 clawhub v1.0.0 1 版本 99813.8 Key: 无需
★ 0
Stars
📥 536
下载
💾 16
安装
1
版本
#auth#codex#latest#openclaw#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

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:

  1. run cs add or cs add
  2. sign in in browser
  3. run cs add --apply '' [alias]
  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/*
  • 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 | bash installers.
  • 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 add or cs add
  • finish browser login
  • cs add --apply '' [alias]
  • cs list

Switch accounts

  • cs switch
  • 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.

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-30 03:25 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

developer-tools

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 669 📥 324,253
developer-tools

CodeConductor.ai

larsonreever
AI驱动平台,提供快速全栈开发、智能体、工作流自动化及低代码AI集成的可扩展产品创建。
★ 68 📥 180,260
developer-tools

Gog

steipete
Google Workspace 命令行工具,支持 Gmail、日历、云端硬盘、通讯录、表格和文档。
★ 921 📥 185,809