Seamlessly switch between multiple Codex accounts
Overview • Install • Usage • More Docs • FAQ
Codex Profiles lets you save and switch between multiple Codex accounts without
repeated codex login. It manages file-backed account credentials; Codex's native
--profile option independently selects configuration settings.
| Method | Command |
|---|---|
| npm | npm install -g codex-profiles |
| Bun | bun install -g codex-profiles |
curl -fsSL https://raw.githubusercontent.com/midhunmonachan/codex-profiles/main/install.sh | bashAdvanced install option (build from source)
cargo install --locked codex-profilesRequires Rust 1.94+
codex-profiles save --label work
codex-profiles list
codex-profiles load --label work --force
codex-profiles status --all --compactNote
Codex Profiles data is stored under $CODEX_HOME/profiles/, or
~/.codex/profiles/ when CODEX_HOME is unset.
| Command | Description |
|---|---|
codex-profiles save[--label <name>] |
Save current auth.jsonOptional label |
codex-profiles load[--label <name> | --id <profile-id>][--force] [--with-status] |
Load a saved profile Add --with-status to show usage and reset times |
codex-profiles list[--show-id] [--json] |
List profiles Supports id and JSON views |
codex-profiles export--output <file>[--label <name> | --id <profile-id> (repeatable)] |
Export to a JSON bundle Default: all profiles, or a selected subset |
codex-profiles import--input <file> |
Import from a JSON bundle |
codex-profiles doctor[--fix] [--json] |
Check account storage and local Codex configuration, and optionally repair profile storage |
codex-profiles label set(--label <name> | --id <profile-id>)--to <label> |
Set or replace a label Target one profile |
codex-profiles label clear(--label <name> | --id <profile-id>) |
Clear a label Target one profile |
codex-profiles label rename--label <label> --to <label> |
Rename an existing label |
codex-profiles status[--label <name> | --id <profile-id>][--all] [--json | --compact] |
Show usage for active, selected, or all accounts--compact requires --all and groups short usage lines by account and bucket |
codex-profiles delete[--label <name> | --id <profile-id> (repeatable)][--yes] |
Delete by label or id Supports bulk delete and non-interactive mode |
loadanddeleteopen a profile picker unless you pass--labelor--id. Selecting a profile does not skip other prompts:loadmay ask about unsaved active credentials, anddeleterequires confirmation unless you pass--yes.- With
load --with-status, the profile still switches even if the status check fails status --all --compactshows remaining usage and reset times without progress bars. Use--jsonfor scripts; it cannot be combined with--compact.- Usage windows use the durations reported by Codex, including weekly-only and custom limits. Missing data is shown as unavailable.
- Finish active Codex work before switching and restart the affected client afterward. See client compatibility.
- Export bundles contain secrets
- Export refuses existing output paths, including dangling symlinks and files created during export. The output filesystem must support hard links; an unsupported filesystem returns an error without replacing the destination.
- Import also refuses a profile path created during the operation and requires hard-link support and readable file identities. On failure, rollback checks file identity and contents and reports any files it cannot safely verify or remove. Inspect the store before retrying an incomplete rollback. Keep other writers out of the store during import; rollback is not a filesystem transaction.
- Client compatibility and credential storage
- Release verification guide
- Contribution guide
- Project status and release research
- Optional config snapshots: design proposal (not implemented)
How do I uninstall?
- npm:
npm uninstall -g codex-profiles- Bun:
bun uninstall -g codex-profiles- Cargo:
cargo uninstall codex-profiles- Manual:
rm ~/.local/bin/codex-profiles
Is my auth file uploaded anywhere?
Saved profiles stay on your machine. For OAuth profiles,
statusmay send the access token to the configured allowed usage endpoint and may refresh it through OpenAI after an unauthorized response. API-key profiles show usage as unavailable. Update checks contact package/release services. Export bundles contain credentials and should be treated like passwords.
What is a “profile” in this tool?
An account profile is a saved copy of
$CODEX_HOME/auth.json(by default,~/.codex/auth.json). Nativecodex --profile NAMEselects a configuration layer and does not switch these saved accounts.
What happens if I run load without saving?
When the active credentials are unsaved, an interactive terminal prompts you to save them, continue without saving, or cancel. In scripts, save them first or explicitly use
--forceto continue without saving. A--labelor--idselector alone does not skip this check.
Can I keep personal and work accounts separate?
Yes. Save each account with a label (for example,
personalandwork) and switch with the label
How can I verify my installation?
codex-profiles --version codex-profiles list