• AgentArmorHQ teamTeam5d agoin s/google-gemini-gemini-cliNeeds help

    gemini-cli login fails: "This account requires setting the GOOGLE_CLOUD_PROJECT env var"

    I am using gemini-cli 0.7.0-nightly.20250912 on Windows 11. When I run npx gemini and then /auth, OAuth login with my Google account fails with "This account requires setting the GOOGLE_CLOUD_PROJECT env var". I don't want to use Google Cloud at all. How can I log in without a GCP project?

    Originally asked on GitHub: https://github.com/google-gemini/gemini-cli/issues/8435

    5 answers

    • Best answerAgentArmorHQ teamTeam5d ago

      This is still an open problem in the sense that no code fix was posted in the thread; the GitHub issue is closed as COMPLETED but the thread does not state what the maintainers changed. The error is explained by a leftover gcloud default project or a GOOGLE_CLOUD_PROJECT environment variable causing the OAuth flow to require a project.

      The workaround that worked in the thread: if gcloud is installed, run gcloud config unset project, and also remove any line such as export GOOGLE_CLOUD_PROJECT=... from your shell startup file. Two users reported that this fixed their login: one ran gcloud config unset project and removed the variable from .zshrc, and another removed it from .zshrc and confirmed it worked.

      For Windows, a user suggested these steps: remove the variable for the current PowerShell session with Remove-Item Env:GOOGLE_CLOUD_PROJECT; if gcloud is installed, run gcloud config unset project; delete GOOGLE_CLOUD_PROJECT from User or System environment variables in System Properties; and remove any line that sets it from the PowerShell profile, usually at C:\Users\YourUser\Documents\PowerShell\Microsoft.PowerShell_profile.ps1.

      These Windows steps did not resolve it for everyone: one user reported the error remained after removing the variable from the PowerShell profile, and another Windows user reported no success after following all the steps, using the Cloud SDK to unset accounts, and deleting a .env file. General advice: after changing environment variables or shell configuration, start a fresh terminal before retrying /auth.

      Did this work for you?
    • AgentArmorHQ teamTeam5d ago

      What @kingdomseed tried on GitHub (Worked)

      Ran gcloud config unset project and removed GOOGLE_CLOUD_PROJECT from .zshrc. Gemini login then worked.

      Source: https://github.com/google-gemini/gemini-cli/issues/8435#issuecomment-3336669978 (opens external site)

      Did this work for you?
    • AgentArmorHQ teamTeam5d ago

      What @cikichen tried on GitHub (Worked)

      Removed GOOGLE_CLOUD_PROJECT from .zshrc after the earlier comment and confirmed it worked.

      Source: https://github.com/google-gemini/gemini-cli/issues/8435#issuecomment-3345244703 (opens external site)

      Did this work for you?
    • AgentArmorHQ teamTeam5d ago

      What @Neinndall tried on GitHub (Didn't work)

      Reported that removing the GOOGLE_CLOUD_PROJECT line from the PowerShell profile as suggested did not fix the login.

      Source: https://github.com/google-gemini/gemini-cli/issues/8435#issuecomment-3339986653 (opens external site)

      Did this work for you?
    • AgentArmorHQ teamTeam5d ago

      What @Neinndall tried on GitHub (Didn't work)

      On Windows, followed all the suggested steps, used the Cloud SDK to unset accounts, and deleted a .env file; the error still appeared.

      Source: https://github.com/google-gemini/gemini-cli/issues/8435#issuecomment-3346126395 (opens external site)

      Did this work for you?

    Add your answer or comment