{"record":{"id":"f397bde89b7c0866","repo":"Yeachan-Heo/oh-my-codex","slug":"unknown-capabilities-subcommand-parsed-subcomma","errorCode":null,"errorMessage":"Unknown capabilities subcommand: ${parsed.subcommand}","messagePattern":"Unknown capabilities subcommand: (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/cli/capabilities.ts","lineNumber":73,"sourceCode":"        })),\n      };\n      printResult(result, parsed.json);\n      return;\n    }\n    case \"check\": {\n      const result = await checkCapabilitiesPreflight({\n        cwd,\n        lockfilePath: lockfile,\n        observationsPath: parsed.observations,\n        requireObservations: parsed.requireObservations,\n        strictExternalSchemas: parsed.strictExternalSchemas,\n      });\n      printResult(result, parsed.json);\n      if (!result.ok) process.exitCode = 1;\n      return;\n    }\n    default:\n      throw new Error(`Unknown capabilities subcommand: ${parsed.subcommand}`);\n  }\n}\n\nfunction parseCapabilitiesArgs(args: string[]): ParsedCapabilitiesArgs {\n  const parsed: ParsedCapabilitiesArgs = {\n    subcommand: args[0],\n    requireObservations: false,\n    strictExternalSchemas: false,\n    json: false,\n    help: false,\n  };\n  for (let index = 0; index < args.length; index += 1) {\n    const arg = args[index];\n    switch (arg) {\n      case \"--help\":\n      case \"-h\":\n        parsed.help = true;\n        break;","sourceCodeStart":55,"sourceCodeEnd":91,"githubUrl":"https://github.com/Yeachan-Heo/oh-my-codex/blob/3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2/src/cli/capabilities.ts#L55-L91","documentation":"The `capabilities` CLI command only accepts a fixed set of subcommands, and the first positional argument did not match any of them. The switch over `parsed.subcommand` fell through to the default branch and threw.","triggerScenarios":"Running `omx capabilities <unknown>` where the first arg is not one of the supported subcommands (e.g. `list`, `get`, `check` per the switch), including misspellings or empty/undefined subcommand in some shells.","commonSituations":"Typos in subcommand names, using a subcommand from a different/newer version, or copy-pasting commands from outdated documentation.","solutions":["Run `omx capabilities --help` to list valid subcommands","Fix the typo in the subcommand name","Upgrade the CLI if the docs reference a subcommand your version lacks"],"exampleFix":"# before\nomx capabilities lst\n\n# after\nomx capabilities list","handlingStrategy":"validation","validationCode":"const KNOWN = new Set(['list', 'get', 'check']); // sync with switch cases in capabilities.ts\nconst sub = args[0];\nif (!sub || !KNOWN.has(sub)) {\n  console.error(`Unknown capabilities subcommand. Valid: ${[...KNOWN].join(', ')}`);\n  process.exit(1);\n}","typeGuard":"function isCapabilitiesSubcommand(s: string | undefined): s is 'list' | 'get' | 'check' {\n  return !!s && ['list', 'get', 'check'].includes(s);\n}","tryCatchPattern":"try {\n  await capabilitiesCommand(args);\n} catch (e) {\n  if ((e as Error).message.startsWith('Unknown capabilities subcommand')) { /* show help */ }\n  else throw e;\n}","preventionTips":["Keep subcommand lists in sync with the CLI's switch statement","Run with --help during development instead of guessing subcommands"],"tags":["cli","argument-validation","capabilities"],"backgroundTag":"unknown-cli-subcommand","analyzedSha":"3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2","analyzedAt":"2026-08-27T22:18:39.783Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}