Gemini CLI error
Gemini CLI: This account requires setting the GOOGLE_CLOUD_PROJECT or...
This account requires setting the GOOGLE_CLOUD_PROJECT or GOOGLE_CLOUD_PROJECT_ID env var. See https://geminicli.com/docs/get-started/authentication/#set-gcpStatus: By designLast verified 2 documented fixes6 sources
What it means
Sign in with Google succeeded, but the account type (Workspace, school, company, or a Code Assist license) needs a Google Cloud project for Gemini CLI to use. Older releases showed it as "Failed to login. Message: This account requires setting the GOOGLE_CLOUD_PROJECT env var".
Causes
- Per the authentication docs, a Google Cloud project is required when you use a company, school, or Google Workspace account, a Gemini Code Assist license from the Google Developer Program, or a license from a Gemini Code Assist subscription.
- Maintainer (gsquared94, #8435): earlier releases could hide the real onboarding error behind this message; #17852 makes the CLI show the actual onboarding error message.
How to fix it
- Fix 1.
Follow the docs: find your Google Cloud project ID, enable the Gemini for Cloud API, configure the necessary IAM permissions, then set GOOGLE_CLOUD_PROJECT or GOOGLE_CLOUD_PROJECT_ID (GOOGLE_CLOUD_PROJECT is checked first). Windows PowerShell: $env:GOOGLE_CLOUD_PROJECT="YOUR_PROJECT_ID"
Terminalexport GOOGLE_CLOUD_PROJECT="YOUR_PROJECT_ID" - Fix 2.
Upgrade to v0.28.0 or later, which includes #17852 "fix(core): prioritize detailed error messages for code assist setup", so the real onboarding error is shown. The GOOGLE_CLOUD_PROJECT_ID fallback arrived in v0.10.0 (#2725).
Terminalnpm install -g @google/gemini-cli@latest
More Gemini CLI errors
All 19 Gemini CLI errorsYou must be a named user on your organization's Gemini Code Assist Standard edition subscription to use this service. Please contact your administrator to request an entitlement to Gemini Code Assist Standard edition.Status: WorkaroundFailed to sign in. Message: Your current account is not eligible... because it is not currently available in your location.Status: By designFailed to sign in. Message: Request contains an invalid argumentStatus: WorkaroundUNABLE_TO_GET_ISSUER_CERT_LOCALLY or unable to get local issuer certificateStatus: WorkaroundInvalid Google Cloud Project ID: "<projectId>". The GOOGLE_CLOUD_PROJECT (or GOOGLE_CLOUD_PROJECT_ID) environment variable must be set to your string-based Project ID (e.g., "my-project-123"), not your numeric Project Number. Please update your environment variables.Status: By designFailed to login. Message: Precondition check failed.Status: Fixed in releaseYou are currently configured to use a Google Cloud Project but lack a Gemini Code Assist license. Please contact your administrator to request a license.Status: WorkaroundFailed to sign in. Message: You do not have a valid license of this product. Please contact your administrator to request a license. If you are not an enterprise user and believe you are receiving this message as an error, please try using the latest version and logging in again.Status: Open
Related reading
- Gemini CLI to Antigravity CLI Migration Guide: The June 18 DeadlineGemini CLI to Antigravity CLI migration guide: install, migrate config, update scripts and CI, and avoid the silent MCP failure that breaks tool calls.
- Gemini CLI Guide: 1M Token Context and Who Can Still Use ItGemini CLI puts a 1 million token context in your terminal but now only serves paid Gemini API, Vertex AI and Code Assist users. Setup and TypeScript workflow.
- Do Your Agent Hooks Fail Open? Claude Code vs Codex vs Cursor vs Gemini CLIA guard hook that crashes, times out or points at a missing script lets the tool call through by default in Claude Code. v2.1.295 adds onFailure: block. Here is what each coding agent does when your policy hook breaks, with real test runs.
- How to Keep API Keys Away From Your AI Coding Agent: Claude Code vs Codex vs Cursor vs Gemini CLIA deny rule on .env stops cat but not a Python one-liner. Here are the three layers that actually keep secrets out of a coding agent's context - file rules, environment scrubbing and credential masking - and what Claude Code, Codex, Cursor and Gemini CLI give you for each, with real test runs.
- Headless AI Coding Agents in CI: Claude Code, Codex CLI, Gemini CLI, and opencode ComparedHeadless AI coding agents in CI compared: Claude Code, Codex CLI, Gemini CLI, and opencode on invocation flags, sandboxing, auth, and output formats.
FAQ
What does "This account requires setting the GOOGLE_CLOUD_PROJECT or..." mean in Gemini CLI?
Sign in with Google succeeded, but the account type (Workspace, school, company, or a Code Assist license) needs a Google Cloud project for Gemini CLI to use. Older releases showed it as "Failed to login. Message: This account requires setting the GOOGLE_CLOUD_PROJECT env var".
How do I fix "This account requires setting the GOOGLE_CLOUD_PROJECT or..."?
There are 2 documented fixes. Start with the first: Follow the docs: find your Google Cloud project ID, enable the Gemini for Cloud API, configure the necessary IAM permissions, then set GOOGLE_CLOUD_PROJECT or GOOGLE_CLOUD_PROJECT_ID (GOOGLE_CLOUD_PROJECT is checked first). Windows PowerShell: $env:GOOGLE_CLOUD_PROJECT="YOUR_PROJECT_ID"
Is this Gemini CLI error fixed?
Status: By design. Expected behavior, not a bug. The documented fixes change the setup that triggers it. Affected versions: Reported on 0.7.0-nightly.20250912.68035591 (#8435); detailed onboarding errors from v0.28.0 (#17852); GOOGLE_CLOUD_PROJECT_ID fallback from v0.10.0 (#2725)
Sources
Last verified against 6 sources: official docs, maintainer replies and release notes.
- github.comhttps://github.com/google-gemini/gemini-cli/blob/main/packages/core/src/code_assist/setup.ts
- github.comhttps://github.com/google-gemini/gemini-cli/blob/main/docs/get-started/authentication.mdx
- github.comhttps://github.com/google-gemini/gemini-cli/issues/8435
- github.comhttps://github.com/google-gemini/gemini-cli/pull/17852
- github.comhttps://github.com/google-gemini/gemini-cli/pull/2725
- github.comhttps://github.com/google-gemini/gemini-cli/releases/tag/v0.28.0
Newsletter
Fixes for the tools you use, weekly
One email per week. New coding agent releases, what broke, and how developers are working around it.