Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request transitions the project from dynamically downloading the ripgrep binary at runtime to using a pre-bundled set of platform-specific binaries stored in a vendor directory. This change enhances the stability of the tool by removing external network dependencies during execution and simplifies the binary management process. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
|
Hi @jacob314, thank you so much for your contribution to Gemini CLI! We really appreciate the time and effort you've put into this. We're making some updates to our contribution process to improve how we track and review changes. Please take a moment to review our recent discussion post: Improving Our Contribution Process & Introducing New Guidelines. Key Update: Starting January 26, 2026, the Gemini CLI project will require all pull requests to be associated with an existing issue. Any pull requests not linked to an issue by that date will be automatically closed. Thank you for your understanding and for being a part of our community! |
🛑 Action Required: Evaluation ApprovalSteering changes have been detected in this PR. To prevent regressions, a maintainer must approve the evaluation run before this PR can be merged. Maintainers:
Once approved, the evaluation results will be posted here automatically. |
|
Size Change: -359 kB (-1.05%) Total Size: 33.8 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Code Review
This pull request transitions the ripgrep tool from dynamic runtime downloading to using bundled binaries. It removes the @joshua.litt/get-ripgrep dependency, adds a vendor directory for platform-specific binaries, and introduces a script to download these prebuilt binaries. The core logic and tests have been updated to resolve ripgrep paths from the local vendor directory. Feedback highlights a missing Apache-2.0 license header in the new script and suggests a null check for the fetch response body to avoid runtime errors.
| @@ -0,0 +1,93 @@ | |||
| import fs from 'node:fs'; | |||
There was a problem hiding this comment.
The new script is missing the required Apache-2.0 license header. According to the repository style guide, all new source code files must include this header with the current year.
References
- License Headers: For all new source code files (.ts, .tsx, .js), include the Apache-2.0 license header with the current year. (e.g., Copyright 2026 Google LLC). This is enforced by ESLint. (link)
| const { Readable } = await import('node:stream'); | ||
| const fileStream = createWriteStream(archivePath); | ||
| // @ts-ignore - response.body is a Web Stream, pipeline can handle it in newer Node | ||
| await pipeline(Readable.fromWeb(response.body), fileStream); |
There was a problem hiding this comment.
response.body can be null according to the Fetch API specification (e.g., if the server returns a 204 No Content response). Passing null to Readable.fromWeb will cause a runtime TypeError. It is safer to verify that the body exists before attempting to stream it.
| await pipeline(Readable.fromWeb(response.body), fileStream); | |
| if (!response.body) { | |
| throw new Error("Response body is null for " + url); | |
| } | |
| await pipeline(Readable.fromWeb(response.body), fileStream); |
| // Extract using shell commands for simplicity | ||
| if (target.file.endsWith('.tar.gz')) { | ||
| const { execSync } = await import('node:child_process'); | ||
| execSync(`tar -xzf ${archivePath} -C ${CORE_VENDOR_DIR}`); |
| } | ||
| } else if (target.file.endsWith('.zip')) { | ||
| const { execSync } = await import('node:child_process'); | ||
| execSync(`unzip -o -q ${archivePath} -d ${CORE_VENDOR_DIR}`); |
|
Going to close this so I can open my own. |
Summary
This PR bundles
ripgrepnative binaries directly into the Gemini CLI's Single Executable Application (SEA). This solves a critical issue for enterprise users in air-gapped or offline environments, where the CLI would previously hang or fail while attempting to downloadripgrepat runtime.Details
ripgrepbinaries for the 5 major architectures (Linux x64/arm64, macOS x64/arm64, Windows x64) are now checked intopackages/core/vendor/ripgrep.scripts/copy_bundle_assets.jsto ensure the vendor directory is included in thebundle/folder during the SEA build process.packages/core/src/tools/ripGrep.tsto asynchronously check multiple potential paths for thergexecutable, supporting both local development and the flattened SEA runtime environment.scripts/download-ripgrep-binaries.jswith proper Apache license headers and documentation to allow maintainers to easily update the checked-in binaries.vi.spyOnfor platform mocking and added parameterized tests to verify correct path resolution across all supported operating systems.Related Issues
Fixes #25332 (Implementation)
How to Validate
node scripts/download-ripgrep-binaries.jsto verify the maintainer script correctly fetches all 5 architectures.npm run buildfollowed bynpm run test -w @google/gemini-cli-core -- src/tools/ripGrep.test.tsto verify unit tests pass.node scripts/build_binary.jsto generate a native SEA executable../dist/darwin-arm64/gemini -e "search for hello") to verify ripgrep works without a network connection.Pre-Merge Checklist