Skip to content

[Bug] v0.18.0 Regression: CLI hangs on login in headless environments (no auth URL fallback) #13853

@KazenDev

Description

@KazenDev

What happened?

What happened?
I updated the CLI to version 0.18.0 on a headless Linux server (Ubuntu 24.04 via SSH). When running the gemini command to log in, the process hangs indefinitely attempting to open a browser, but it fails to provide the fallback authorization URL in the terminal.

In version 0.17.1, the CLI correctly detected the headless environment and printed a URL ("Please visit the following URL to authorize...") which allowed me to authenticate manually on another device. In 0.18.0, this output is missing, and the terminal just freezes until Ctrl+C is pressed.

Possible causes based on Changelog: This regression might be related to:

feat(core, cli): Bump genai version to 1.30.0 (#13435) - potentially changed auth behavior.

Protect stdout and stderr (#13247) - potentially swallowing the fallback URL output.

What did you expect to happen?

The CLI should detect that no browser is available (headless environment) and print the authorization URL to stdout, exactly like version 0.17.1 did.

Client information

CLI Version: 0.18.0
Git Commit: 1d51935
Model: auto
Sandbox: no sandbox
OS: linux
Auth Method: OAuth

Login information

Google Account (OAuth default flow). NOT using API Key.

Anything else we need to know?

Downgrading to the previous version fixed the issue immediately: npm install -g @google/gemini-cli@0.17.1

This confirms it is a regression introduced in the latest release.

Metadata

Metadata

Assignees

Labels

area/non-interactiveIssues related to GitHub Actions, SDK, 3P Integrations, Shell Scripting, Command line automationpriority/p0Critical and urgent (e.g., critical security vulnerability, major breakage).

Type

No fields configured for Bug.

Projects

Status

Closed

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions