codex-multi-auth workflow and understand version-specific upgrade considerations.
Canonical Targets
The current stable release line targets:- Package:
codex-multi-auth(unscoped) - Command family:
codex auth ... - Runtime root:
~/.codex/multi-auth
Migration from Legacy Installs
If you are upgrading from the scoped package (@ndycode/codex-multi-auth) or older pre-0.1.0 versions, follow this checklist:
Verify routing and status
Confirm that the correct binaries are active:Expected output:
codex --versionshows the official Codex CLI versioncodex auth statusshows the multi-auth plugin status
Configuration Upgrade Notes
During upgrades, runtime config source precedence is:- Unified settings
pluginConfigfromsettings.json(when valid) - Fallback file config from
CODEX_MULTI_AUTH_CONFIG_PATH(or legacy compatibility path) when unified settings are absent/invalid - Runtime defaults (hardcoded in
lib/config.ts)
Migrating Legacy Config Files
If you have a legacy config file at:~/.codex/codex-multi-auth-config.json~/.codex/openai-codex-auth-config.json
Review and save
Review the auto-loaded settings and press S to save to unified settings (
~/.codex/multi-auth/settings.json).Worktree Storage Migration
If you usedperProjectAccounts: true before worktree identity sharing was added (v0.1.1), older worktree-keyed account files are migrated automatically:
- Legacy worktree storage is merged into the canonical repo-shared project file
- Legacy files are removed only after a successful canonical write
- If canonical persistence fails, legacy files are retained to avoid data loss
How It Works
Worktree detection
The plugin detects
.git file in the worktree directory and reads the gitdir pointer.Identity resolution
resolveProjectStorageIdentityRoot resolves the main repository’s commondir to determine the shared identity root.Account merge
Legacy worktree-keyed accounts are merged into the canonical repo-shared account file (
~/.codex/multi-auth/projects/<repo-key>/openai-codex-accounts.json).codex auth list once in the worktree.
Version-Specific Upgrade Notes
Upgrading to v0.1.1
Released: 2026-03-01Breaking Changes
- OAuth callback host: Now canonicalized to
127.0.0.1:1455(waslocalhost:1455in some contexts). If you have firewall rules or proxy configs, update them.
Key Improvements
- Email deduplication: Now case-insensitive via
normalizeEmailKey()(trim + lowercase).[email protected]and[email protected]are now treated as the same account. - Worktree account sharing: Linked Git worktrees now share accounts via
resolveProjectStorageIdentityRoot. - Settings hub extraction: CLI settings logic moved from
lib/codex-manager.tstolib/codex-manager/settings-hub.ts(~2100 lines). No user-facing changes. - Settings panel hotkeys: Q now cancels without saving (was save+back). Theme live-preview restores baseline on cancel.
Migration Actions
No manual migration required. Automatic migrations:- Worktree-keyed accounts auto-migrate on first
codex auth listin worktree - Email deduplication applied on next account save
Upgrading to v0.1.0
Released: 2026-02-27Breaking Changes
-
Storage format: Upgraded to V3 with automatic migration from V1/V2. Backup existing account files before upgrading:
-
Config precedence: Unified settings (
~/.codex/multi-auth/settings.json) now take precedence over legacy config files.
Migration Actions
- Rebuild account pool: After upgrading, run
codex auth doctor --fixto refresh all accounts. - Verify settings: Run
codex auth settingsto review and save unified settings.
Common Upgrade Problems
'codex auth' not found after upgrade
'codex auth' not found after upgrade
Likely cause: Wrapper path conflict or cached npm binary.Solution:
Old scoped package still active
Old scoped package still active
Likely cause: npm didn’t fully remove the scoped package.Solution:Verify:
Account pool appears stale after upgrade
Account pool appears stale after upgrade
Mixed path confusion (global vs project accounts)
Mixed path confusion (global vs project accounts)
Likely cause: Accounts stored in multiple locations due to
perProjectAccounts toggle.Solution: See Storage Paths Reference for canonical path resolution. Run codex auth list to trigger migration and consolidation.Settings changes not taking effect
Settings changes not taking effect
Likely cause: Environment variable override taking precedence.Solution: Check for environment overrides:Remove conflicting overrides or edit
~/.codex/multi-auth/settings.json directly.Post-Upgrade Validation
After upgrading, validate your installation:Downgrading (Not Recommended)
Downgrading is not supported due to storage format changes. If you must revert:-
Backup accounts:
-
Uninstall current version:
-
Install target version:
- Restore accounts (manual JSON edit may be required).
Related Resources
- Configuration Guide — Settings migration
- Storage Paths Reference — File locations
- Troubleshooting — Common upgrade issues
- CHANGELOG — Version history
- CONFIG_FLOW.md — Config resolution logic