{"record":{"id":"64a295e933251f24","repo":"Yeachan-Heo/oh-my-codex","slug":"missing-setup-install-mode-value-after-install-m","errorCode":null,"errorMessage":"Missing setup install mode value after --install-mode. Expected one of: legacy, plugin","messagePattern":"Missing setup install mode value after --install-mode\\. Expected one of: legacy, plugin","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/cli/index.ts","lineNumber":593,"sourceCode":"      );\n    }\n    value = next;\n  };\n\n  for (let index = 0; index < args.length; index += 1) {\n    const arg = args[index];\n    if (arg === \"--plugin\") {\n      setValue(\"plugin\", arg);\n      continue;\n    }\n    if (arg === \"--legacy\") {\n      setValue(\"legacy\", arg);\n      continue;\n    }\n    if (arg === \"--install-mode\") {\n      const next = args[index + 1];\n      if (!next || next.startsWith(\"-\")) {\n        throw new Error(\n          `Missing setup install mode value after --install-mode. Expected one of: legacy, plugin`,\n        );\n      }\n      if (next !== \"legacy\" && next !== \"plugin\") {\n        throw new Error(\n          `Invalid setup install mode: ${next}. Expected one of: legacy, plugin`,\n        );\n      }\n      setValue(next, arg);\n      index += 1;\n      continue;\n    }\n    if (arg.startsWith(\"--install-mode=\")) {\n      const next = arg.slice(\"--install-mode=\".length);\n      if (next !== \"legacy\" && next !== \"plugin\") {\n        throw new Error(\n          `Invalid setup install mode: ${next}. Expected one of: legacy, plugin`,\n        );","sourceCodeStart":575,"sourceCodeEnd":611,"githubUrl":"https://github.com/Yeachan-Heo/oh-my-codex/blob/3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2/src/cli/index.ts#L575-L611","documentation":"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).","triggerScenarios":"`omx setup --install-mode` at end of args, or `--install-mode --scope project`.","commonSituations":"Truncated commands, shell history editing, or scripts conditionally appending the value that ends up empty.","solutions":["Append a valid value: `--install-mode legacy` or `--install-mode plugin`","Use the inline form `--install-mode=plugin`"],"exampleFix":"# before\nomx setup --install-mode\n# after\nomx setup --install-mode=plugin","handlingStrategy":"validation","validationCode":"if (args.includes('--install-mode')) {\n  const i = args.indexOf('--install-mode');\n  const v = args[i + 1];\n  if (!v || v.startsWith('-')) throw new Error('missing value');\n}","typeGuard":"const isSetupInstallMode = (v: unknown): v is 'legacy' | 'plugin' => v === 'legacy' || v === 'plugin';","tryCatchPattern":null,"preventionTips":["Prefer --install-mode=plugin inline form","Build argv with a helper that pairs flags with values"],"tags":["cli","missing-argument","setup"],"backgroundTag":"missing-cli-argument-value","analyzedSha":"3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2","analyzedAt":"2026-08-27T22:18:39.783Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}