Gemini CLI: change Google account or sign in for work
Since 18 June 2026, personal Google sign-ins, free or Google AI Pro and Ultra, no longer serve Gemini CLI; Code Assist Standard or Enterprise licences and paid API keys do. To change to an account that works, run /auth signout in Gemini CLI, then sign in again and pick that account in the browser.
Contents
Since 18 June 2026, personal Google sign-ins, free or Google AI Pro and Ultra, no longer serve Gemini CLI. Code Assist Standard or Enterprise licences and paid API keys still do. To change Google account in Gemini CLI, run /auth signout, then sign in again and pick the other account in the browser. A work account also needs GOOGLE_CLOUD_PROJECT set.
We read Google's docs and Gemini CLI's source for every step below on 24 October 2026, when the latest stable release was v0.65.0. Some of it, including the sign-out command, is in the source but not in the docs.
Why your personal Google account stopped working#
Google announced on 19 May 2026 that "On June 18, 2026, Gemini CLI and Gemini Code Assist IDE extensions will stop serving requests for Google AI Pro and Ultra", and for the free Gemini Code Assist for individuals. Organisations on Code Assist Standard or Enterprise keep their access "unchanged", and Gemini CLI "will remain accessible via paid Gemini and Gemini Enterprise Agent Platform API keys".
So if your personal account fails, signing out and back in with the same account won't fix it, and neither will a second personal account. You need a licence through your organisation or a paid API key. Google's answer for everyone else is Antigravity CLI; Gemini CLI vs Antigravity CLI compares the two, and the old daily limits per tier are in Gemini CLI free tier limits.
How to change Google account in Gemini CLI#
- Run
/aboutto see where you are. It shows the sign-in method and the email of the cached Google account (aboutCommand.ts). - If the new account is a work or school one, set
GOOGLE_CLOUD_PROJECTfirst (next section). - Type
/auth signout. Gemini CLI also accepts/auth logout. It deletes the cached credentials and forgets which sign-in method you chose (authCommand.ts). - Gemini CLI says "You are now signed out". Choose Sign in, then Sign in with Google. The browser asks you to sign in; choose the other account there.
- Run
/aboutagain to check the email. For a work account it also shows the GCP project.
Google's commands reference lists only /auth: "Open a dialog that lets you change the authentication method." That's the command for moving between a Google sign-in, an API key and Vertex AI. Until v0.65.0, released on 20 October 2026, picking Sign in with Google again in that dialog quietly reused the saved session, so the browser never offered another account. Pull request 29643 changed it to clear the cached sign-in first. On an older version, use /auth signout.
Sign in with a work or school account (GOOGLE_CLOUD_PROJECT)#
Gemini CLI's authentication page says you need a Google Cloud project if you use "a Company, School, or Google Workspace account", a Code Assist licence from the Google Developer Program, or one from a Code Assist subscription. Without it, sign-in stops with "This account requires setting the GOOGLE_CLOUD_PROJECT or GOOGLE_CLOUD_PROJECT_ID env var."
- Find the project ID. Your Google Cloud admin may need to give it to you.
- Enable the Gemini for Cloud API in that project, and make sure your account has the IAM access it needs.
- Set the variable before you start Gemini CLI:
export GOOGLE_CLOUD_PROJECT="my-project-123"on macOS or Linux,$env:GOOGLE_CLOUD_PROJECT="my-project-123"in PowerShell. - Start
gemini, run/auth signoutif another account is cached, and sign in with the work account.
Use the string ID, not the numeric project number: Gemini CLI rejects a number with an "Invalid Google Cloud Project ID" error. It reads GOOGLE_CLOUD_PROJECT first and falls back to GOOGLE_CLOUD_PROJECT_ID. To keep the setting, put the export line in your shell profile. Gemini CLI also reads GOOGLE_CLOUD_PROJECT from ~/.gemini/.env, but only when no .env file sits in your project folder or a folder above it, because it loads the first one it finds. A value already set in your shell beats any .env file.
Clear the cached Google sign-in by hand (oauth_creds.json)#
The docs only say your credentials "will be cached locally for future sessions". The source names the files (storage.ts):
| File | What it holds |
|---|---|
~/.gemini/oauth_creds.json |
The Google sign-in itself |
~/.gemini/google_accounts.json |
The cached account's email, which /about shows |
~/.gemini/settings.json |
The sign-in method you picked, among your other settings |
Close Gemini CLI, delete the first two files, and the next start asks you to sign in. Leave settings.json alone; /auth changes the method. One exception: if you run with GEMINI_FORCE_ENCRYPTED_FILE_STORAGE=true, the sign-in is kept in your system keychain under gemini-cli-oauth (oauth-credential-storage.ts), and deleting files does nothing. Use /auth signout there.
Keep two Google accounts with GEMINI_CLI_HOME#
Signing out every time you change accounts gets old. GEMINI_CLI_HOME is "the root directory for Gemini CLI's user-level configuration and storage", and the CLI makes a .gemini folder inside it (configuration reference). One folder per account means one sign-in per folder.
Everything else splits too: GEMINI.md, settings, commands, extensions, skills and your chats, which Gemini CLI keeps under .gemini/tmp/ (where gemini --resume looks for them). So link the shared parts in before the new home's first run:
-
Make the folder:
mkdir -p ~/gemini-work/.gemini. -
Link what you want in common from
~/.gemini:bashfor e in GEMINI.md commands extensions skills tmp; do [ -e ~/.gemini/$e ] && [ ! -e ~/gemini-work/.gemini/$e ] && ln -s ~/.gemini/$e ~/gemini-work/.gemini/$e done -
Add a shell function to
~/.zshrcor~/.bashrc:gemini-work() { GEMINI_CLI_HOME="$HOME/gemini-work" gemini "$@"; } -
For a work account, add
GOOGLE_CLOUD_PROJECT="my-project-123"beforegeminiin that function, so only that account gets it. We don't use a.envfile in the new home for this: for a project inside your home folder, Gemini CLI finds the project's.envor~/.gemini/.envfirst. -
Open a new terminal, run
gemini-workand sign in as the second account. Plaingeminikeeps the first.
Never link oauth_creds.json or google_accounts.json. We don't link settings.json either, because Gemini CLI writes the chosen sign-in method into it, so MCP servers you set there need adding in each home. And keep the default file storage: the keychain keeps one entry that every home shares, so a second sign-in there would replace the first. On Windows, set $env:GEMINI_CLI_HOME before running gemini. The same folder trick for Claude Code, Codex and the rest is in multiple accounts in every coding agent CLI.
Which accounts you're allowed to use#
Use only accounts and keys you own and are entitled to use. Gemini CLI's terms page lists different terms for each sign-in: Google Cloud's for a Code Assist Standard or Enterprise licence, the Gemini API terms for a key. It also says that reaching the services behind Gemini CLI through other software, by reusing Gemini CLI's sign-in, "is a violation of applicable terms and policies" and may get the account suspended.
How Shuriken keeps several Gemini sign-ins#
Shuriken runs Gemini CLI as one of its 67 coding agents, and does the folder setup above for you. Every Google sign-in you add in Sources gets its own GEMINI_CLI_HOME, and Shuriken runs Gemini CLI's own sign-in inside it. It links GEMINI.md, commands, extensions, skills and tmp from your ~/.gemini into each one, so your chats and instructions are the same whichever account a chat runs on, and settings.json stays per source. It also starts Gemini CLI with GEMINI_FORCE_ENCRYPTED_FILE_STORAGE=false, which keeps each sign-in in its own folder rather than in the one keychain entry. Shuriken doesn't set GOOGLE_CLOUD_PROJECT for a source.
With two or more Gemini sources, Shuriken switches between them. Hot swapping is our name for it: Shuriken moves your chats to another of your accounts or sources when one nears its limit. A Gemini chat moves at the end of its current turn, on every linked device. A chat on a sign-in moves onto an API key only if you turn on "Switch to API keys", which is off by default. Each fallback run then stops at a spend cap, $25 unless you change it. Source switching has the settings.
It can't bring personal Google sign-ins back: they fail in Shuriken as they do in your terminal. If you hold a Code Assist licence and a paid key, or two licences, download Shuriken and add each as a source.
Sources
- Google Developers Blog: Transitioning Gemini CLI to Antigravity CLI (accessed 24 October 2026)
- Gemini CLI docs: Authentication setup (accessed 24 October 2026)
- Gemini CLI docs: Commands reference (accessed 24 October 2026)
- Gemini CLI docs: Configuration (GEMINI_CLI_HOME) (accessed 24 October 2026)
- Gemini CLI docs: Enterprise (isolating state with GEMINI_CLI_HOME) (accessed 24 October 2026)
- Gemini CLI docs: Latest stable release, v0.65.0 (accessed 24 October 2026)
- google-gemini/gemini-cli on GitHub: authCommand.ts (/auth signout) (accessed 24 October 2026)
- google-gemini/gemini-cli on GitHub: aboutCommand.ts (/about) (accessed 24 October 2026)
- google-gemini/gemini-cli on GitHub: storage.ts (oauth_creds.json) (accessed 24 October 2026)
- google-gemini/gemini-cli on GitHub: oauth-credential-storage.ts (keychain storage) (accessed 24 October 2026)
- google-gemini/gemini-cli on GitHub: setup.ts (GOOGLE_CLOUD_PROJECT errors) (accessed 24 October 2026)
- google-gemini/gemini-cli pull request 29643: clear cached credentials when re-selecting Google login (accessed 24 October 2026)
- Gemini CLI docs: Terms of Service and Privacy Notice (accessed 24 October 2026)
Frequently asked questions
How do I log out of Gemini CLI?
Type /auth signout inside Gemini CLI; /auth logout does the same. It deletes the cached Google sign-in and the saved sign-in method, so Gemini CLI asks how to sign in again.
How do I see which Google account Gemini CLI is using?
Run /about. It shows the sign-in method and the email of the Google account Gemini CLI has cached.
Where does Gemini CLI store my Google sign-in?
In ~/.gemini/oauth_creds.json, with the account's email in ~/.gemini/google_accounts.json. If GEMINI_CLI_HOME is set, both sit in the .gemini folder under it. With GEMINI_FORCE_ENCRYPTED_FILE_STORAGE=true the sign-in goes to the system keychain instead.
Why did my personal Google account stop working in Gemini CLI?
Google stopped serving Gemini CLI for free Gemini Code Assist for individuals and for Google AI Pro and Ultra on 18 June 2026. Signing out and back in won't change that; Google points those users to Antigravity CLI.
Why does Gemini CLI ask for GOOGLE_CLOUD_PROJECT?
Company, school and Google Workspace accounts, and Code Assist licences, need a Google Cloud project. Set GOOGLE_CLOUD_PROJECT to the project's string ID, such as my-project-123, not its numeric project number.