Yeachan-Heo/oh-my-codex · error · AutoresearchGoalError

Unknown autoresearch-goal command: ${command}\n\n${AUTORESEA

Error message

Unknown autoresearch-goal command: ${command}\n\n${AUTORESEARCH_GOAL_HELP}

What it means

autoresearchGoalCommand throws this AutoresearchGoalError for any subcommand it does not handle (help, handoff/start, verdict/checkpoint, complete, status are handled), appending AUTORESEARCH_GOAL_HELP. The error is caught in-command, printed as `[autoresearch-goal] ...`, and exit code 1 is set.

Source

Thrown at src/cli/autoresearch-goal.ts:173

      const slug = readValue(rest, '--slug');
      if (!slug) throw new AutoresearchGoalError('Missing --slug.');
      const mission = await readAutoresearchGoal(cwd, slug);
      const completion = await readAutoresearchGoalCompletion(cwd, slug);
      const snapshot = await readCodexGoalSnapshotInput(readValue(rest, '--codex-goal-json'), cwd);
      const reconciliation = reconcileAutoresearchCodexGoalSnapshot(snapshot, mission, {
        requireSnapshot: false,
        requireComplete: mission.status === 'complete',
      });
      if (json) printJson({ mission, completion, reconciliation });
      else {
        console.log(`autoresearch-goal: ${mission.slug} [${mission.status}] ${mission.topic}`);
        console.log(`completion: ${completion ? `${completion.verdict} (${completion.recorded_at})` : 'missing'}`);
        if (!reconciliation.ok || reconciliation.warnings.length) console.log(`codex goal warning: ${formatCodexGoalReconciliation(reconciliation)}`);
      }
      return;
    }

    throw new AutoresearchGoalError(`Unknown autoresearch-goal command: ${command}\n\n${AUTORESEARCH_GOAL_HELP}`);
  } catch (error) {
    if (error instanceof AutoresearchGoalError || error instanceof CodexGoalSnapshotError) {
      console.error(`[autoresearch-goal] ${error.message}`);
      process.exitCode = 1;
      return;
    }
    throw error;
  }
}

View on GitHub (pinned to 3ad79a8a6f)

Solutions

  1. Read the help text embedded in the error message for valid subcommands
  2. Fix typos (e.g. 'handof' → 'handoff')
  3. If you need to create goals, check other CLI modules or docs — creation may not be via this command

Example fix

// before
omx autoresearch-goal list
// after
omx autoresearch-goal help
Defensive patterns

Strategy: validation

Validate before calling

const KNOWN = ['help','handoff','start','verdict','checkpoint','complete','status'];
if (!KNOWN.includes(cmd)) { print(AUTORESEARCH_GOAL_HELP); process.exit(2); }

Type guard

const isGoalCmd = (c: string): c is 'help'|'handoff'|'start'|'verdict'|'checkpoint'|'complete'|'status' => ['help','handoff','start','verdict','checkpoint','complete','status'].includes(c);

Try / catch

try { await autoresearchGoalCommand(argv); } catch (e) { if (e instanceof AutoresearchGoalError && e.message.startsWith('Unknown autoresearch-goal command')) printHelpFromError(e); else throw e; }

Prevention

When it happens

Trigger: Running `omx autoresearch-goal <cmd>` with an unrecognized cmd such as 'list', 'create', 'delete', or a typo like 'handof'.

Common situations: Expecting goal-management subcommands (create/delete/list) that do not exist in this CLI, version drift where subcommands were renamed, or shell autocomplete suggesting wrong names.

Related errors


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