hermes - 💡(How to fix) Fix Google Gemini CLI OAuth fails on remote servers — redirect to 127.0.0.1 unreachable [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
NousResearch/hermes-agent#28971Fetched 2026-05-20 04:00:52
View on GitHub
Comments
1
Participants
2
Timeline
8
Reactions
0
Author
Participants
Timeline (top)
labeled ×5commented ×1mentioned ×1subscribed ×1

Root Cause

Running hermes auth add google-gemini-cli on a remote VM (no SSH tunnel from local machine) fails because Google OAuth is hardcoded to redirect to http://127.0.0.1:8085/oauth2callback. The browser opens a URL pointing at the remote server's 127.0.0.1, which the user's local machine cannot reach.

Fix Action

Workaround

The --manual-paste flag solves it:

hermes auth add google-gemini-cli --manual-paste

Open the URL, sign in, ignore the "can't connect" page, copy the full http://127.0.0.1:8085/oauth2callback?code=...&state=... from the address bar, and paste it into the terminal prompt.

Code Example

hermes auth add google-gemini-cli --manual-paste
RAW_BUFFERClick to expand / collapse

Problem

Running hermes auth add google-gemini-cli on a remote VM (no SSH tunnel from local machine) fails because Google OAuth is hardcoded to redirect to http://127.0.0.1:8085/oauth2callback. The browser opens a URL pointing at the remote server's 127.0.0.1, which the user's local machine cannot reach.

Workaround

The --manual-paste flag solves it:

hermes auth add google-gemini-cli --manual-paste

Open the URL, sign in, ignore the "can't connect" page, copy the full http://127.0.0.1:8085/oauth2callback?code=...&state=... from the address bar, and paste it into the terminal prompt.

What Should Happen

On remote/headless environments, --manual-paste should be auto-detected (or at least suggested as the default). The xAI OAuth flow already has headless detection via _is_headless(). Google Gemini CLI should follow the same pattern — check env vars like SSH_CONNECTION, CODESPACES, HERMES_HEADLESS and automatically route to the paste fallback.

Environment

  • Running on: Remote cloud VM
  • Command: hermes auth add google-gemini-cli
  • Works with: hermes auth add google-gemini-cli --manual-paste

cc @teknium1

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

hermes - 💡(How to fix) Fix Google Gemini CLI OAuth fails on remote servers — redirect to 127.0.0.1 unreachable [1 comments, 2 participants]