cx-switcher
v1.0.0
Published
Switch between multiple OpenAI accounts for Codex CLI
Maintainers
Readme
cx-switcher
Switch between multiple OpenAI accounts for Codex CLI.
Designed for ChatGPT Plus/Pro users who use codex login (OAuth) and need to manage multiple accounts.
Install
npm i -g cx-switcherOr from source:
git clone https://github.com/vanhiep99w/codex-switcher.git
cd codex-switcher
npm linkUsage
Run interactive menu:
cx-switcherOr use sub-commands directly:
cx-switcher list # List all saved profiles
cx-switcher add # Save current session as a profile
cx-switcher login # Login new account & save as profile
cx-switcher switch # Pick a profile to switch to
cx-switcher next # Auto-rotate to the next profile
cx-switcher remove # Delete a profileQuick Start
# 1. Login your first account
codex login
cx-switcher add # Save as "work"
# 2. Login your second account
codex login # Login with a different account
cx-switcher add # Save as "personal"
# Or do both in one step:
cx-switcher login # Opens codex login → then saves
# 3. Switch between accounts
cx-switcher switch # Pick from list
cx-switcher next # Rotate to next accountHow it works
- Profiles are stored in
~/.codex/profiles/as copies ofauth.json - Switching = copying the selected profile back to
~/.codex/auth.json nextrotates through profiles in order (acc1 → acc2 → acc1 → ...)- Zero dependencies — uses only Node.js built-ins
Requirements
- Node.js ≥ 18
- Codex CLI installed
