{"record":{"id":"8ba44bb754ff9385","repo":"Yeachan-Heo/oh-my-codex","slug":"unknown-list-option-unknown-0","errorCode":null,"errorMessage":"unknown list option: ${unknown[0]}","messagePattern":"unknown list option: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"src/cli/list.ts","lineNumber":37,"sourceCode":"  console.log(\n    `Skills: ${contract.counts.skillCount} (${contract.counts.activeSkillCount} active)`,\n  );\n  for (const skill of contract.skills) console.log(formatEntry(skill));\n  console.log(\n    `Agents: ${contract.counts.promptCount} (${contract.counts.activeAgentCount} active)`,\n  );\n  for (const agent of contract.agents) console.log(formatEntry(agent));\n}\n\nexport async function listCommand(args: string[]): Promise<void> {\n  if (args.includes(\"--help\") || args.includes(\"-h\")) {\n    console.log(LIST_USAGE);\n    return;\n  }\n\n  const unknown = args.filter((arg) => arg !== \"--json\");\n  if (unknown.length > 0) {\n    throw new Error(`unknown list option: ${unknown[0]}`);\n  }\n\n  const manifest = readCatalogManifest();\n  const contract = toPublicCatalogContract(manifest);\n\n  if (args.includes(\"--json\")) {\n    console.log(JSON.stringify(contract));\n    return;\n  }\n\n  printHumanList(contract);\n}\n","sourceCodeStart":19,"sourceCodeEnd":50,"githubUrl":"https://github.com/Yeachan-Heo/oh-my-codex/blob/3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2/src/cli/list.ts#L19-L50","documentation":"The `list` subcommand accepts only the --json flag (and no arguments). Any other token in argv is rejected with `unknown list option: <token>` before the catalog manifest is read.","triggerScenarios":"Running listCommand with anything besides an empty array or ['--json'], e.g. `list --all`, `list foo`, `list --json --verbose`, or a positional argument.","commonSituations":"Copy-pasting flags from another CLI version or different subcommand; shell aliases appending flags; scripts written against an older/newer interface; assuming a --help or filter flag exists.","solutions":["Remove the unsupported flag/argument and re-run with just `list` or `list --json`","Check LIST_USAGE (printed with no args or help) for the supported surface","If filtering is needed, pipe JSON output through jq instead of CLI flags","Pin scripts to a version whose interface matches your expectations"],"exampleFix":"# before\nmycli list --all\n\n# after\nmycli list --json | jq '.[] | select(.active)'","handlingStrategy":"validation","validationCode":"const args = process.argv.slice(2);\nconst unknown = args.filter((a) => a !== \"--json\");\nif (unknown.length > 0) {\n  console.error(`Unsupported list option: ${unknown[0]}`);\n  process.exit(2);\n}\nawait listCommand(args);","typeGuard":"function isValidListArgs(args: readonly string[]): boolean {\n  return args.every((a) => a === \"--json\");\n}","tryCatchPattern":"try { await listCommand(args); }\ncatch (e) { if (/unknown list option/.test(String(e))) { console.error('Usage: list [--json]'); process.exit(2); } throw e; }","preventionTips":["Pin CLI versions used in scripts","Parse --json output with jq instead of adding CLI flags"],"tags":["cli","argument-validation","usage"],"backgroundTag":"invalid-cli-argument","analyzedSha":"3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2","analyzedAt":"2026-08-27T22:18:39.783Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}