affaan-m/ECC · error · Error

Unknown command: ${options.command}

Error message

Unknown command: ${options.command}

What it means

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.

Source

Thrown at scripts/github-coordination.js:152

    if (!options.issueNumber) throw new Error('Missing issue number.');
    return applyValidate(options.repo, options.issueNumber, base, { store, policy, rootDir });
  }
  if (options.command === 'publish') {
    if (!options.issueNumber) throw new Error('Missing issue number.');
    return applyPublish(options.repo, options.issueNumber, base, { store, policy, rootDir });
  }
  if (options.command === 'review') {
    if (!options.issueNumber) throw new Error('Missing issue number.');
    return applyReview(options.repo, options.issueNumber, { ...base, review: options.review }, { store, policy, rootDir });
  }
  if (options.command === 'unblock') {
    return applyUnblock(options.repo, { ...base, limit: options.limit }, { store, policy, rootDir });
  }
  if (options.command === 'decompose') {
    if (!options.issueNumber) throw new Error('Missing issue number.');
    return applyDecompose(options.repo, options.issueNumber, base, { store, policy, rootDir });
  }
  throw new Error(`Unknown command: ${options.command}`);
}

function formatOutput(payload, options) {
  if (options.json) {
    process.stdout.write(`${JSON.stringify(payload, null, 2)}\n`);
  } else if (options.command === 'sync' || options.command === 'unblock') {
    process.stdout.write(formatCollection(payload));
  } else {
    process.stdout.write(formatSummary(payload));
  }
}

async function main() {
  let store = null;
  try {
    const options = parseArgs(process.argv);
    if (options.help) usage(0);
    if (!options.repo) throw new Error('Missing --repo <owner/repo>.');

View on GitHub (pinned to 01e15490f0)

Solutions

  1. Run `node scripts/github-coordination.js --help` to list valid commands.
  2. Check the command name spelling.
  3. If you omitted the command entirely and got this, verify --help shows the default is 'sync'.

Example fix

// before
node scripts/github-coordination.js sycn --repo owner/repo
// after
node scripts/github-coordination.js sync --repo owner/repo
Defensive patterns

Strategy: validation

Validate before calling

const VALID_COMMANDS = ['claim', 'sync', 'validate', 'publish', 'review', 'unblock', 'decompose'];
if (options.command && !VALID_COMMANDS.includes(options.command)) {
  console.error(`Unknown command: ${options.command}. Valid: ${VALID_COMMANDS.join(', ')}`);
  process.exit(1);
}

Type guard

function isValidCommand(cmd) {
  return ['claim', 'sync', 'validate', 'publish', 'review', 'unblock', 'decompose'].includes(cmd);
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of affaan-m/ECC@01e15490f0 (2026-08-13). Data as JSON: /api/errors/c66c33a423fbfadd. Report an issue: GitHub.