-
-
Notifications
You must be signed in to change notification settings - Fork 69.5k
Gemini CLI detection fails on Windows (npm global path mismatch) #28625
Description
Summary
Latest (main)
Steps to reproduce
- Install @google/gemini-cli globally on Windows: npm install -g @google/gemini-cli
- Attempt to use the Gemini extension in OpenClaw.
- The extension fails to detect the CLI because it looks for oauth2.js in the wrong path relative to the binary.
Expected behavior
The Gemini CLI should be detected correctly on Windows by checking multiple candidate roots relative to the binary path.
Proposed Fix:
Update extractGeminiCliCredentials to check multiple candidate roots:
- dirname(binDir) (Linux/macOS)
- join(binDir, "node_modules", "@google", "gemini-cli") (Windows global npm)
Reference code:
const binDir = dirname(resolvedPath);
const candidateRoots = [
dirname(binDir),
join(binDir, "node_modules", "@google", "gemini-cli"),
join(binDir, "..", "node_modules", "@google", "gemini-cli"),
];Actual behavior
Detection fails on Windows because the package root is not two levels up from the binary (it's in node_modules relative to the bin dir).
OpenClaw version
Latest (main)
Operating system
Windows 11
Logs, screenshots, and evidence
Onboarding:
o Model/auth provider
| Google
|
o Google auth method
| Google Gemini CLI OAuth
|
o Google Gemini CLI caution ------------------------------------------------------------+
| |
| This is an unofficial integration and is not endorsed by Google. |
| Some users have reported account restrictions or suspensions after using third-party |
| Gemini CLI and Antigravity OAuth clients. |
| Proceed only if you understand and accept this risk. |
| |
+----------------------------------------------------------------------------------------+
|
o Continue with Google Gemini CLI OAuth?
| Yes
|
|
o Gemini CLI OAuth -----------------------------------------------+
| |
| Browser will open for Google authentication. |
| Sign in with your Google account for Gemini CLI access. |
| The callback will be captured automatically on localhost:8085. |
| |
+------------------------------------------------------------------+
o Gemini CLI OAuth failed
|
o OAuth help ------------------------------------------------------------+
| |
| Trouble with OAuth? Ensure your Google account has Gemini CLI access. |
| |
+-------------------------------------------------------------------------+
Error: Gemini CLI not found. Install it first: brew install gemini-cli (or npm install -g @google/gemini-cli), or set GEMINI_CLI_OAUTH_CLIENT_ID.