Important
This project is community-maintained and is not affiliated with or endorsed by OpenAI. Authentication files contain sensitive credentials. Never share auth.json, account backups, or your full .codex directory.
Codex Account Switcher keeps your Codex workflow local, fast, and visible:
- Switch accounts without manual file handling.
- Detect account email and subscription data from local authentication bytes.
- Track 5-hour and 7-day quota windows with scheduled refresh.
- Analyze local Codex token history with daily heatmaps, today totals, and a 14-day trend.
- Keep account copies, settings, and backups inside your local Codex Home.
The screenshots below are taken from the latest build and redacted before publishing.
|
|
|
| Feature | Description |
|---|---|
| Account identity and health | Detects email, subscription plan, Access token expiry, account health, and supports manual subscription overrides |
| Safe account switching | Silently closes Codex, backs up auth.json, swaps credentials, reopens Codex, and records switch history |
| Usage query and cache | Queries official usage windows, shows cached data on startup, refreshes on startup / switch / schedule, and can restore the previous account after checks |
| Local token analytics | Scans local Codex records for total, daily, input, cached input, output, and reasoning tokens with heatmaps and 14-day trends |
| Smart quota scheduling | Learns local usage patterns, recommends or accepts a manual 5-hour quota trigger time, tracks confidence, and pauses when ineffective |
| Tray and desktop experience | Provides a custom title bar, remembered sidebar state, styled tray menu, quick switching, refresh actions, and app controls |
| Settings and local data control | Supports custom Codex Home, CODEX_HOME detection, backup retention, usage notifications, refresh policy, and theme selection |
- Windows 10 / 11
- Codex installed and signed in at least once
- For building from source:
- Node.js 18+
- Rust 1.77.2+
- Tauri 2 prerequisites
git clone https://github.com/wwrrj/Codex-Switcher.git
cd Codex-Switcher/react-vite
npm install
npx tauri devcd react-vite
npm install
npx tauri buildBuild artifacts are written to:
react-vite/src-tauri/target/release/bundle/
├── msi/
└── nsis/
- Start the app. It automatically detects
~/.codex/auth.jsonand the active account. - Add the current account to the pool. If the account is already saved, the app guides you through logging in to a new one.
- Select a target account and switch. The app closes Codex, backs up the credentials, replaces them, and reopens Codex.
- Open Usage Analytics to inspect the daily heatmap, today's tokens, and the latest 14-day trend.
- Adjust refresh intervals, backup retention, Codex Home, and theme in Settings.
Codex reads the active authentication file from Codex Home. This app keeps each saved account in a separate directory and replaces the active auth.json during a switch.
~/.codex/
├── auth.json # Active credentials read by Codex
├── accounts/
│ └── user@example.com/
│ ├── auth.json # Account copy managed by this app
│ └── meta.json # Name, note, subscription, and metadata
├── config/
│ ├── settings.json
│ └── priorities.json
└── backups/ # Automatic pre-switch backups
Switching flow:
flowchart LR
A["Select account"] --> B["Silently close Codex"]
B --> C["Back up active auth.json"]
C --> D["Replace it with target auth.json"]
D --> E["Reopen Codex"]
- Authentication files and backups remain on your machine and are not uploaded to a server operated by this project.
- Usage queries use local authentication data to call the official Codex usage endpoint.
- Token statistics come from local Codex session records.
- Saved
auth.jsoncopies are not additionally encrypted. Protect your operating-system account and Codex Home directory. - Remove
~/.codex/accountsand~/.codex/backupswhen uninstalling if you want a full cleanup.
- Desktop: Tauri 2 + Rust
- Frontend: React 18 + TypeScript + Vite
- Styling: Tailwind CSS
- State: Zustand
Codex-Switcher/
├── react-vite/
│ ├── src/ # React frontend
│ │ ├── components/
│ │ ├── lib/
│ │ └── store/
│ └── src-tauri/ # Rust / Tauri backend
│ ├── src/
│ └── tauri.conf.json
├── docs/
│ └── images/
└── README.md
# Frontend production build
cd react-vite
npm run build
# Rust build and tests
cd src-tauri
cargo build
cargo test
# Complete desktop installers
cd ..
npx tauri build- Publish downloadable releases and changelogs
- Add automated tests and CI
- Complete cross-platform process management and packaging verification
- Add data export and richer analytics
- Provide optional encryption for sensitive account copies
Issues and pull requests are welcome. Before submitting a change:
- Do not commit real
auth.json, token data, email addresses, or local Codex data. - Make sure the frontend build, Rust build, and tests pass.
- Follow Conventional Commits for commit messages.


