sunmoon1983
V2EX  ›  问与答

你们的 gemini-cli 都能正常登录吗?

  •  
  •   sunmoon1983 · Jun 28, 2025 · 4069 views
    This topic created in 512 days ago, the information mentioned may be changed or developed.

    为什么我的到浏览器中的这一步就卡住了?

    image.png

    然后 gemini-cli 中报

    Failed to login. Message: request to https://oauth2.googleapis.com/token failed, reason: Socket │ │ connection timeout

    image.png

    梯子 v2 开了全局

    11 replies  •  2025-07-01 00:07:01 +08:00
    Scarb
    Scarb
    Jun 28, 2025
    1
    我一开始也这样,要设置 HTTP 、HTTPS 代理。export HTTP_PROXY= export HTTPS_PROXY
    然后在 ~/.gemini/.env 里面写 GOOGLE_CLOUD_PROJECT=XXX
    giserd
    giserd
    Jun 28, 2025
    2
    1.要设置 proxy
    Daybyedream
    Daybyedream
    Jun 28, 2025
    3
    cmd 里输一下 本机的代理就好了 set https_proxy=http://localhost:XXXX
    shonnliberty
    shonnliberty
    Jun 28, 2025
    4
    我用的 sing-box 开了 tun 不需要设置 https_proxy
    quietDown
    quietDown
    Jun 28, 2025
    5
    我用的 Gemini API Key 这种登录方式。
    1. 先在 https://aistudio.google.com/apikey 生成 api key 。
    2. 配置好 key 在你的 bash 或者 zsh 里面。
    3. 终端也需要设置下代理,楼上已经把命令给列出来了。

    然后就可以正常的使用了。
    sssxxxyyzz
    sssxxxyyzz
    Jun 28, 2025
    6
    梯子是使用的美国 IP 吗
    Chiqing
    Chiqing
    Jun 28, 2025
    7
    我设置了终端代理也不好使,不知道是不是混合端口的原因,开了 tun 就好了
    HENQIGUAI
    HENQIGUAI
    Jun 28, 2025
    8
    我也这样,然后开了 tun 模式就好了
    Reach
    Reach
    Jun 29, 2025
    9
    @quietDown 多数人应该是冲着免费 gemini 2.5 pro 去的,免费 API 额度比较有限
    Reach
    Reach
    Jun 29, 2025
    10
    @Chiqing 感谢分享,我刚刚也试了下 tun 模式,居然也好了。
    sumland
    sumland
    Jul 1, 2025
    11
    请问是通过 ping www.google.com 来验证代理配置是否正确吗
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2136 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 39ms · UTC 13:53 · PVG 21:53 · LAX 05:53 · JFK 08:53
    ♥ Do have faith in what you're doing.