Skip to content

Conversation

@JayadityaGit
Copy link
Contributor

@JayadityaGit JayadityaGit commented Nov 13, 2025

Summary

This PR adds support for uninstalling multiple extensions in a single command.
Previously, users had to run gemini extensions uninstall multiple times — now they can pass multiple extension names separated by spaces.


Details

  • Updated command signature from uninstall <name>uninstall <names...> to support variadic arguments

  • Enhanced handleUninstall to iterate through all provided extension names

  • Improved error handling to:

    • Continue uninstalling remaining extensions even if some fail
    • Aggregate and report all errors at the end
    • Exit with a non-zero status only if any uninstalls fail
  • Fully backward compatible with single-extension uninstalls

  • Added comprehensive test coverage for:

    • Single extension uninstall
    • Multiple extension uninstall
    • Partial failure scenarios
    • Complete failure scenarios

How to Validate

  1. Build the project

    npm run bundle
  2. Create and install test extensions

    mkdir -p /tmp/test-ext-{1,2,3}
    echo '{"name":"test-1","version":"1.0.0"}' > /tmp/test-ext-1/gemini-extension.json
    echo '{"name":"test-2","version":"1.0.0"}' > /tmp/test-ext-2/gemini-extension.json
    echo '{"name":"test-3","version":"1.0.0"}' > /tmp/test-ext-3/gemini-extension.json
    
    echo "y" | node bundle/gemini.js extensions link /tmp/test-ext-{1,2,3}
  3. Verify extensions are installed

    node bundle/gemini.js extensions list
    # Should list test-1, test-2, test-3
  4. Test single uninstall (backward compatibility)

    node bundle/gemini.js extensions uninstall test-1
    # Expected: Extension "test-1" successfully uninstalled.
  5. Test multiple uninstall (new feature)

    node bundle/gemini.js extensions uninstall test-2 test-3
    # Expected:
    # Extension "test-2" successfully uninstalled.
    # Extension "test-3" successfully uninstalled.
  6. Verify all extensions are removed

    node bundle/gemini.js extensions list
    # Expected: No extensions installed.
  7. Run tests

    cd packages/cli
    npx vitest run src/commands/extensions/uninstall.test.ts --no-coverage
    # All tests should pass

Pre-Merge Checklist

  • [] Documentation updated (if applicable)
  • Tests added/updated
  • Verified backward compatibility (no breaking changes)
  • Validated on Linux
  • Validation on MacOS and Windows pending

#13017

@JayadityaGit JayadityaGit requested a review from a team as a code owner November 13, 2025 18:11
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @JayadityaGit, 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 significantly enhances the extension management CLI by enabling users to uninstall multiple extensions simultaneously. It refactors the uninstall command to accept multiple extension names as arguments, improving efficiency and user experience. The implementation includes robust error handling that allows the uninstallation process to continue even if some extensions fail, aggregating all errors and reporting them at the end, while ensuring full backward compatibility for single uninstalls.

Highlights

  • Multiple Extension Uninstall: Adds support for uninstalling multiple extensions in a single command, eliminating the need to run the command repeatedly for each extension.
  • Command Signature Update: The uninstall command signature has been updated from uninstall <name> to uninstall <names...> to accommodate variadic arguments.
  • Enhanced Error Handling: Improved error handling ensures that the uninstallation process continues for other extensions even if some fail. All errors are aggregated and reported at the end, with the process exiting with a non-zero status only if any uninstalls fail.
  • Backward Compatibility: The new functionality is fully backward compatible, meaning single-extension uninstalls still work as expected.
  • Comprehensive Test Coverage: Extensive test coverage has been added for single, multiple, partial failure, and complete failure scenarios to ensure robustness.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request successfully adds the functionality to uninstall multiple extensions in a single command. The implementation is robust, handling partial failures by continuing with other extensions and reporting all errors at the end. The associated tests are comprehensive and cover various scenarios, including single, multiple, and failed uninstalls. I have one suggestion to handle cases where duplicate extension names are provided as input to avoid user confusion.

JayadityaGit and others added 2 commits November 13, 2025 23:59
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
expect(processSpy).not.toHaveBeenCalled();
});

it('should report errors for failed uninstalls but continue with others', async () => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 👍 👍 👍

Copy link
Collaborator

@chrstnb chrstnb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! Looks good to me

@JayadityaGit
Copy link
Contributor Author

Hi @chrstnb

I've resolved the merge conflicts and updated the branch. I also adjusted the test mocking strategy so the partial-failure test now works as intended.

The tests now use vi.hoisted() instead of the usual vi.mocked() pattern. This allows chaining mockResolvedValueOnce() / mockRejectedValueOnce() calls, which the existing vi.clearAllMocks() pattern was clearing.

Thank for the review !

@chrstnb chrstnb enabled auto-merge November 18, 2025 15:10
@chrstnb chrstnb added this pull request to the merge queue Nov 18, 2025
Merged via the queue into google-gemini:main with commit 7d33baa Nov 18, 2025
21 checks passed
jackwotherspoon pushed a commit that referenced this pull request Nov 19, 2025
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
thacio added a commit to thacio/auditaria that referenced this pull request Nov 22, 2025
danpalmer pushed a commit to danpalmer/gemini-cli that referenced this pull request Nov 29, 2025
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@JayadityaGit JayadityaGit deleted the feat/multiple-extension-uninstall branch December 17, 2025 05:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants