{"record":{"id":"3103c8e50eca045f","repo":"google-gemini/gemini-cli","slug":"the-source-argument-must-be-provided","errorCode":null,"errorMessage":"The source argument must be provided.","messagePattern":"The source argument must be provided\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/cli/src/commands/extensions/install.ts","lineNumber":207,"sourceCode":"      })\n      .option('pre-release', {\n        describe: 'Enable pre-release versions for this extension.',\n        type: 'boolean',\n      })\n      .option('consent', {\n        describe:\n          'Acknowledge the security risks of installing an extension and skip the confirmation prompt.',\n        type: 'boolean',\n        default: false,\n      })\n      .option('skip-settings', {\n        describe: 'Skip the configuration on install process.',\n        type: 'boolean',\n        default: false,\n      })\n      .check((argv) => {\n        if (!argv.source) {\n          throw new Error('The source argument must be provided.');\n        }\n        return true;\n      }),\n  handler: async (argv) => {\n    await handleInstall({\n      // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion\n      source: argv['source'] as string,\n      // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion\n      ref: argv['ref'] as string | undefined,\n      // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion\n      autoUpdate: argv['auto-update'] as boolean | undefined,\n      // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion\n      allowPreRelease: argv['pre-release'] as boolean | undefined,\n      // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion\n      consent: argv['consent'] as boolean | undefined,\n      // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion\n      skipSettings: argv['skip-settings'] as boolean | undefined,\n    });","sourceCodeStart":189,"sourceCodeEnd":225,"githubUrl":"https://github.com/google-gemini/gemini-cli/blob/5024443c7217464a66e98f80d73172a26440bd8f/packages/cli/src/commands/extensions/install.ts#L189-L225","documentation":"The 'gemini extensions install' command requires a <source> positional argument (a git URL or local path). A yargs .check() throws if argv.source is falsy, serving as a redundant guard alongside demandOption: true on the positional.","triggerScenarios":"Running 'gemini extensions install' with no source argument. The demandOption should normally catch this first, but the check is a safety net.","commonSituations":"Forgetting the source argument; scripting error that omits the positional; yargs edge case where demandOption doesn't fire.","solutions":["Provide a source argument: 'gemini extensions install <git-url-or-local-path>'.","Verify the source string is non-empty before invoking in scripts."],"exampleFix":"// before\ngemini extensions install  // missing source\n\n// after\ngemini extensions install https://github.com/user/ext.git","handlingStrategy":"validation","validationCode":"function validateInstallArgs(source: string | undefined): string {\n  if (!source) {\n    throw new Error('A source (git URL or local path) is required.');\n  }\n  return source;\n}\n\nconst validSource = validateInstallArgs(args.source);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always provide the <source> positional when invoking the install command.","Validate that the source string is non-empty before scripting install commands."],"tags":["cli","extensions","install","arguments","yargs"],"backgroundTag":null,"analyzedSha":"5024443c7217464a66e98f80d73172a26440bd8f","analyzedAt":"2026-08-12T06:01:53.711Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}