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

  1. Read the help text included in the error message and use a listed subcommand (help, start, status, next, advance)
  2. Check for typos in the subcommand (e.g. 'stat' vs 'status')
  3. 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

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


AI-assisted analysis of Yeachan-Heo/oh-my-codex@3ad79a8a6f (2026-08-27). Data as JSON: /api/errors/1ee92f00d3bae746. Report an issue: GitHub.