Skip to content

Codex Account

A simple utility to switch Codex accounts

Install: git clone https://github.com/denysdovhan/codex-account

Works with Codex · 65 GitHub stars

Install

$git clone https://github.com/denysdovhan/codex-account

Install command taken from the project's README or registry entry. Always review code before running it.

codex-account

[!NOTE] A small CLI for switching Codex auth accounts by swapping ~/.codex/auth.json.

Codex currently does not provide a UI for switching between saved profiles. If you use separate work and personal accounts, moving between them usually means re-authenticating or manually replacing auth.json.

This utility keeps named snapshots of authenticated accounts so you can move between them without logging in again each time.

Installation

# Clone the repository into Codex's config area
git clone https://github.com/denysdovhan/codex-account ~/.codex/.codex-account

# Expose the script as a runnable command from your local bin directory
ln -sfn ~/.codex/.codex-account/codex-account.sh ~/.local/bin/codex-account

[!IMPORTANT] Make sure ~/.local/bin is on your PATH. Otherwise, the codex-account command will not be available after creating the symlink.

Quick Start

# Log into one Codex account first, then save it
codex-account save personal

# Logout and login into another Codex account, then save that one too
codex-account save work

# See saved accounts and the current match
codex-account list

# Switch back to a saved account
codex-account switch personal

# Show the active account
codex-account current

Commands

codex-account help

Show the built-in help text.

codex-account list

List saved accounts. * marks the account whose saved snapshot matches the live auth.json. ~ marks the recorded current account when the live auth differs from every saved snapshot.

codex-account current

Print the active account name when it can be matched. If the live auth does not match a saved snapshot, it reports the recorded account when available.

codex-account save

Save the current ~/.codex/auth.json as .auth.json and mark that account as current.

codex-account switch

Back up the current auth as -backup.auth.json when the current auth can be associated with a saved account, then restore the requested saved account into ~/.codex/auth.json.

[!IMPORTANT] Restart Codex after switching if it is already running.

codex-account

Shorthand for codex-account switch .

Notes

  • This tool only swaps auth.json. It does not change the rest of ~/.codex.
  • Saved accounts live in ~/.codex/.codex-account/accounts.
  • Named backups are stored alongside saved accounts as *-backup.auth.json.
  • To add a new account, log into it with Codex first, then run codex-account save .
  • Restart Codex after switching if it is already running.

Contributing

Install the local Git hooks after cloning:

# Install the Git hooks managed by pre-commit
pre-commit install

License

MIT © Denys Dovhan

Similar plugs

Orca is the ADE for working with a fleet of parallel agents. Run any coding agent with your own subscription. Available on desktop, mobile and remote runtime.

PluginDev tools+6,803 this week

CLI proxy that reduces LLM token consumption by 60-90% on common dev commands. Single Rust binary, zero dependencies

Documented system prompts from Anthropic - Claude Fable 5.1, Opus 5.5, Claude Design, Claude Code. OpenAI - ChatGPT GPT-6-Astra, Codex. Google - Gemini 3.8 Flash, 3.1 Pro…

Wrap Antigravity, ChatGPT Codex, Claude Code, Grok Build, Muse Code, Devin as an OpenAI/Gemini/Claude/Codex compatible API service, allowing you to enjoy the free Gemini…

Explore related