{"record":{"id":"c66c33a423fbfadd","repo":"affaan-m/ECC","slug":"unknown-command-options-command","errorCode":null,"errorMessage":"Unknown command: ${options.command}","messagePattern":"Unknown command: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scripts/github-coordination.js","lineNumber":152,"sourceCode":"    if (!options.issueNumber) throw new Error('Missing issue number.');\n    return applyValidate(options.repo, options.issueNumber, base, { store, policy, rootDir });\n  }\n  if (options.command === 'publish') {\n    if (!options.issueNumber) throw new Error('Missing issue number.');\n    return applyPublish(options.repo, options.issueNumber, base, { store, policy, rootDir });\n  }\n  if (options.command === 'review') {\n    if (!options.issueNumber) throw new Error('Missing issue number.');\n    return applyReview(options.repo, options.issueNumber, { ...base, review: options.review }, { store, policy, rootDir });\n  }\n  if (options.command === 'unblock') {\n    return applyUnblock(options.repo, { ...base, limit: options.limit }, { store, policy, rootDir });\n  }\n  if (options.command === 'decompose') {\n    if (!options.issueNumber) throw new Error('Missing issue number.');\n    return applyDecompose(options.repo, options.issueNumber, base, { store, policy, rootDir });\n  }\n  throw new Error(`Unknown command: ${options.command}`);\n}\n\nfunction formatOutput(payload, options) {\n  if (options.json) {\n    process.stdout.write(`${JSON.stringify(payload, null, 2)}\\n`);\n  } else if (options.command === 'sync' || options.command === 'unblock') {\n    process.stdout.write(formatCollection(payload));\n  } else {\n    process.stdout.write(formatSummary(payload));\n  }\n}\n\nasync function main() {\n  let store = null;\n  try {\n    const options = parseArgs(process.argv);\n    if (options.help) usage(0);\n    if (!options.repo) throw new Error('Missing --repo <owner/repo>.');","sourceCodeStart":134,"sourceCodeEnd":170,"githubUrl":"https://github.com/affaan-m/ECC/blob/01e15490f04e29cfefe3896951f43db46994d8ee/scripts/github-coordination.js#L134-L170","documentation":"Thrown by dispatchCommand() in scripts/github-coordination.js as the final fallthrough when options.command does not match any of the known commands (claim, sync, validate, publish, review, unblock, decompose). This is the catch-all for completely unrecognized subcommands.","triggerScenarios":"Running `node scripts/github-coordination.js frobnicate --repo owner/repo` where 'frobnicate' is not a recognized command. The default command is 'sync', but any explicitly-set unknown command reaches this throw.","commonSituations":"Typo in the subcommand name, using a command from a different version or tool, or a command that was removed/renamed. Note: if no command is given, it defaults to 'sync', so this only fires when an explicit but invalid command string is passed.","solutions":["Run `node scripts/github-coordination.js --help` to list valid commands.","Check the command name spelling.","If you omitted the command entirely and got this, verify --help shows the default is 'sync'."],"exampleFix":"// before\nnode scripts/github-coordination.js sycn --repo owner/repo\n// after\nnode scripts/github-coordination.js sync --repo owner/repo","handlingStrategy":"validation","validationCode":"const VALID_COMMANDS = ['claim', 'sync', 'validate', 'publish', 'review', 'unblock', 'decompose'];\nif (options.command && !VALID_COMMANDS.includes(options.command)) {\n  console.error(`Unknown command: ${options.command}. Valid: ${VALID_COMMANDS.join(', ')}`);\n  process.exit(1);\n}","typeGuard":"function isValidCommand(cmd) {\n  return ['claim', 'sync', 'validate', 'publish', 'review', 'unblock', 'decompose'].includes(cmd);\n}","tryCatchPattern":null,"preventionTips":["Check --help for the list of valid commands.","Validate the command before passing it through from automation.","Include the valid command list in the error message for self-service debugging."],"tags":["cli","github","argument-parsing","user-input"],"backgroundTag":null,"analyzedSha":"01e15490f04e29cfefe3896951f43db46994d8ee","analyzedAt":"2026-08-13T00:31:08.655Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}