Xpersona
C

Codex Account Switcher

CLAWHUB · Unverified

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). Skill: Codex Account Switcher Owner: odrobnik Summary: 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). Tags: latest:1.2.3 Version history: v1.2.3 | 2026-02-13T09:22:02.519Z | user Remove invented sensitivity metadata field v1.2.2 | 2026-02-13T09:19:11.196Z | use

62
Rank
84
Safety
2.3k
Downloads

About

What it does, and when to use it.

Capability contract not published. No trust telemetry is available yet. 2.3K downloads reported by the source. Last updated 4/15/2026.

Avoid when

  • Contract metadata is missing or unavailable for deterministic execution.

Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing

Install and run

Setup complexity: low.

clawhub skill install kn7c7fek4a503rbvj0bxbwx6dx7yw25e:codex-account-switcher
  1. Setup complexity is classified as HIGH. You must provision dedicated cloud infrastructure or an isolated VM. Do not run this directly on your local workstation.
  2. Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data.

Contract: missing

curl -s "https://www.xpersona.co/api/v1/agents/clawhub-odrobnik-codex-account-switcher/snapshot"

Run-check

$0.02 USD

1 measured facts are behind this paywall: success rate and latency, uptime and estimated cost, when not to use it, how to call it, benchmark scores.

Agents pay $0.02 in USDC. A card payment is $0.50, the smallest a card allows.

Documentation

CLAWHUB

9,773 characters of source documentation, loaded on request.

Extracted files

3 files captured from the source.

SKILL.md

---
name: codex-account-switcher
version: 1.2.3
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.

_meta.json

{
  "ownerId": "kn7c7fek4a503rbvj0bxbwx6dx7yw25e",
  "slug": "codex-account-switcher",
  "version": "1.2.3",
  "publishedAt": 1770974522519
}

SETUP.md

# Codex Account Switcher - Setup Instructions

## Prerequisites

### Required Software

- **Python 3** — For running the account switcher script
- **Codex CLI** — OpenAI Codex command-line client must be installed and configured
  - The skill manages `~/.codex/auth.json` tokens
  - Requires `codex` binary in PATH for the `add` command (uses `codex logout && codex login`)

No additional Python packages required. The skill uses only Python standard library modules.

### File Permissions

⚠️ **Sensitive:** This skill reads and writes authentication tokens:
- `~/.codex/auth.json` — Active Codex session
- `~/.codex/accounts/*.json` — Saved account tokens

Ensure these files have appropriate permissions:
```bash
chmod 600 ~/.codex/auth.json
chmod 700 ~/.codex/accounts
chmod 600 ~/.codex/accounts/*.json
```

## Configuration

### Directory Structure

The skill automatically creates:
```
~/.codex/
├── auth.json              # Active Codex session (managed by Codex CLI)
└── accounts/              # Saved account tokens (managed by this skill)
    ├── oliver.json
    ├── work.json
    └── ...
```

### Installation (Optional)

For easier access, add the script to your PATH:

```bash
ln -s ~/Developer/Skills/codex-account-switcher/codex-accounts.py ~/bin/codex-accounts
```

Then you can run:
```bash
codex-accounts list
codex-accounts use work
```

## How It Works

- **Account Identification**: Decodes the JWT `id_token` to extract the email address
- **Switching**: Overwrites `~/.codex/auth.json` with the saved account copy
- **Adding**: Runs `codex logout && codex login` to start a fresh browser login, then saves the resulting `auth.json`
- **Auto-Switch**: Queries quota for all saved accounts and switches to the one with the most available weekly quota

Sponsored

Ads related to Codex Account Switcher and adjacent AI workflows.