{"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":"exception","errorClass":"Error","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/01e15490f04e29cfefe3896951f43db46994d8ee/scripts/setup.js#L86-L122","documentation":"Thrown by setup.js when --mode is provided but is not equal to MODE ('claude-plugin'). The setup command currently supports exactly one mode, so any other mode value is rejected before any filesystem or hook work happens.","triggerScenarios":"Passing `--mode local`, `--mode global`, `--mode npm`, or any value other than 'claude-plugin'.","commonSituations":"Assuming other ECC install modes exist (they are handled by different entry points); copy-pasting a mode from unrelated tooling; experimenting with modes that are not yet wired up.","solutions":["Use `--mode claude-plugin` (the only supported mode).","If you do not need to override, omit --mode entirely.","Check release notes for newly added modes before assuming this list is exhaustive."],"exampleFix":"# before\nnode scripts/setup.js --mode global --yes\n# after\nnode scripts/setup.js --mode claude-plugin --yes","handlingStrategy":"validation","validationCode":"const SUPPORTED_MODES = new Set(['claude-plugin']);\nconst mode = (process.argv.find(a => a.startsWith('--mode')) || '').split('=')[1];\nif (mode !== undefined && !SUPPORTED_MODES.has(mode)) { console.error(`Unsupported mode: ${mode}`); process.exit(2); }","typeGuard":"function isSupportedMode(v) { return v === undefined || v === 'claude-plugin'; }","tryCatchPattern":"try { parseArgs(process.argv); } catch (err) { console.error(err.message); process.exit(2); }","preventionTips":["Treat the supported-mode set as configuration the parser imports.","Fail early in wrappers when an unsupported mode is detected."],"tags":["cli","argument-parsing","setup","mode"],"backgroundTag":null,"analyzedSha":"01e15490f04e29cfefe3896951f43db46994d8ee","analyzedAt":"2026-08-13T00:31:08.655Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}