{"record":{"id":"3d6f73cccefbbe78","repo":"Yeachan-Heo/oh-my-codex","slug":"invalid-setup-scope-value-expected-one-of","errorCode":null,"errorMessage":"Invalid setup scope: ${value}. Expected one of: ${SETUP_SCOPES.join(\", \")}","messagePattern":"Invalid setup scope: (.+?)\\. Expected one of: (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/cli/index.ts","lineNumber":692,"sourceCode":"      const next = args[index + 1];\n      if (!next || next.startsWith(\"-\")) {\n        throw new Error(\n          `Missing setup scope value after --scope. Expected one of: ${SETUP_SCOPES.join(\", \")}`,\n        );\n      }\n      value = next;\n      index += 1;\n      continue;\n    }\n    if (arg.startsWith(\"--scope=\")) {\n      value = arg.slice(\"--scope=\".length);\n    }\n  }\n  if (!value) return undefined;\n  if (SETUP_SCOPES.includes(value as SetupScope)) {\n    return value as SetupScope;\n  }\n  throw new Error(\n    `Invalid setup scope: ${value}. Expected one of: ${SETUP_SCOPES.join(\", \")}`,\n  );\n}\n\nexport function resolveSetupTeamModeArg(args: string[]): SetupTeamMode | undefined {\n  let value: SetupTeamMode | undefined;\n  const setValue = (next: SetupTeamMode, source: string): void => {\n    if (value && value !== next) {\n      throw new Error(\n        `Conflicting setup Team mode flags: ${source} selects ${next}, but another flag already selected ${value}`,\n      );\n    }\n    value = next;\n  };\n  const parseValue = (next: string): SetupTeamMode => {\n    if (!SETUP_TEAM_MODES.includes(next as SetupTeamMode)) {\n      throw new Error(\n        `Invalid setup Team mode: ${next}. Expected one of: enabled, disabled`,","sourceCodeStart":674,"sourceCodeEnd":710,"githubUrl":"https://github.com/Yeachan-Heo/oh-my-codex/blob/3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2/src/cli/index.ts#L674-L710","documentation":"After parsing, the --scope value must be one of the allowed setup scopes (SETUP_SCOPES). Any unrecognized value is rejected at the end of resolveSetupScopeArg.","triggerScenarios":"`--scope repo`, `--scope Global` — any value not in SETUP_SCOPES (note this check happens after the loop, so the value isn't validated inline).","commonSituations":"Version drift where scope names changed; guessing scope names like `local` vs `project`.","solutions":["Check help output for the exact scope list (SETUP_SCOPES)","Use the exact lowercase scope name, e.g. project/user as supported"],"exampleFix":"# before\nomx setup --scope local\n# after\nomx setup --scope project","handlingStrategy":"type-guard","validationCode":"if (!SETUP_SCOPES.includes(scope)) throw new Error(`invalid scope: ${scope}`);","typeGuard":"const isSetupScope = (v: string): v is SetupScope => SETUP_SCOPES.includes(v as SetupScope);","tryCatchPattern":null,"preventionTips":["Print supported scopes in CLI help and read it after upgrades"],"tags":["cli","invalid-value","enum-validation","scope"],"backgroundTag":"invalid-cli-flag-value","analyzedSha":"3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2","analyzedAt":"2026-08-27T22:18:39.783Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}