codex-auth is a local-only command-line tool for switching Codex accounts.
- It never calls OpenAI APIs; all operations happen locally on your machine.
- It reads and updates local Codex files under
~/.codex(includingsessions/and auth files).
- Linux/macOS/WSL2:
curl -fsSL https://raw.githubusercontent.com/loongphy/codex-auth/main/scripts/install.sh | bashThe installer writes the install dir to your shell profile by default.
Supported profiles: ~/.bashrc/~/.bash_profile/~/.profile, ~/.zshrc/~/.zprofile, ~/.config/fish/config.fish.
Use --no-add-to-path to skip profile updates.
- Windows (PowerShell):
irm https://raw.githubusercontent.com/loongphy/codex-auth/main/scripts/install.ps1 | iexThe installer adds the install dir to current/user PATH by default.
Use -NoAddToPath to skip user PATH persistence.
codex-auth list # list all accounts
codex-auth add [--no-login] # add current account (runs `codex login` by default)
codex-auth switch [<email>] # switch active account (interactive or partial/fragment match)
codex-auth import <path> [--name <name>] # smart import: file -> single import, folder -> batch import
codex-auth remove # remove accounts (interactive multi-select)List accounts (default table with borders):
codex-auth listAdd the currently logged-in Codex account:
codex-auth addImport an auth.json backup:
codex-auth import /path/to/auth.json --name personalBatch import from a folder:
codex-auth import /path/to/auth-exportsSwitch accounts (interactive list shows email, 5h, weekly, last activity):
codex-auth switch # arrow + number inputSwitch account non-interactively (for scripts/other CLIs):
codex-auth switch userIf multiple accounts match, interactive selection is shown.
Remove accounts (interactive multi-select):
codex-auth remove
