Skip to content

fix(cli): implement --all flag for extensions uninstall#21319

Merged
sehoon38 merged 5 commits intomainfrom
fix/extensions-uninstall-all
Mar 6, 2026
Merged

fix(cli): implement --all flag for extensions uninstall#21319
sehoon38 merged 5 commits intomainfrom
fix/extensions-uninstall-all

Conversation

@sehoon38
Copy link
Contributor

@sehoon38 sehoon38 commented Mar 5, 2026

Summary

This PR fixes the issue where gemini extensions uninstall --all (and its interactive/ACP slash command counterparts) failed to uninstall all extensions.

Details

  • Updated the CLI command extensions uninstall to support the --all flag.
  • Fixed the interactive UI's /extensions uninstall action to correctly parse --all instead of treating it as an extension name.
  • Updated the ACP command handler for extensions uninstall to support --all.
  • Added unit tests to verify the fix in the CLI.

Related Issues

Fixes #21317

How to Validate

  1. Install a few extensions.
  2. Run gemini extensions uninstall --all in a non-interactive shell.
  3. Run gemini to enter interactive mode and run /extensions uninstall --all.
  4. Verify all extensions are uninstalled in both cases.

Pre-Merge Checklist

  • Updated relevant documentation and README (if needed)
  • Added/updated tests (if needed)
  • Noted breaking changes (if any)
  • Validated on required platforms/methods:
    • MacOS
      • npm run

@sehoon38 sehoon38 requested review from a team as code owners March 5, 2026 21:25
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, 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 addresses a critical bug where the --all flag for the extensions uninstall command was not functioning as expected across the CLI, interactive UI, and ACP. The changes ensure that users can now reliably remove all installed extensions with a single command, significantly improving the user experience and command-line utility. The fix involves updating argument parsing and uninstallation logic in the relevant command handlers and is backed by new unit tests.

Highlights

  • CLI extensions uninstall command: The gemini extensions uninstall command now correctly supports the --all flag, allowing users to uninstall all installed extensions at once. Previously, this command failed to uninstall all extensions when the flag was used.
  • Interactive UI /extensions uninstall command: The interactive UI's /extensions uninstall action has been updated to properly parse the --all flag, ensuring that it no longer treats --all as an extension name and correctly uninstalls all extensions.
  • ACP Command Handler Integration: The ACP command handler for extensions uninstall has been enhanced to support the --all flag, aligning its functionality with the CLI and interactive UI.
  • Unit Tests: New unit tests have been added to verify the correct behavior of the extensions uninstall --all functionality in the CLI, covering scenarios for successful uninstallation and cases where no extensions are installed.
Changelog
  • package-lock.json
    • Updated dependency metadata by adding "peer": true to several package entries.
  • packages/cli/src/acp/commands/extensions.ts
    • Modified UninstallExtensionCommand to parse the --all flag and handle its logic.
    • Updated the usage message to include the --all option.
    • Implemented a loop to uninstall multiple extensions when --all is specified, providing individual feedback for each.
  • packages/cli/src/commands/extensions/uninstall.test.ts
    • Added mockGetExtensions to the ExtensionManager mock for testing the --all flag.
    • Included new test cases to verify the uninstallation of all extensions and handling of no installed extensions when --all is used.
    • Updated the command definition to make extension names optional ([names..]) and added an option for the --all flag.
    • Adjusted the check function in the command builder to allow uninstallation without specific names if the --all flag is present.
  • packages/cli/src/commands/extensions/uninstall.ts
    • Modified the UninstallArgs interface to support an optional names array and an all boolean flag.
    • Refactored handleUninstall to determine extensions to uninstall based on the all flag or provided names.
    • Updated the command definition to accept optional extension names and introduced the --all option.
    • Revised the check function to validate arguments, allowing the --all flag to bypass the requirement for specific extension names.
  • packages/cli/src/ui/commands/extensionsCommand.ts
    • Updated uninstallAction to correctly parse and handle the --all flag from user input.
    • Modified the command usage message to reflect the new --all option.
    • Implemented logic to fetch all installed extensions when --all is active and iterate through them for uninstallation, providing real-time feedback.
Activity
  • The pull request author, sehoon38, has added new unit tests to cover the implemented functionality.
  • The changes have been validated on MacOS using npm run.
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.

@sehoon38 sehoon38 force-pushed the fix/extensions-uninstall-all branch from bf6e336 to 698de0a Compare March 5, 2026 21:27
@sehoon38 sehoon38 removed the request for review from a team March 5, 2026 21:29
@github-actions
Copy link

github-actions bot commented Mar 5, 2026

Size Change: +1.89 kB (+0.01%)

Total Size: 26 MB

Filename Size Change
./bundle/gemini.js 25.5 MB +1.89 kB (+0.01%)
ℹ️ View Unchanged
Filename Size
./bundle/node_modules/@google/gemini-cli-devtools/dist/client/main.js 221 kB
./bundle/node_modules/@google/gemini-cli-devtools/dist/src/_client-assets.js 227 kB
./bundle/node_modules/@google/gemini-cli-devtools/dist/src/index.js 11.5 kB
./bundle/node_modules/@google/gemini-cli-devtools/dist/src/types.js 132 B
./bundle/sandbox-macos-permissive-open.sb 890 B
./bundle/sandbox-macos-permissive-proxied.sb 1.31 kB
./bundle/sandbox-macos-restrictive-open.sb 3.36 kB
./bundle/sandbox-macos-restrictive-proxied.sb 3.56 kB
./bundle/sandbox-macos-strict-open.sb 4.82 kB
./bundle/sandbox-macos-strict-proxied.sb 5.02 kB

compressed-size-action

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 --all flag to the extensions uninstall command across the CLI, interactive UI, and ACP interfaces. The changes are well-tested and the implementation is mostly correct. The identified correctness issues in the interactive and ACP command handlers, where they only process the first extension name provided, silently ignoring any others, remain valid and are included in the review comments with suggestions to address them to ensure all provided extension names are uninstalled as a user would expect.

@gemini-cli gemini-cli bot added area/core Issues related to User Interface, OS Support, Core Functionality 🔒 maintainer only ⛔ Do not contribute. Internal roadmap item. labels Mar 5, 2026
@scidomino scidomino self-requested a review March 6, 2026 00:41
Copy link
Collaborator

@scidomino scidomino left a comment

Choose a reason for hiding this comment

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

Fix the broken test and it all looks good.

@sehoon38 sehoon38 force-pushed the fix/extensions-uninstall-all branch from c267842 to a113c0c Compare March 6, 2026 02:40
@sehoon38 sehoon38 added this pull request to the merge queue Mar 6, 2026
Merged via the queue into main with commit 509d4ae Mar 6, 2026
27 checks passed
@sehoon38 sehoon38 deleted the fix/extensions-uninstall-all branch March 6, 2026 03:24
jasmeetsb pushed a commit to jasmeetsb/gemini-cli that referenced this pull request Mar 6, 2026
struckoff pushed a commit to struckoff/gemini-cli that referenced this pull request Mar 6, 2026
kunal-10-cloud pushed a commit to kunal-10-cloud/gemini-cli that referenced this pull request Mar 12, 2026
liamhelmer pushed a commit to badal-io/gemini-cli that referenced this pull request Mar 12, 2026
yashodipmore pushed a commit to yashodipmore/geemi-cli that referenced this pull request Mar 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/core Issues related to User Interface, OS Support, Core Functionality 🔒 maintainer only ⛔ Do not contribute. Internal roadmap item.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Extensions uninstall --all fails to uninstall all extensions

2 participants