{"record":{"id":"31e49699176e4edd","repo":"Yeachan-Heo/oh-my-codex","slug":"unknown-capabilities-option-arg","errorCode":null,"errorMessage":"Unknown capabilities option: ${arg}","messagePattern":"Unknown capabilities option: (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/cli/capabilities.ts","lineNumber":110,"sourceCode":"      case \"--json\":\n        parsed.json = true;\n        break;\n      case \"--require-observations\":\n        parsed.requireObservations = true;\n        break;\n      case \"--strict-external-schemas\":\n        parsed.strictExternalSchemas = true;\n        break;\n      case \"--lockfile\":\n        parsed.lockfile = requireValue(args, index, arg);\n        index += 1;\n        break;\n      case \"--observations\":\n        parsed.observations = requireValue(args, index, arg);\n        index += 1;\n        break;\n      default:\n        if (arg.startsWith(\"--\")) throw new Error(`Unknown capabilities option: ${arg}`);\n        break;\n    }\n  }\n  return parsed;\n}\n\nfunction requireValue(args: string[], index: number, flag: string): string {\n  const value = args[index + 1];\n  if (!value || value.startsWith(\"--\")) throw new Error(`${flag} requires a value`);\n  return value;\n}\n\nfunction printResult(result: unknown, json: boolean): void {\n  if (json) {\n    console.log(JSON.stringify(result, null, 2));\n    return;\n  }\n  const check = result as Partial<CapabilityCheckResult> & { lockfile?: string };","sourceCodeStart":92,"sourceCodeEnd":128,"githubUrl":"https://github.com/Yeachan-Heo/oh-my-codex/blob/3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2/src/cli/capabilities.ts#L92-L128","documentation":"While parsing arguments for the `capabilities` command, an option starting with `--` was encountered that is not in the recognized option list (e.g. `--json`, `--observations`). Unrecognized long flags are rejected to catch typos early.","triggerScenarios":"Passing any `--flag` not handled by the switch in `parseCapabilitiesArgs`, e.g. `omx capabilities list --verbose` or `--format`.","commonSituations":"Assuming generic flags like `--verbose`, `--quiet`, or `--format` exist; flags renamed between versions; copy-paste from other tools' syntax.","solutions":["Run with --help to see the supported options for the subcommand","Remove or correct the unsupported flag","Check for a renamed flag in the changelog if the option used to exist"],"exampleFix":"# before\nomx capabilities list --format json\n\n# after\nomx capabilities list --json","handlingStrategy":"validation","validationCode":"const KNOWN_OPTS = new Set(['--json', '--observations']); // sync with parseCapabilitiesArgs\nfor (const a of args) {\n  if (a.startsWith('--') && !KNOWN_OPTS.has(a)) {\n    console.error(`Unsupported option: ${a}`);\n    process.exit(1);\n  }\n}","typeGuard":null,"tryCatchPattern":"try {\n  await capabilitiesCommand(args);\n} catch (e) {\n  if ((e as Error).message.startsWith('Unknown capabilities option')) { /* warn and strip the flag */ }\n  else throw e;\n}","preventionTips":["Validate flags against the current CLI's help output in script CI","Avoid assuming generic flags like --verbose exist"],"tags":["cli","argument-validation","unknown-option"],"backgroundTag":"unknown-cli-option","analyzedSha":"3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2","analyzedAt":"2026-08-27T22:18:39.783Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}