Yeachan-Heo/oh-my-codex · error · Error
Missing setup install mode value after --install-mode. Expec
Error message
Missing setup install mode value after --install-mode. Expected one of: legacy, plugin
What it means
The --install-mode flag requires a following value (legacy or plugin). The error fires when --install-mode is the last argument or the next token starts with `-` (looks like another flag).
Source
Thrown at src/cli/index.ts:593
);
}
value = next;
};
for (let index = 0; index < args.length; index += 1) {
const arg = args[index];
if (arg === "--plugin") {
setValue("plugin", arg);
continue;
}
if (arg === "--legacy") {
setValue("legacy", arg);
continue;
}
if (arg === "--install-mode") {
const next = args[index + 1];
if (!next || next.startsWith("-")) {
throw new Error(
`Missing setup install mode value after --install-mode. Expected one of: legacy, plugin`,
);
}
if (next !== "legacy" && next !== "plugin") {
throw new Error(
`Invalid setup install mode: ${next}. Expected one of: legacy, plugin`,
);
}
setValue(next, arg);
index += 1;
continue;
}
if (arg.startsWith("--install-mode=")) {
const next = arg.slice("--install-mode=".length);
if (next !== "legacy" && next !== "plugin") {
throw new Error(
`Invalid setup install mode: ${next}. Expected one of: legacy, plugin`,
);View on GitHub (pinned to 3ad79a8a6f)
Solutions
- Append a valid value: `--install-mode legacy` or `--install-mode plugin`
- Use the inline form `--install-mode=plugin`
Example fix
# before omx setup --install-mode # after omx setup --install-mode=plugin
Defensive patterns
Strategy: validation
Validate before calling
if (args.includes('--install-mode')) {
const i = args.indexOf('--install-mode');
const v = args[i + 1];
if (!v || v.startsWith('-')) throw new Error('missing value');
} Type guard
const isSetupInstallMode = (v: unknown): v is 'legacy' | 'plugin' => v === 'legacy' || v === 'plugin';
Prevention
- Prefer --install-mode=plugin inline form
- Build argv with a helper that pairs flags with values
When it happens
Trigger: `omx setup --install-mode` at end of args, or `--install-mode --scope project`.
Common situations: Truncated commands, shell history editing, or scripts conditionally appending the value that ends up empty.
Related errors
- Missing setup scope value after --scope. Expected one of: ${
- Usage: omx auth add <slot> [--device-auth|--with-api-key|--w
- Usage: omx auth use <slot>
- Missing --task.
- Missing --handoff-json.
AI-assisted analysis of Yeachan-Heo/oh-my-codex@3ad79a8a6f (2026-08-27).
Data as JSON: /api/errors/64a295e933251f24.
Report an issue: GitHub.