Win11 下 Gemini Cli 登录错误, Ensure the Google account you are using is not a Workspace account 的解决方法

终端运行 gemini,使用google账户登录,结果提示

Failed to login. Ensure the Google account you are using is not a Workspace account and that you are not │ │ a licensed Code Assist user (see https://goo.gle/gemini-cli-auth-docs#workspace-gca). │ │ Message: Request contains an invalid argument.
网上搜索,找到了解决方案——
访问https://console.cloud.google.com/?pli=1 查看你的 Project ID,如果没有则需要新建项目。
终端cmd命令行提示符下输入(将YOUR_PROJECT_ID替换为你的谷歌 Pojrect ID)

set GOOGLE_CLOUD_PROJECT="YOUR_PROJECT_ID"

如果是 PowerShell 则可以

$env:GOOGLE_CLOUD_PROJECT="YOUR_PROJECT_ID"

参考阅读——
Gemini CLI使用开通了GCP账号登录报错is not a Workspace account的解决方法
Gemini CLI 无法登录的解决办法

posted @ 2025-07-12 17:49  geyee  阅读(423)  评论(0)    收藏  举报