feat(cli): add gemini update command#24080
feat(cli): add gemini update command#24080gvenugo3 wants to merge 1 commit intogoogle-gemini:mainfrom
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 introduces a manual update mechanism for the Gemini CLI, enabling users to proactively manage their installation version. By providing both a CLI command and an interactive slash command, it improves the developer experience for maintaining the tool across various package managers and environments. 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
|
There was a problem hiding this comment.
Code Review
This pull request introduces a new update command to the Gemini CLI, allowing users to check for and install the latest version directly from the terminal. The implementation includes a core performUpdate utility that handles different package managers (npm, yarn, pnpm, bun, homebrew) and provides feedback through both the standard CLI and the interactive UI. Comprehensive unit tests have been added to verify the update logic across various environments and failure scenarios. The review feedback correctly identifies that all new source files must use the year 2026 in their license headers to comply with the repository's style guide.
|
Hi, I would like to work on this issue. I’m a GSoC 2026 applicant and have experience with Python and Node.js and CLI tools. I’d love to contribute to this feature. Could you please guide me on how to proceed? Thanks! |
59e3ef9 to
1193583
Compare
|
@mrpmohiburrahman made the changes you pointed out! Please let me know if everything looks good. |
Implement a new 'gemini update' command that checks for and installs newer versions of the CLI while preserving the current release channel (stable, preview, or nightly). Features: - Check for available updates from npm registry - Preserve release channel during update (stable/preview/nightly) - Support all major package managers (npm, yarn, pnpm, bun, homebrew) - Provide graceful handling for unsupported installation methods - Available as both CLI command (gemini update) and slash command (/update) - Comprehensive unit tests (14 test cases) Implementation: - Core update logic in performUpdate.ts (200+ LOC) - Reuses existing infrastructure for installation detection and package manager integration - Proper TypeScript typing with union types for update results - Handles preview channel versions alongside nightly and stable builds The implementation resolves issue google-gemini#16122 by providing users with a straightforward way to update their CLI installation without needing to manually invoke package manager commands.
1193583 to
a09cd90
Compare
|
@Adib234 please let me know if this implementation looks good. |
Summary
Implement a new
gemini updatecommand that checks for and installs newer versions of the CLI while preserving the current release channel (stable, preview, or nightly).Features
gemini update/update(in interactive mode)Implementation Details
performUpdate.ts(200 LOC)getInstallationInfo)Test Results
✅ 13/13 unit tests passing
✅ Zero TypeScript errors
✅ ESLint: 0 warnings, 0 errors
Files Changed
packages/cli/src/commands/update.ts- Yargs CLI commandpackages/cli/src/ui/commands/updateCommand.ts- Slash commandpackages/cli/src/utils/performUpdate.ts- Core update logicpackages/cli/src/utils/performUpdate.test.ts- Unit testspackages/cli/src/config/config.ts- Command registrationpackages/cli/src/services/BuiltinCommandLoader.ts- Slash command registrationpackages/cli/package.json- Added semver dependencyResolves #16122