Yeachan-Heo/oh-my-codex · error · Error
Unknown autopilot command: ${command}\n${AUTOPILOT_HELP}
Error message
Unknown autopilot command: ${command}\n${AUTOPILOT_HELP} What it means
autopilotCommand throws this for any subcommand it does not recognize, appending the full AUTOPILOT_HELP text. Recognized subcommands are help/start/status/next/advance.
Source
Thrown at src/cli/autopilot.ts:160
if (command === 'advance') {
const to = value(rest, '--to');
if (to !== 'ralplan' && to !== 'ultragoal') throw new Error('--to must be ralplan or ultragoal.');
const rawHandoff = value(rest, '--handoff-json');
if (!rawHandoff) throw new Error('Missing --handoff-json.');
const handoff = await jsonInput(rawHandoff);
assertBoundHandoffIdentity(handoff, cwd, sessionId);
const updated = await updateAutopilotPipelineState({
...handoff,
active: true,
current_phase: to,
}, cwd, sessionId);
if (json) stdout(JSON.stringify({ ok: true, state: updated, instruction: instruction(updated) }));
else stdout(instruction(updated));
return;
}
throw new Error(`Unknown autopilot command: ${command}\n${AUTOPILOT_HELP}`);
}
View on GitHub (pinned to 3ad79a8a6f)
Solutions
- Read the help text included in the error message and use a listed subcommand (help, start, status, next, advance)
- Check for typos in the subcommand (e.g. 'stat' vs 'status')
- If you need a different lifecycle operation, check the project docs — it may live under another CLI module
Example fix
// before omx autopilot stat // after omx autopilot status
Defensive patterns
Strategy: validation
Validate before calling
const KNOWN = ['help','start','status','next','advance'];
if (!KNOWN.includes(cmd)) { print(AUTOPILOT_HELP); process.exit(2); } Type guard
const isAutopilotCmd = (c: string): c is 'help'|'start'|'status'|'next'|'advance' => ['help','start','status','next','advance'].includes(c);
Try / catch
try { await autopilotCommand(argv); } catch (e) { if (e.message.startsWith('Unknown autopilot command')) printHelpFromError(e); else throw e; } Prevention
- Validate subcommands before invoking in automation
- Parse the help text appended to the error for valid commands
When it happens
Trigger: Running `omx autopilot <cmd>` where cmd is not one of the handled branches — e.g. 'stop', 'resume', 'run', or a typo like 'stat'.
Common situations: Using subcommands from older versions or other tools, shell aliases, or expecting a stop/pause command that does not exist.
Related errors
- Unknown auth command: ${command}\n${AUTH_HELP.trim()}
- Missing value for ${flag}.
- --handoff-json must resolve to a JSON object.
- Autopilot handoff session_id does not match the selected ses
- Autopilot handoff workingDirectory does not match the select
AI-assisted analysis of Yeachan-Heo/oh-my-codex@3ad79a8a6f (2026-08-27).
Data as JSON: /api/errors/1ee92f00d3bae746.
Report an issue: GitHub.