fix(auth): platform-aware default Chrome profile path#1
Open
doziedotdev wants to merge 1 commit into
Open
Conversation
The hardcoded `~/Library/Application Support/Google/Chrome` default assumed macOS and caused `node src/auth-interactive.mjs` to fail with "Chrome profile not found" for every Linux and Windows user whose `GEMINI_WEB_CHROME_USER_DATA` was not set. Select the default based on `process.platform`: - darwin -> `~/Library/Application Support/Google/Chrome` - linux -> `~/.config/google-chrome` - win32 -> `%LOCALAPPDATA%/Google/Chrome/User Data` - other -> linux default (safe fallback) The `GEMINI_WEB_CHROME_USER_DATA` env var still overrides everything, so existing setups are unaffected.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The default Chrome profile path in
src/auth-interactive.mjsis hardcoded to the macOS location:On Linux and Windows this directory doesn't exist, so
node src/auth-interactive.mjsfails immediately withChrome profile not found at /home/<user>/Library/Application Support/Google/Chromeunless the user already knows to setGEMINI_WEB_CHROME_USER_DATA.This PR picks the default based on
process.platform:darwin~/Library/Application Support/Google/Chrome(unchanged)linux~/.config/google-chromewin32%LOCALAPPDATA%/Google/Chrome/User DataThe
GEMINI_WEB_CHROME_USER_DATAenv var still overrides everything, so existing setups are unaffected.Test plan
~/.config/google-chrome- auth flow completes, cookies saved to~/.gemini-cli-web/auth.json.node --check src/auth-interactive.mjspasses.Notes
No changes to the public CLI, env vars, or on-disk auth format. Purely a default-value improvement.