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:
brew tap burakdede/tap && brew install aiswCLI method
1. Capture the account you’re currently signed into.
aisw initIf 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:
aisw add gemini work --from-liveRe-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.
aisw add gemini personalOr with an API key:
aisw add gemini personal --api-key "$GEMINI_API_KEY"3. Switch between them.
aisw use gemini workaisw use gemini personal4. Confirm the active profile.
aisw statusDesktop 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.
Screenshot placeholder
AI Switcher Desktop Overview screen with the Gemini CLI column showing an isolated-state badge next to the active profile
- Open AI Switcher Desktop and go to Overview.
- In the Gemini CLI column, select the profile you want and click Activate.
- 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.