{"record":{"id":"8ee2aa7c4296939a","repo":"Yeachan-Heo/oh-my-codex","slug":"invalid-setup-install-mode-next-expected-one","errorCode":null,"errorMessage":"Invalid setup install mode: ${next}. Expected one of: legacy, plugin","messagePattern":"Invalid setup install mode: (.+?)\\. Expected one of: legacy, plugin","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/cli/index.ts","lineNumber":598,"sourceCode":"  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        );\n      }\n      setValue(next, \"--install-mode\");\n    }\n  }\n","sourceCodeStart":580,"sourceCodeEnd":616,"githubUrl":"https://github.com/Yeachan-Heo/oh-my-codex/blob/3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2/src/cli/index.ts#L580-L616","documentation":"The value after --install-mode must be exactly `legacy` or `plugin`; anything else is rejected. This is a typo/validation guard for the install mode enum.","triggerScenarios":"`--install-mode plugins`, `--install-mode Legacy` (wrong case/typo), or any other string.","commonSituations":"Misspelling, wrong casing, or assuming a mode name from a different version of the tool.","solutions":["Correct the value to `legacy` or `plugin` (lowercase)","Check the CLI help for supported install modes in your version"],"exampleFix":"# before\nomx setup --install-mode Plugins\n# after\nomx setup --install-mode plugin","handlingStrategy":"validation","validationCode":"const INSTALL_MODES = ['legacy', 'plugin'];\nconst v = args[args.indexOf('--install-mode') + 1];\nif (!INSTALL_MODES.includes(v)) throw new Error(`invalid mode: ${v}`);","typeGuard":"const isSetupInstallMode = (v: string): v is 'legacy' | 'plugin' => ['legacy','plugin'].includes(v);","tryCatchPattern":null,"preventionTips":["Lowercase mode names","Check CLI help for the enum"],"tags":["cli","invalid-value","enum-validation","setup"],"backgroundTag":"invalid-cli-flag-value","analyzedSha":"3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2","analyzedAt":"2026-08-27T22:18:39.783Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}