Skip to content
Back to skills

Codex Account Switcher

ASecurity

Manage multiple OpenAI Codex accounts. Capture current login tokens and switch between them instantly. ⚠️ Reads and writes ~/.codex/auth.json and ~/.codex/accounts/*.json (sensitive authentication tokens).

  • 14 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 7, 2026
ai-agentspythongobashgit

Works with

  • terminal

Security analysis

A100/100

Pro scans all 3 files and shows the line behind each finding

Scanned September 7, 2026

npx -y skills add modbender/skill-library-mcp --skill codex-account-switcher --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Codex Account Switcher?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Codex Account Switcher
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/modbender-codex-account-switcher/badge)](https://www.skillsdirectory.com/skills/modbender-codex-account-switcher)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: codex-account-switcher
version: 1.2.4
homepage: https://github.com/odrobnik/codex-account-switcher-skill
description: >
  Manage multiple OpenAI Codex accounts. Capture current login tokens and switch
  between them instantly. ⚠️ Reads and writes ~/.codex/auth.json and
  ~/.codex/accounts/*.json (sensitive authentication tokens).
metadata:
  openclaw:
    emoji: "🎭"
    requires:
      bins: ["python3"]
---

# Codex Account Switcher

Manage multiple OpenAI Codex identities (e.g. personal vs. work) by swapping the authentication token file.

## Usage

### 1. List Accounts
Show saved accounts (active one is marked with `ACTIVE` on the right). Default output is compact.

- `--verbose` includes refresh age + token TTL (debug)
- `--json` outputs the verbose info as JSON
```bash
./codex-accounts.py list
```

To include emails/diagnostics:
```bash
./codex-accounts.py list --verbose
```

### 2. Add an Account
Interactive wizard to capture login(s).

- **Always starts a fresh browser login** (`codex logout && codex login`) so you explicitly choose the identity to capture.
- After each login it saves a snapshot.
- In an interactive terminal it asks if you want to add another.
- When invoked non-interactively (e.g. via Moltbot), it runs **single-shot** (no "add another" prompt).
- When naming an account, **press Enter** to accept the default name (local-part of the detected email, e.g. `oliver` from `oliver@…`).

```bash
./codex-accounts.py add
```

### 3. Switch Account
Instantly swap the active login.
```bash
./codex-accounts.py use work
```

### 4. Auto-Switch to Best Quota
Check all accounts and switch to the one with most weekly quota available.
```bash
./codex-accounts.py auto
./codex-accounts.py auto --json
```

Output:
```
🔄 Checking quota for 2 account(s)...

  → sylvia... weekly 27% used
  → oliver... weekly 100% used

✅ Switched to: sylvia
   Weekly quota: 27% used (73% available)

All accounts:
   sylvia: 27% weekly ←
   oliver: 100% weekly
```

## Setup

See [SETUP.md](SETUP.md) for prerequisites and setup instructions.

Files in this skill

  • SETUP.md1.8 KB
  • SKILL.md2.1 KB
  • codex-accounts.py31.8 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…