Failed to login
What happened?
Select Auth Method │ │ ● Login with Google │ │ ○ Gemini API Key │ │ ○ Vertex AI │ │ │ │ Failed to login. │ │ Message: request to https://oauth2.googleapis.com/token failed, reason: │ │ │ │ (Use Enter to select) │ │ │ │ Terms of Services and Privacy Notice for Gemini CLI │ │ │ │ https://github.com/google-gemini/gemini-cli/blob/main/docs/tos-privacy.md
What did you expect to happen?
Failed to login.
Client information
$ gemini /about
# paste output here
Login information
No response
Anything else we need to know?
No response
你除了需要设置项目id还需要设置项目的api-key set GEMINI_API_KEY=xxxx set GOOGLE_CLOUD_PROJECT=xxx
你除了需要设置项目id还需要设置项目的api-key set GEMINI_API_KEY=xxxx set GOOGLE_CLOUD_PROJECT=xxx
只是google账号登录,无需输入APIkey和projectID吧?
解决方式是,打开你的代理,找到默认的监听端口,然后根据默认的端口,比如我这里是
本地socks监听端口 10808 http端口=+1; Pac端口=+4; *ray API端口= +5; mihomo API端口= +6;
那么就在cmd里面输入
set HTTP_PROXY=http://127.0.0.1:10809 set HTTPS_PROXY=http://127.0.0.1:10809
设置走https代理
接在再输入gimini
启动就行
还有就是记得在梯子的路由里面设置对443端口的代理
解决方式是,打开你的代理,找到默认的监听端口,然后根据默认的端口,比如我这里是
本地socks监听端口 10808 http端口=+1; Pac端口=+4; *ray API端口= +5; mihomo API端口= +6;那么就在cmd里面输入set HTTP_PROXY=http://127.0.0.1:10809 set HTTPS_PROXY=http://127.0.0.1:10809设置走https代理 接在再输入gimini启动就行
Mac环境下,Socks Port为7890。我直接键入export HTTP_PROXY="http://127.0.0.1:7890"和export HTTPS_PROXY="http://127.0.0.1:7890",解决了主楼同样的登录问题。以上仅供参考。
有一件需要注意的事情是,这个console输入的这个是一次性的,下次打开需要再输入一遍
"
set HTTP_PROXY=http://127.0.0.1:10080 set HTTPS_PROXY=http://127.0.0.1:10080
如果是使用clash的话可以直接这里
如果是使用clash的话可以直接这里
感谢,Mihomo 直接开启虚拟网卡就可以了
I had that problem using
npx https://github.com/google-gemini/gemini-cli
it worked when i used:
npm install -g @google/gemini-cli
gemini
its weird, that it worked the npm way. i'm using nixos and shouldn't have any network issues here in europe. maybe its a different issue, but im not really sure how to debug it
解决方式是,打开你的代理,找到默认的监听端口,然后根据默认的端口,比如我这里是
本地socks监听端口 10808 http端口=+1; Pac端口=+4; *ray API端口= +5; mihomo API端口= +6;那么就在cmd里面输入set HTTP_PROXY=http://127.0.0.1:10809 set HTTPS_PROXY=http://127.0.0.1:10809设置走https代理 接在再输入gimini启动就行Mac环境下,Socks Port为7890。我直接键入
export HTTP_PROXY="http://127.0.0.1:7890"和export HTTPS_PROXY="http://127.0.0.1:7890",解决了主楼同样的登录问题。以上仅供参考。
解决方式是,打开你的代理,找到默认的监听端口,然后根据默认的端口,比如我这里是
本地socks监听端口 10808 http端口=+1; Pac端口=+4; *ray API端口= +5; mihomo API端口= +6;那么就在cmd里面输入set HTTP_PROXY=http://127.0.0.1:10809 set HTTPS_PROXY=http://127.0.0.1:10809设置走https代理 接在再输入gimini启动就行Mac环境下,Socks Port为7890。我直接键入
export HTTP_PROXY="http://127.0.0.1:7890"和export HTTPS_PROXY="http://127.0.0.1:7890",解决了主楼同样的登录问题。以上仅供参考。
解决了。另外附一点自己遇到的Case,使用本地proxy一定要设置 http://127.0.0.1:7890 而非 http://localhost:7890。后者还是会导致请求失败:
API Error: exception TypeError: fetch failed sending request
解决方式是,打开你的代理,找到默认的监听端口,然后根据默认的端口,比如我这里是
本地socks监听端口 10808 http端口=+1; Pac端口=+4; *ray API端口= +5; mihomo API端口= +6;那么就在cmd里面输入set HTTP_PROXY=http://127.0.0.1:10809 set HTTPS_PROXY=http://127.0.0.1:10809设置走https代理 接在再输入gimini启动就行
powershell的设置:$env:HTTP_PROXY = "http://127.0.0.1:10809" $env:HTTPS_PROXY = "http://127.0.0.1:10809"
I guess i might be in the wrong issue, but atleast what helped me was NODE_TLS_REJECT_UNAUTHORIZED=0 gemini ignoring the ssl cert i use to adblock using adguard.
Thank you @Clausinho, this helped me.
如果是使用clash的话可以直接这里
谢谢,Mihomo直接开启虚拟网卡就可以了
感谢! clash直接开启虚拟网卡也解决了。
开启虚拟网卡模型完美解决
有一件需要注意的事情是,这个console输入的这个是一次性的,下次打开需要再输入一遍
A convenient way is to set http_proxy and https_proxy in the system environment variables on windows to http://127.0.0.1:7890 to avoid repeated input before each login.
Hi,
Thank you all for your feedback, we have made significant improvements in this space and you should no longer run into this issue.
Please dont hesitate to reach out if you still see this issue and I'd be happy to re-open this issue for you.
My country Bangladesh phone US this problem 2FA setting up
On Sun, 31 Aug 2025, 12:40 am Srinath Padmanabhan, @.***> wrote:
srithreepo left a comment (google-gemini/gemini-cli#1802) https://github.com/google-gemini/gemini-cli/issues/1802#issuecomment-3239450285
Hi,
Thank you all for your feedback, we have made significant improvements in this space and you should no longer run into this issue.
Please dont hesitate to reach out if you still see this issue and I'd be happy to re-open this issue for you.
— Reply to this email directly, view it on GitHub https://github.com/google-gemini/gemini-cli/issues/1802#issuecomment-3239450285, or unsubscribe https://github.com/notifications/unsubscribe-auth/BUYLOELT7Y4YVA6JDZGWAKD3QHV2LAVCNFSM6AAAAACAFIY7WSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTEMZZGQ2TAMRYGU . You are receiving this because you are subscribed to this thread.Message ID: @.***>
-- The good thing is to do with the process of getting the update.
-- Think it will get better and process issue.