Yeachan-Heo/oh-my-codex · error · Error
Unknown adapt subcommand: ${subcommand}. Supported subcomman
Error message
Unknown adapt subcommand: ${subcommand}. Supported subcommands: ${ADAPT_SUBCOMMANDS.join(", ")} What it means
The adapt subcommand (second positional) is not one of ADAPT_SUBCOMMANDS (init, probe, etc.). The message lists the accepted subcommands. This guards the switch that dispatches to per-subcommand handlers.
Source
Thrown at src/cli/adapt.ts:156
}
stdout(targetHelp(descriptor.target));
return;
}
const descriptor = getAdaptTargetDescriptor(target);
if (!descriptor) {
throw new Error(
`Unknown adapt target: ${target}. Supported targets: ${supportedAdaptTargets().join(", ")}`,
);
}
if (!subcommand) {
stdout(targetHelp(descriptor.target));
return;
}
if (!ADAPT_SUBCOMMANDS.includes(subcommand as AdaptSubcommand)) {
throw new Error(
`Unknown adapt subcommand: ${subcommand}. Supported subcommands: ${ADAPT_SUBCOMMANDS.join(", ")}`,
);
}
if (write && subcommand !== "init") {
throw new Error("--write is only supported with omx adapt <target> init");
}
switch (subcommand as AdaptSubcommand) {
case "probe":
render(
await buildAdaptProbeReportForTarget(cwd, descriptor.target),
json,
stdout,
);
return;
case "status":
render(View on GitHub (pinned to 3ad79a8a6f)
Solutions
- Use one of the subcommands listed in the message (typically `init` or `probe`)
- Put flags before positionals as documented
- Run `omx adapt <target>` alone to see target help
Example fix
# before omx adapt github create # after omx adapt github init
Defensive patterns
Strategy: validation
Validate before calling
const ADAPT_SUBCOMMANDS = ['init', 'probe'];
if (!ADAPT_SUBCOMMANDS.includes(subcommand)) {
console.error(`subcommand must be one of: ${ADAPT_SUBCOMMANDS.join(', ')}`);
process.exit(2);
} Type guard
const isAdaptSubcommand = (s: string): s is AdaptSubcommand => ADAPT_SUBCOMMANDS.includes(s as AdaptSubcommand);
Prevention
- Use only documented subcommands
- Put flags before positionals
- Re-check subcommands after CLI upgrades
When it happens
Trigger: Running e.g. `omx adapt github crate` or `omx adapt github --check` (a flag mistaken for a subcommand).
Common situations: Typos, guessing subcommand names, or passing unsupported flags that the parser treats as the subcommand positional.
Related errors
- Unknown adapt argument: ${arg}
- Unknown adapt target: ${target}. Supported targets: ${suppor
- --write is only supported with omx adapt <target> init
- agents-init accepts at most one path argument.\n${AGENTS_INI
- ${token} requires a value. ${SPARKSHELL_USAGE}
AI-assisted analysis of Yeachan-Heo/oh-my-codex@3ad79a8a6f (2026-08-27).
Data as JSON: /api/errors/6d7bdf57feeae5e3.
Report an issue: GitHub.