google-gemini/gemini-cli · error

Please include at least one extension name to uninstall as a

Error message

Please include at least one extension name to uninstall as a positional argument, or use the --all flag.

What it means

The 'gemini extensions uninstall' command requires either at least one positional extension name OR the --all flag. If neither is provided, the yargs .check() throws before the handler runs. Providing both is allowed (--all takes precedence in the handler).

Source

Thrown at packages/cli/src/commands/extensions/uninstall.ts:87

export const uninstallCommand: CommandModule = {
  command: 'uninstall [names..]',
  describe: 'Uninstalls one or more extensions.',
  builder: (yargs) =>
    yargs
      .positional('names', {
        describe:
          'The name(s) or source path(s) of the extension(s) to uninstall.',
        type: 'string',
        array: true,
      })
      .option('all', {
        type: 'boolean',
        describe: 'Uninstall all installed extensions.',
        default: false,
      })
      .check((argv) => {
        if (!argv.all && (!argv.names || argv.names.length === 0)) {
          throw new Error(
            'Please include at least one extension name to uninstall as a positional argument, or use the --all flag.',
          );
        }
        return true;
      }),
  handler: async (argv) => {
    await handleUninstall({
      // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
      names: argv['names'] as string[] | undefined,
      // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
      all: argv['all'] as boolean,
    });
    await exitCli();
  },
};

View on GitHub (pinned to 5024443c72)

Solutions

  1. Provide extension name(s): 'gemini extensions uninstall my-ext' or 'gemini extensions uninstall ext1 ext2'.
  2. Use the --all flag to uninstall every installed extension: 'gemini extensions uninstall --all'.

Example fix

// before
gemini extensions uninstall  // no targets specified

// after
gemini extensions uninstall my-old-extension
Defensive patterns

Strategy: validation

Validate before calling

function validateUninstallArgs(names?: string[], all?: boolean): void {
  if (!all && (!names || names.length === 0)) {
    throw new Error('Provide at least one extension name or use --all.');
  }
}

validateUninstallArgs(args.names, args.all);

Prevention

When it happens

Trigger: Running 'gemini extensions uninstall' with no positional arguments and no --all flag.

Common situations: Forgetting to specify which extension to remove; scripting error that omits both the name and the flag.

Related errors


AI-assisted analysis of google-gemini/gemini-cli@5024443c72 (2026-08-12). Data as JSON: /api/errors/d2318f5f33e78bab. Report an issue: GitHub.