{"record":{"id":"83c55ea9213f6bbd","repo":"google-gemini/gemini-cli","slug":"invalid-scope-argv-scope-please-use-one-of","errorCode":null,"errorMessage":"Invalid scope: ${argv.scope}. Please use one of ${Object.values(SettingScope).map((s) => s.toLowerCase()).join(', ')}.","messagePattern":"Invalid scope: (.+?)\\. Please use one of (.+?)\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/cli/src/commands/extensions/disable.ts","lineNumber":69,"sourceCode":"  builder: (yargs) =>\n    yargs\n      .positional('name', {\n        describe: 'The name of the extension to disable.',\n        type: 'string',\n      })\n      .option('scope', {\n        describe: 'The scope to disable the extension in.',\n        type: 'string',\n        default: SettingScope.User,\n      })\n      .check((argv) => {\n        if (\n          argv.scope &&\n          !Object.values(SettingScope)\n            .map((s) => s.toLowerCase())\n            .includes(argv.scope.toLowerCase())\n        ) {\n          throw new Error(\n            `Invalid scope: ${argv.scope}. Please use one of ${Object.values(\n              SettingScope,\n            )\n              .map((s) => s.toLowerCase())\n              .join(', ')}.`,\n          );\n        }\n        return true;\n      }),\n  handler: async (argv) => {\n    await handleDisable({\n      // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion\n      name: argv['name'] as string,\n      // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion\n      scope: argv['scope'] as string,\n    });\n    await exitCli();\n  },","sourceCodeStart":51,"sourceCodeEnd":87,"githubUrl":"https://github.com/google-gemini/gemini-cli/blob/5024443c7217464a66e98f80d73172a26440bd8f/packages/cli/src/commands/extensions/disable.ts#L51-L87","documentation":"The 'gemini extensions disable' command's --scope option is validated in a yargs .check() against the lowercased values of the SettingScope enum: user, workspace, system, systemdefaults, session. An unrecognized value fails validation and aborts before the handler runs. The default scope is User.","triggerScenarios":"Running 'gemini extensions disable <name> --scope foo' where 'foo' is not one of the valid SettingScope values. The check compares case-insensitively.","commonSituations":"Typo in scope name (e.g., 'worckspace'); passing a scope name in an unexpected format; misunderstanding the available scopes.","solutions":["Use one of the valid scope values (case-insensitive): user, workspace, system, systemdefaults, session.","Omit --scope entirely to use the default (User).","Run 'gemini extensions disable --help' to see accepted values."],"exampleFix":"// before\ngemini extensions disable my-ext --scope project  // invalid\n\n// after\ngemini extensions disable my-ext --scope workspace  // valid","handlingStrategy":"validation","validationCode":"import { SettingScope } from '../../config/settings.js';\n\nfunction isValidScope(scope: string): boolean {\n  return Object.values(SettingScope)\n    .map((s) => s.toLowerCase())\n    .includes(scope.toLowerCase());\n}\n\n// Before calling disable:\nif (scope && !isValidScope(scope)) {\n  throw new Error(`Use one of: ${Object.values(SettingScope).map((s) => s.toLowerCase()).join(', ')}`);\n}","typeGuard":"import { SettingScope } from '../../config/settings.js';\n\nfunction isValidSettingScope(value: string): value is string {\n  return Object.values(SettingScope)\n    .map((s) => s.toLowerCase())\n    .includes(value.toLowerCase());\n}","tryCatchPattern":null,"preventionTips":["Use tab-completion or --help to see valid scope values.","Omit --scope to use the default (User) when unsure.","Remember valid values: user, workspace, system, systemdefaults, session."],"tags":["cli","extensions","scope","validation","yargs"],"backgroundTag":null,"analyzedSha":"5024443c7217464a66e98f80d73172a26440bd8f","analyzedAt":"2026-08-12T06:01:53.711Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}