{"record":{"id":"6380bf3a0937fd49","repo":"google-gemini/gemini-cli","slug":"either-an-extension-name-or-all-must-be-provided","errorCode":null,"errorMessage":"Either an extension name or --all must be provided","messagePattern":"Either an extension name or --all must be provided","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/cli/src/commands/extensions/update.ts","lineNumber":155,"sourceCode":"\nexport const updateCommand: CommandModule = {\n  command: 'update [<name>] [--all]',\n  describe:\n    'Updates all extensions or a named extension to the latest version.',\n  builder: (yargs) =>\n    yargs\n      .positional('name', {\n        describe: 'The name of the extension to update.',\n        type: 'string',\n      })\n      .option('all', {\n        describe: 'Update all extensions.',\n        type: 'boolean',\n      })\n      .conflicts('name', 'all')\n      .check((argv) => {\n        if (!argv.all && !argv.name) {\n          throw new Error('Either an extension name or --all must be provided');\n        }\n        return true;\n      }),\n  handler: async (argv) => {\n    await handleUpdate({\n      // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion\n      name: argv['name'] as string | undefined,\n      // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion\n      all: argv['all'] as boolean | undefined,\n    });\n    await exitCli();\n  },\n};\n","sourceCodeStart":137,"sourceCodeEnd":169,"githubUrl":"https://github.com/google-gemini/gemini-cli/blob/5024443c7217464a66e98f80d73172a26440bd8f/packages/cli/src/commands/extensions/update.ts#L137-L169","documentation":"The 'gemini extensions update' command requires either a positional <name> OR the --all flag; they are mutually exclusive (declared via .conflicts('name', 'all')). If neither is provided, the yargs .check() throws.","triggerScenarios":"Running 'gemini extensions update' with no name positional and no --all flag. Providing both name and --all triggers a yargs conflicts error instead.","commonSituations":"Forgetting to specify what to update; scripting error; confusion about the command's required arguments.","solutions":["Provide a specific name: 'gemini extensions update my-ext'.","Use --all to update every installed extension: 'gemini extensions update --all'.","Do not combine name and --all (they conflict)."],"exampleFix":"// before\ngemini extensions update  // no target\n\n// after\ngemini extensions update --all","handlingStrategy":"validation","validationCode":"function validateUpdateArgs(name?: string, all?: boolean): void {\n  if (!all && !name) {\n    throw new Error('Provide an extension name or use --all.');\n  }\n  if (all && name) {\n    throw new Error('Name and --all are mutually exclusive.');\n  }\n}\n\nvalidateUpdateArgs(args.name, args.all);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always specify a name or --all when updating (never both).","Use 'gemini extensions list' to see installed extension names."],"tags":["cli","extensions","update","arguments","yargs"],"backgroundTag":null,"analyzedSha":"5024443c7217464a66e98f80d73172a26440bd8f","analyzedAt":"2026-08-12T06:01:53.711Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}