Gemini CLI · Tested with aisw v0.3.8 · Desktop v0.2.0 · Updated July 17, 2026

How to Switch Gemini CLI Accounts

Save each Gemini CLI account as an aisw profile, then switch with aisw use gemini <profile>. Gemini CLI keeps authentication and local state together under ~/.gemini, so aisw always switches the full isolated state for that profile, not just a credential file.

Gemini CLI keeps its credentials and local configuration together under ~/.gemini, so switching accounts by hand means backing up and swapping that whole directory. aisw does this as one profile switch.

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

If Gemini CLI is already signed in, init detects it and offers to import it as a named profile right in the prompt — accept it and skip the next command. Otherwise, or if you already ran init on this machine before, capture it explicitly:

Terminal window
aisw add gemini work --from-live

Re-running aisw init later is safe — it re-detects live accounts and reports current state without touching profiles you’ve already saved.

2. Add a second account.

Terminal window
aisw add gemini personal

Or with an API key:

Terminal window
aisw add gemini personal --api-key "$GEMINI_API_KEY"

3. Switch between them.

Terminal window
aisw use gemini work
aisw use gemini personal

4. Confirm the active profile.

Terminal window
aisw status

Desktop method

AI Switcher Desktop v0.2.0 is publicly available, and the current release assets cover macOS, Windows x64, and Linux x64. Download the matching build from /download/, then follow the same Gemini profile flow below.

  1. Open AI Switcher Desktop and go to Overview.
  2. In the Gemini CLI column, select the profile you want and click Activate.
  3. The state-mode badge always reads Isolated for Gemini — this is expected.

Common problems

If aisw add gemini <name> --from-live reports nothing to import, confirm Gemini CLI has actually completed a sign-in first — aisw can only capture credentials that already exist on disk.

If add fails with an error naming a different existing profile, that Gemini account is already saved under that name — aisw checks the underlying Google identity, not just the profile name, and won’t create a duplicate. Use the existing profile or remove it first if you want to re-add it under a new name.

If add fails with “profile already exists” instead, that’s a plain name collision — pick a different name, or re-run with --yes to overwrite the existing profile.

Frequently asked questions

Why does Gemini CLI behave differently from Claude Code and Codex CLI here?

Claude Code and Codex CLI let aisw switch just the credentials while keeping other local configuration shared, if you want. Gemini CLI stores everything together under ~/.gemini, so a profile switch always moves the complete isolated state — there's no shared-state option for Gemini.

Does that make Gemini CLI switching slower?

No — it's still one command and happens locally. The difference is architectural (what gets swapped), not a performance one.