{"record":{"id":"913238b7b0040a03","repo":"affaan-m/ECC","slug":"invalid-setup-mode-options-mode-this-command","errorCode":null,"errorMessage":"Invalid setup mode: ${options.mode}. This command currently supports ${MODE}.","messagePattern":"Invalid setup mode: (.+?)\\. This command currently supports (.+?)\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"scripts/setup.js","lineNumber":104,"sourceCode":"      options[valueFlags.get(argument)] = value;\n      index += 1;\n    } else if (argument === '--yes' || argument === '-y') {\n      options.yes = true;\n    } else if (argument === '--dry-run') {\n      options.dryRun = true;\n    } else if (argument === '--move-scope') {\n      options.moveScope = true;\n    } else if (argument === '--json') {\n      options.json = true;\n    } else if (argument === '--help' || argument === '-h') {\n      options.help = true;\n    } else {\n      throw new Error(`Unknown argument: ${argument}`);\n    }\n  }\n\n  if (options.mode !== undefined && options.mode !== MODE) {\n    throw new Error(`Invalid setup mode: ${options.mode}. This command currently supports ${MODE}.`);\n  }\n  if (options.scope !== undefined && !VALID_SCOPES.has(options.scope)) {\n    throw new Error(`Invalid --scope value: ${options.scope}`);\n  }\n  if (options.hooks !== undefined && !VALID_HOOK_MODES.has(options.hooks)) {\n    throw new Error(`Invalid --hooks value: ${options.hooks}`);\n  }\n  if (options.moveScope && options.scope === undefined) {\n    throw new Error('--move-scope requires an explicit --scope destination.');\n  }\n  return options;\n}\n\nfunction questionWithCancellation(terminal, prompt) {\n  return new Promise((resolve, reject) => {\n    let settled = false;\n    const finish = callback => value => {\n      if (settled) return;","sourceCodeStart":86,"sourceCodeEnd":122,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/scripts/setup.js#L86-L122","documentation":"parseArgs throws this when --mode is provided with a value other than the single supported mode 'claude-plugin' (MODE constant). The setup command currently only implements one installation backend, so any other mode string is rejected explicitly with the supported value named in the message.","triggerScenarios":"Running `ecc setup --mode vite`, `ecc setup --mode claude`, or `--mode full` — any --mode value that is not exactly the string 'claude-plugin'.","commonSituations":"Copying examples from other tools that use --mode; guessing at mode names; older docs or blog posts referencing modes that were since consolidated; scripting that interpolates a wrong MODE variable.","solutions":["Use `--mode claude-plugin` exactly (the only supported value).","Omit --mode entirely; bare `ecc setup` is valid when a terminal is available.","Run `ecc setup --help` to confirm the supported mode."],"exampleFix":"// before\nnpm run setup -- --mode claude --scope project\n\n// after\nnpm run setup -- --mode claude-plugin --scope project","handlingStrategy":"validation","validationCode":"const MODE = 'claude-plugin';\nif (modeArg !== undefined && modeArg !== MODE) {\n  throw new Error(`Invalid setup mode: ${modeArg}. Supported: ${MODE}`);\n}","typeGuard":"const isClaudePluginMode = (v) => v === 'claude-plugin';","tryCatchPattern":"try {\n  await runSetup(rawArgs);\n} catch (err) {\n  if (/^Invalid setup mode: /.test(err.message)) {\n    console.error(err.message);\n    process.exitCode = 2;\n  } else throw err;\n}","preventionTips":["Hardcode --mode claude-plugin in scripts; it is the only supported value.","Grep your scripts for --mode values when upgrading tooling.","Prefer omitting --mode in interactive sessions."],"tags":["cli","enum","setup-mode"],"backgroundTag":"invalid-enum-value","analyzedSha":"8321021c54d670126ce3b2969d5deb880b4b0c2a","analyzedAt":"2026-09-16T10:08:13.343Z","contentChangedAt":"2026-09-16T10:08:13.343Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}