{"record":{"id":"d2318f5f33e78bab","repo":"google-gemini/gemini-cli","slug":"please-include-at-least-one-extension-name-to-unin","errorCode":null,"errorMessage":"Please include at least one extension name to uninstall as a positional argument, or use the --all flag.","messagePattern":"Please include at least one extension name to uninstall as a positional argument, or use the --all flag\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/cli/src/commands/extensions/uninstall.ts","lineNumber":87,"sourceCode":"export const uninstallCommand: CommandModule = {\n  command: 'uninstall [names..]',\n  describe: 'Uninstalls one or more extensions.',\n  builder: (yargs) =>\n    yargs\n      .positional('names', {\n        describe:\n          'The name(s) or source path(s) of the extension(s) to uninstall.',\n        type: 'string',\n        array: true,\n      })\n      .option('all', {\n        type: 'boolean',\n        describe: 'Uninstall all installed extensions.',\n        default: false,\n      })\n      .check((argv) => {\n        if (!argv.all && (!argv.names || argv.names.length === 0)) {\n          throw new Error(\n            'Please include at least one extension name to uninstall as a positional argument, or use the --all flag.',\n          );\n        }\n        return true;\n      }),\n  handler: async (argv) => {\n    await handleUninstall({\n      // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion\n      names: argv['names'] as string[] | undefined,\n      // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion\n      all: argv['all'] as boolean,\n    });\n    await exitCli();\n  },\n};\n","sourceCodeStart":69,"sourceCodeEnd":103,"githubUrl":"https://github.com/google-gemini/gemini-cli/blob/5024443c7217464a66e98f80d73172a26440bd8f/packages/cli/src/commands/extensions/uninstall.ts#L69-L103","documentation":"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).","triggerScenarios":"Running 'gemini extensions uninstall' with no positional arguments and no --all flag.","commonSituations":"Forgetting to specify which extension to remove; scripting error that omits both the name and the flag.","solutions":["Provide extension name(s): 'gemini extensions uninstall my-ext' or 'gemini extensions uninstall ext1 ext2'.","Use the --all flag to uninstall every installed extension: 'gemini extensions uninstall --all'."],"exampleFix":"// before\ngemini extensions uninstall  // no targets specified\n\n// after\ngemini extensions uninstall my-old-extension","handlingStrategy":"validation","validationCode":"function validateUninstallArgs(names?: string[], all?: boolean): void {\n  if (!all && (!names || names.length === 0)) {\n    throw new Error('Provide at least one extension name or use --all.');\n  }\n}\n\nvalidateUninstallArgs(args.names, args.all);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always specify extension name(s) or the --all flag when uninstalling.","Use 'gemini extensions list' to confirm installed extension names before uninstalling."],"tags":["cli","extensions","uninstall","arguments","yargs"],"backgroundTag":null,"analyzedSha":"5024443c7217464a66e98f80d73172a26440bd8f","analyzedAt":"2026-08-12T06:01:53.711Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}