Skip to content

Title: getRipgrepPath() never falls back to system PATH — ripgrep unavailable despite being installed #26777

Description

@JoshuaAdes

Environment:
gemini --version

→ 0.41.1 (git e1a5449)

rg --version

→ ripgrep 15.1.0 ✓

OS: Windows 11, win32

  • Install method: npm install -g @google/gemini-cli
  • ripgrep: installed via winget install BurntSushi.ripgrep.MSVC (in system PATH, rg --version works)

Bug:
getRipgrepPath() in bundle/chunk-NET4RIEQ.js only checks two paths relative to its own bundle dir:
vendor/ripgrep/rg-win32-x64.exe
../../vendor/ripgrep/rg-win32-x64.exe
Neither path contains the bundled binary after a standard npm install -g. System PATH is never consulted. Result: "Ripgrep is not available.
Falling back to GrepTool." even when rg is installed and functional.

Repro:
npm install -g @google/gemini-cli
winget install BurntSushi.ripgrep.MSVC
gemini -p "test"

→ "Ripgrep is not available. Falling back to GrepTool."

rg --version

→ ripgrep 15.1.0 ✓

Expected: Fall back to where rg (Windows) / which rg (Unix) when bundled binary not found.

Suggested fix:
async function getRipgrepPath() {
// ... existing candidate paths ...
for (const candidate of candidatePaths) {
if (await fileExists(candidate)) return candidate;
}
// Fallback: check system PATH
try {
const { execFileSync } = require('child_process');
const found = process.platform === 'win32'
? execFileSync('where', ['rg'], { encoding: 'utf8' }).split('\n')[0].trim()
: execFileSync('which', ['rg'], { encoding: 'utf8' }).trim();
if (found && await fileExists(found)) return found;
} catch (_) {}
return null;
}

Workaround: Copy system rg to bundle/vendor/ripgrep/rg-win32-x64.exe inside the Gemini CLI install dir.

Metadata

Metadata

Assignees

Labels

area/coreIssues related to User Interface, OS Support, Core Functionalityeffort/small1 day or less: trivial logic, UI adjustments, docskind/bugpriority/p2Important but can be addressed in a future release.status/bot-triagedstatus/need-information

Type

Projects

Status
Closed

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions