Codex CLI · Tested with aisw v0.3.7 · Updated July 16, 2026

How to Switch Codex CLI Accounts

Save each Codex CLI account as an aisw profile, then run aisw use codex <profile> to switch. aisw writes the profile's credentials to the same auth.json or keyring entry Codex CLI already uses, so there's no manual file copying involved.

Codex CLI keeps one active account in auth.json or a system keyring, with no built-in concept of saved, named accounts. Switching normally means manually backing up and restoring that file. aisw wraps that process in a single command.

Before you start

Install aisw if you haven’t already:

Terminal window
brew tap burakdede/tap && brew install aisw

CLI method

1. Capture the account you’re currently signed into.

Terminal window
aisw init
aisw add codex work --from-live

2. Add a second account.

Interactively, using Codex CLI’s own OAuth flow:

Terminal window
aisw add codex personal

Or from an API key already in your environment:

Terminal window
aisw add codex ci --from-env

3. Switch between them.

Terminal window
aisw use codex work
aisw use codex personal

4. Confirm which account is active.

Terminal window
aisw status

Desktop method (coming soon)

AI Switcher Desktop is currently in private testing and not yet available for public download. The steps below reflect the current build; use the CLI method above until it ships.

  1. Open AI Switcher Desktop and go to Overview.
  2. In the Codex CLI column, select the profile you want active and click Activate.
  3. Or press ⌘K for Quick Switch and type the profile name.

Common problems

If aisw add codex <name> --from-live fails to read the current credentials, Codex CLI may be using a keyring backend aisw doesn’t have permission to read yet — re-run the command after granting keyring access when your OS prompts for it. For anything else, aisw doctor diagnoses common environment issues.

Frequently asked questions

Where does Codex CLI store credentials that aisw manages?

Depending on your install, Codex CLI stores credentials in auth.json or in a system keyring. aisw detects which one your install uses and writes profiles to that same location.

Can aisw import a Codex CLI account I'm already signed into?

Yes, where the credential file is readable. Use aisw add codex <name> --from-live to capture the account that's currently active.