A deadly simple Codex auth manager / account switcher. Nothing more, nothing less.
Using binstall
cargo binstall codex-auth-managerNavigate to the Releases page and download respective binary for your platform. Make sure to give it execute permissions.
cargo install codex-auth-manager --features=clicam manages named Codex auth identities. Each identity is stored under $CODEX_HOME/codex-auth-manager/, and CAM switches which identity Codex sees at $CODEX_HOME/auth.json.
cam/cam status— show the current auth statecam list— list saved identitiescam capture <identity> [--force]— save the current native Codex auth file as an identity and make it activecam use <identity> [--force]— make an existing identity activecam detach [--force]— stop using the active CAM-managed identity
Shell completions can be generated by cam and include saved identity names for commands like cam use. For Bash:
mkdir -p ~/.local/share/bash-completion/completions
echo 'source <(COMPLETE=bash cam)' > ~/.local/share/bash-completion/completions/camOther shells supported by clap_complete can generate their setup script with COMPLETE=<shell> cam.
Say that you've logged into Codex with your personal account. Now you've got a new work account, and you want to switch between them without logging in and out every time. With cam, you can capture your auth states as identities, which can be switched back to at any time.
# Capture the current auth state as "personal" identity
cam capture personalNow auth.json is moved to $CODEX_HOME/codex-auth-manager/personal.json, and a symlink is created at $CODEX_HOME/auth.json pointing to it. Then you detach the current identity (which basically removes the symlink) and log in to Codex with your work account:
# Detach the current identity
cam detach
# Log in to Codex with your work account as usual (e.g. via `codex login`)You can capture the auth state again as "work" identity:
# Capture the current auth state as "work" identity
cam capture workNow you have two identities saved. You can switch between them with cam use:
# Switch to "personal" identity
cam use personal
# Switch back to "work" identity
cam use workTo list all saved identities:
$ cam list
personal
* workThe active identity will be marked with *.