Gemini CLI login: GOOGLE_CLOUD_PROJECT and "invalid argument"
Gemini CLI login wants GOOGLE_CLOUD_PROJECT or says "invalid argument"? Check your account type first: personal free and Google One moved to Antigravity.
Failed to login. Message: This account requires setting the GOOGLE_CLOUD_PROJECT env var.See https://goo.gle/gemini-cli-auth-docs#workspace-gcaThese two lines are quoted from the body of Kilo Code issue #2076. The error appears at login, and the same variable, GOOGLE_CLOUD_PROJECT, fixes it when you set it for one account type and when you unset it for another. So check the account type before touching the variable. Step 1 is where the paths split.
For install problems and other login errors, see Gemini CLI install and login errors. That article covers invalid argument in one line; this one focuses on this message and the project variable. For 429, see Gemini CLI 429.
[1] Decide your account type first. The banner at the top of the official authentication and troubleshooting pages says:
Unpaid tier and Google One users: Gemini CLI was replaced by Antigravity CLI on June 18th, 2026.(Checked on the authentication page and the troubleshooting page; both banners give the same date.) Overlaying that banner on the account table from the authentication page gives:
| Account | Banner | Project ID |
|---|---|---|
| Individual Google account on the free tier, Google One subscription | Replaced. The variable steps here are unlikely to fix it; see the box below | Not needed, per the docs |
| Company, school or Google Workspace account (including Google AI Ultra for Business) | Not named by the banner | Needed; go to step 2 |
| Gemini Code Assist license user | Not named by the banner | Needed; go to step 2 |
| Vertex AI user | Not named by the banner | Needed; go to step 2 |
Not being named by the banner does not mean the docs promise that account keeps working; the banner says only the sentence above. The docs do not spell out whether personal Google AI Pro and Ultra subscriptions count as "Google One", so that was not confirmed.
[2] On a company, school, Workspace, Code Assist or Vertex account, set the project ID. The docs give four steps: find your project ID, enable the Gemini for Cloud API, grant the IAM permissions, then set the environment variable. The CLI reads GOOGLE_CLOUD_PROJECT first and falls back to GOOGLE_CLOUD_PROJECT_ID.
$ export GOOGLE_CLOUD_PROJECT="YOUR_PROJECT_ID"In PowerShell use $env:GOOGLE_CLOUD_PROJECT="YOUR_PROJECT_ID". To keep it across terminals, add the same line to your shell profile (for example ~/.bashrc).
Skipping the API and permission steps still leaves you blocked after setting the variable. A Workspace user in #1872 set it and then got a 403 Permission denied on resource project ..., with reason CONSUMER_INVALID and service cloudaicompanion.googleapis.com in the details. That reads as the API or permission not being ready on the project, but the issue does not confirm the cause. Recheck the API and IAM parts of this step.
[3] Look at the exact wording. The docs write the login error as Failed to sign in. Message: ..., while the original above and the report in #1872 begin with Failed to login. Message: .... The prefix seems to differ by version, but which version changed it was not confirmed. This is the text from the docs' troubleshooting entry:
Failed to sign in. Message: Request contains an invalid argumentThe docs say this can happen when a Google Workspace account, or a Google Cloud account tied to a Gmail address, cannot activate the free Code Assist tier. Pick one fix:
- On a Google Cloud account, set
GOOGLE_CLOUD_PROJECTto your project ID (step 2). - Or get a Gemini API key from Google AI Studio. The docs say it has a separate free tier. As noted in the step 1 box, whether it still works after June 18 was not confirmed.
[4] The opposite error is You must be a named user on your organization's Gemini Code Assist Standard edition subscription to use this service. .... Per the docs, it means GOOGLE_CLOUD_PROJECT or GOOGLE_CLOUD_PROJECT_ID is defined, so the organization subscription check ran. The docs say to remove the variable on a personal account, or to ask your administrator to add a subscription on an organization account. Remove both variables from your shell profile (.bashrc, .zshrc) and from .env files; if that does not help, try a different Google account. Check whether a value is set now:
$ env | grep GOOGLE_CLOUD_PROJECT[5] The issues describe putting the variable in ~/.gemini/.env. This is a community report, not in the official docs, and the reports are mixed. Kilo Code issue #2076 dates from September and October 2025, before the June 18 replacement, so weigh it accordingly.
- Worked: the issue author, on a personal account, got the error above, and after writing
GOOGLE_CLOUD_PROJECT=YOUR_PROJECT_ID_HEREinto~/.gemini/.env(%USERPROFILE%\.gemini\on Windows) the Gemini CLI ran. Another user deleted an old project and pointed.envat a different one; the CLI worked, but Kilo required authorizing Gemini at a URL it printed. - Did not work: another user on Windows 11 created
.envwith the same line and still got the same error. - Extra condition: a third user was still blocked after setting the variable until they enabled the API in the Google console (adding that it might have been luck).
The issue is titled "Gemini CLI ignores .env with custom oauth_creds.json path" and was closed as "not planned" on 2026-02-24 for inactivity. The closure concerns Kilo Code ignoring the .env next to a custom credentials path, not a verdict on the .env method itself. Note that on a personal account the variable can trigger the organization subscription check in step 4.
[6] If [API Error: Request contains an invalid argument. (Status: INVALID_ARGUMENT)] appears during use rather than login, it may be unrelated to your account type. #2676 has reports from Vertex AI login and API key users, and one user posted a 400 about a tool declaration schema: only 'enum' and 'date-time' are supported for STRING type. A maintainer said 400 errors were being prioritized, and the issue was closed as a duplicate of another. No confirmed workaround was found in the thread. Changing the variable will not help here; update to the latest version and, if the cause is still unclear, run with gemini --debug.