openai/codex-plugin-cc · error · Error
Unknown subcommand: ${subcommand}
Error message
Unknown subcommand: ${subcommand} What it means
main() dispatches on the first positional (subcommand) across a fixed switch: setup, review, adversarial-review, task, transfer, task-worker, status, result, task-resume-candidate, cancel. The default case throws Unknown subcommand with the offending value. The top-level catch prints the message to stderr and sets exitCode 1. 'help'/'--help' are handled before the switch.
Source
Thrown at plugins/codex/scripts/codex-companion.mjs:1065
await handleTransfer(argv);
break;
case "task-worker":
await handleTaskWorker(argv);
break;
case "status":
await handleStatus(argv);
break;
case "result":
handleResult(argv);
break;
case "task-resume-candidate":
handleTaskResumeCandidate(argv);
break;
case "cancel":
await handleCancel(argv);
break;
default:
throw new Error(`Unknown subcommand: ${subcommand}`);
}
}
main().catch((error) => {
const message = error instanceof Error ? error.message : String(error);
process.stderr.write(`${message}\n`);
process.exitCode = 1;
});
View on GitHub (pinned to db52e28f4d)
Solutions
- Run with no args or 'help' to printUsage and see the valid subcommands.
- Correct the typo to one of: setup, review, adversarial-review, task, transfer, status, result, cancel, task-worker, task-resume-candidate.
- Update any wrapper or alias referencing a renamed command.
Example fix
// before codex-companion.mjs revew // after codex-companion.mjs review
Defensive patterns
Strategy: validation
Validate before calling
const KNOWN = new Set(['setup','review','adversarial-review','task','transfer','task-worker','status','result','task-resume-candidate','cancel']);
if (!KNOWN.has(subcommand)) { printUsage(); process.exit(2); } Type guard
/** @param {string} s @returns {boolean} */
function isKnownSubcommand(s) { return KNOWN.has(s); } Prevention
- Run 'help' to list subcommands when unsure.
- Keep wrappers in sync with the current command set.
When it happens
Trigger: Typing `codex-companion.mjs revew`, an unsupported verb, or passing a flag as the first positional so it becomes the subcommand.
Common situations: Typo, outdated docs referencing a renamed subcommand, or a wrapper that forwards an unexpected token.
Related errors
- Usage: node scripts/app-server-broker.mjs serve --endpoint <
- Missing required --endpoint.
- `/codex:review` now maps directly to the built-in reviewer a
- `status --wait` requires a job id.
- Missing version.\n\n${usage()}
AI-assisted analysis of openai/codex-plugin-cc@db52e28f4d (2026-08-13).
Data as JSON: /api/errors/4e10e9bda231e279.
Report an issue: GitHub.