Install codex-multi-auth, add an account, and confirm that codex auth ... is working.
- Node.js
18+ - The official
@openai/codexCLI - A ChatGPT plan with access to the models you want to use
npm i -g @openai/codex
npm i -g codex-multi-authIf you previously installed the old scoped prerelease package:
npm uninstall -g @ndycode/codex-multi-auth
npm i -g codex-multi-authVerify that the wrapper is active:
codex --version
codex auth statuscodex auth loginExpected flow:
- The dashboard opens in the terminal.
- Choose
Add New Account. - Complete the official OAuth flow in your browser.
- Return to the terminal when the browser step completes.
- Confirm the account appears in the saved account list.
On a brand-new install (no openai-codex-accounts.json yet), codex auth login opens a first-run setup screen before OAuth. Use it to restore from backups, import an OpenCode pool, run doctor/check paths, open settings and Codex CLI sync, or skip straight to login. All actions reuse the existing backup browser, import, doctor, and settings flows.
If you have named backups in ~/.codex/multi-auth/backups/ and no active accounts, the login flow can prompt you to restore before opening OAuth. Confirm to open Restore From Backup, review the recoverable backup list, and restore the entries you want. Skip the prompt to continue with a fresh login.
Verify the new account:
codex auth list
codex auth checkRepeat codex auth login for each account you want to manage.
When you are done, choose the best account for the next session:
codex auth forecast --liveUse the restore path when you already have named backup files and want to recover account state before creating new OAuth sessions.
- Automatic path: run
codex auth login, then confirm the startup restore prompt when it appears - Manual path: run
codex auth login, then chooseRestore From Backup - Backup location:
~/.codex/multi-auth/backups/<name>.json
The restore manager shows each backup name, account count, freshness, and whether the restore would exceed the account limit before it lets you apply anything.
If you already have an OpenCode pool on the same machine, choose Import OpenCode Accounts from the login dashboard recovery section to preview and import ~/.opencode/openai-codex-accounts.json before creating new OAuth sessions.
The settings flow is split into two productized sections:
Everyday Settingsfor list appearance, details line, results and refresh behavior, and colorsAdvanced & OperatorforCodex CLI Syncand backend tuning
Use Codex CLI Sync when you want to preview one-way sync from official Codex CLI account files before applying it. The sync screen shows source and target paths, preview summary, destination-only preservation, and backup rollback paths before apply.
codex auth status
codex auth list
codex auth switch 2
codex auth check
codex auth forecast --live
codex auth report --live --json
codex auth fix --dry-run
codex auth doctor --fixBy default, account data lives under ~/.codex/multi-auth.
If project-level account pools are enabled, codex-multi-auth stores them under:
~/.codex/multi-auth/projects/<project-key>/openai-codex-accounts.json
Linked Git worktrees share the same repo identity so you do not need separate account pools per worktree path.
If codex auth is not recognized:
where codexThen continue with troubleshooting.md.
If the OAuth callback on port 1455 fails:
- stop the process using port
1455 - rerun
codex auth login
If account state looks stale:
codex auth doctor --fix
codex auth checkIf you need a broader diagnostics snapshot:
codex auth report --live --json