{"record":{"id":"1220e63651e9ffe1","repo":"Yeachan-Heo/oh-my-codex","slug":"missing-setup-scope-value-after-scope-expected","errorCode":null,"errorMessage":"Missing setup scope value after --scope. Expected one of: ${SETUP_SCOPES.join(\", \")}","messagePattern":"Missing setup scope value after --scope\\. Expected one of: (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/cli/index.ts","lineNumber":676,"sourceCode":"      index += 1;\n      continue;\n    }\n    if (arg.startsWith(\"--mcp=\")) {\n      setValue(parseValue(arg.slice(\"--mcp=\".length)), \"--mcp\");\n    }\n  }\n\n  return value;\n}\n\nexport function resolveSetupScopeArg(args: string[]): SetupScope | undefined {\n  let value: string | undefined;\n  for (let index = 0; index < args.length; index += 1) {\n    const arg = args[index];\n    if (arg === \"--scope\") {\n      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  );","sourceCodeStart":658,"sourceCodeEnd":694,"githubUrl":"https://github.com/Yeachan-Heo/oh-my-codex/blob/3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2/src/cli/index.ts#L658-L694","documentation":"--scope requires a value (one of SETUP_SCOPES) as the next token. Thrown when --scope is the last argument or the following token looks like another flag.","triggerScenarios":"`omx setup --scope` at end, or `--scope --mcp compat`.","commonSituations":"Missing value in scripted invocations; copy-paste truncation.","solutions":["Append a valid scope, e.g. `--scope project`","Use `--scope=<value>` inline form"],"exampleFix":"# before\nomx setup --scope\n# after\nomx setup --scope=project","handlingStrategy":"validation","validationCode":"const i = args.indexOf('--scope');\nconst v = args[i + 1];\nif (!v || v.startsWith('-')) throw new Error('missing scope value');","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use --scope=<value>","Pair flag/value in arg-building helpers"],"tags":["cli","missing-argument","scope","setup"],"backgroundTag":"missing-cli-argument-value","analyzedSha":"3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2","analyzedAt":"2026-08-27T22:18:39.783Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}