Skip to content

Conversation

@JayadityaGit
Copy link
Contributor

@JayadityaGit JayadityaGit commented Nov 11, 2025

Summary

This PR adds an uninstall subcommand to the /extensions command, enabling users to remove extensions directly from the CLI. It also improves the UX by reordering extension subcommands based on usage frequency for better discoverability.

Details

  • Added /extensions uninstall <extension-name> with a confirmation prompt
  • Displays a list of installed extensions when no extension name is provided
  • Includes error handling for non-existent extensions
  • Updates UI state and reloads commands after a successful uninstall
  • Reordered subcommands: listexplorerestartupdateuninstall
  • Added comprehensive tests for uninstall functionality

Related Issues

Enhances the overall extension-management workflow.

How to Validate

  1. Install an extension (if none are installed)
  2. Run /extensions uninstall to view usage info and the installed extensions list
  3. Run /extensions uninstall <extension-name> and confirm the prompt
  4. Verify the extension no longer appears in /extensions list
  5. Test error handling with /extensions uninstall non-existent-extension
  6. Check subcommand ordering when typing /extensions with tab completion

Pre-Merge Checklist

- Add a new `uninstall` subcommand to the `/extensions` command.
- The `uninstall` subcommand allows users to remove installed extensions.
- Convert `extensionsCommand.ts` to `extensionsCommand.tsx` to support JSX for the confirmation prompt.
- Add tests for the new `uninstall` subcommand.
@JayadityaGit JayadityaGit requested a review from a team as a code owner November 11, 2025 17:19
@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 capabilities within the CLI by introducing a dedicated uninstall feature. It streamlines the process of removing unwanted extensions, improving the overall user experience through intuitive prompts, clear error messages, and a more logical arrangement of extension-related commands. This change makes the CLI a more complete and user-friendly tool for managing installed extensions.

Highlights

  • New Uninstall Command: Introduced a new uninstall subcommand to the /extensions command, allowing users to remove extensions directly from the CLI.
  • Improved User Experience: The order of extension subcommands has been reordered for better discoverability, prioritizing frequently used commands.
  • Robust Error Handling: The uninstall functionality includes comprehensive error handling for scenarios such as no extensions installed or attempting to uninstall a non-existent extension.
  • Interactive Confirmation: A confirmation prompt is now displayed before an extension is uninstalled, preventing accidental removals.
  • Dynamic UI Updates: After a successful uninstall, the UI state is updated, and commands are reloaded to reflect the changes immediately.
  • Comprehensive Testing: New tests have been added to cover various aspects of the uninstall functionality, including action execution and command completion.
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 introduces a valuable uninstall subcommand for managing extensions, which is a great addition. The implementation is well-structured, including a confirmation prompt and error handling. The accompanying tests cover the primary functionality. However, I've identified two high-severity issues related to case-sensitivity in how extension names are matched and suggested for completion. These could lead to user frustration when an extension isn't found despite being installed. Addressing these points will significantly improve the robustness and user-friendliness of this new feature.

return;
}

const extension = extensions.find((ext) => ext.name === trimmedArgs);
Copy link
Contributor

Choose a reason for hiding this comment

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

high

The extension lookup is case-sensitive, while the underlying extensionManager.uninstallExtension method performs a case-insensitive search. This discrepancy can lead to a "not found" error for an extension that exists but is specified with different casing. To ensure consistent and predictable behavior, the lookup here should also be case-insensitive.

  const extension = extensions.find(
    (ext) => ext.name.toLowerCase() === trimmedArgs.toLowerCase(),
  );

? listExtensions(context.services.config)
: [];
const extensionNames = extensions.map((ext) => ext.name);
return extensionNames.filter((name) => name.startsWith(partialArg));
Copy link
Contributor

Choose a reason for hiding this comment

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

high

The completion filtering for extension names is case-sensitive. For a better user experience and for consistency with a case-insensitive command argument, the completion logic should also be case-insensitive. This will help users discover extensions via tab-completion even if they don't remember the exact casing.

    return extensionNames.filter((name) => name.toLowerCase().startsWith(partialArg.toLowerCase()));

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.

1 participant