Yeachan-Heo/oh-my-codex · error · Error
Unknown adapt argument: ${arg}
Error message
Unknown adapt argument: ${arg} What it means
The `omx adapt` CLI argument parser encountered a positional or flag token it cannot assign: the first positional becomes the target, the second the subcommand, and any further positional argument falls through to this error. It signals a malformed command line such as three positionals or an unrecognized trailing token.
Source
Thrown at src/cli/adapt.ts:100
continue;
}
if (arg === "--write") {
write = true;
continue;
}
if (arg === "--help" || arg === "-h" || arg === "help") {
wantsHelp = true;
continue;
}
if (!target) {
target = arg;
continue;
}
if (!subcommand) {
subcommand = arg;
continue;
}
throw new Error(`Unknown adapt argument: ${arg}`);
}
return { target, subcommand, json, write, wantsHelp };
}
function render(
value: unknown,
json: boolean,
stdout: (line: string) => void,
): void {
stdout(JSON.stringify(value, null, json ? 0 : 2));
}
export interface AdaptCommandDependencies {
cwd?: string;
stdout?: (line: string) => void;
}
View on GitHub (pinned to 3ad79a8a6f)
Solutions
- Run `omx adapt --help` (or no args) to see the expected `adapt <target> <subcommand>` form
- Remove the extra positional or unsupported flag
- Check spelling of target and subcommand against the help output
Example fix
# before omx adapt github init extra # after omx adapt github init
Defensive patterns
Strategy: validation
Validate before calling
const valid = args.filter(a => !a.startsWith('-'));
if (valid.length > 2) {
console.error('usage: omx adapt <target> [subcommand]');
process.exit(2);
} Prevention
- Limit adapt invocations to at most two positional arguments
- Consult `omx adapt --help` before scripting
- Wrap CLI calls in scripts and validate exit codes
When it happens
Trigger: Running e.g. `omx adapt foo bar baz` (third positional), or passing an unknown flag/typo after the target and subcommand.
Common situations: Typos in subcommand names, copying a longer command from docs of a different version, or assuming a flag exists (e.g. --dry-run) that this CLI does not support.
Related errors
- Unknown adapt subcommand: ${subcommand}. Supported subcomman
- agents-init accepts at most one path argument.\n${AGENTS_INI
- ${token} requires a value. ${SPARKSHELL_USAGE}
- Missing command to run. ${SPARKSHELL_USAGE}
- Unknown adapt target: ${target}. Supported targets: ${suppor
AI-assisted analysis of Yeachan-Heo/oh-my-codex@3ad79a8a6f (2026-08-27).
Data as JSON: /api/errors/5dd89aa4deec8b6b.
Report an issue: GitHub.