affaan-m/ECC · error · Error

Invalid setup mode: ${options.mode}. This command currently

Error message

Invalid setup mode: ${options.mode}. This command currently supports ${MODE}.

What it means

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.

Source

Thrown at scripts/setup.js:104

      options[valueFlags.get(argument)] = value;
      index += 1;
    } else if (argument === '--yes' || argument === '-y') {
      options.yes = true;
    } else if (argument === '--dry-run') {
      options.dryRun = true;
    } else if (argument === '--move-scope') {
      options.moveScope = true;
    } else if (argument === '--json') {
      options.json = true;
    } else if (argument === '--help' || argument === '-h') {
      options.help = true;
    } else {
      throw new Error(`Unknown argument: ${argument}`);
    }
  }

  if (options.mode !== undefined && options.mode !== MODE) {
    throw new Error(`Invalid setup mode: ${options.mode}. This command currently supports ${MODE}.`);
  }
  if (options.scope !== undefined && !VALID_SCOPES.has(options.scope)) {
    throw new Error(`Invalid --scope value: ${options.scope}`);
  }
  if (options.hooks !== undefined && !VALID_HOOK_MODES.has(options.hooks)) {
    throw new Error(`Invalid --hooks value: ${options.hooks}`);
  }
  if (options.moveScope && options.scope === undefined) {
    throw new Error('--move-scope requires an explicit --scope destination.');
  }
  return options;
}

function questionWithCancellation(terminal, prompt) {
  return new Promise((resolve, reject) => {
    let settled = false;
    const finish = callback => value => {
      if (settled) return;

View on GitHub (pinned to 01e15490f0)

Solutions

  1. Use `--mode claude-plugin` (the only supported mode).
  2. If you do not need to override, omit --mode entirely.
  3. Check release notes for newly added modes before assuming this list is exhaustive.

Example fix

# before
node scripts/setup.js --mode global --yes
# after
node scripts/setup.js --mode claude-plugin --yes
Defensive patterns

Strategy: validation

Validate before calling

const SUPPORTED_MODES = new Set(['claude-plugin']);
const mode = (process.argv.find(a => a.startsWith('--mode')) || '').split('=')[1];
if (mode !== undefined && !SUPPORTED_MODES.has(mode)) { console.error(`Unsupported mode: ${mode}`); process.exit(2); }

Type guard

function isSupportedMode(v) { return v === undefined || v === 'claude-plugin'; }

Try / catch

try { parseArgs(process.argv); } catch (err) { console.error(err.message); process.exit(2); }

Prevention

When it happens

Trigger: Passing `--mode local`, `--mode global`, `--mode npm`, or any value other than 'claude-plugin'.

Common situations: 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.

Related errors


AI-assisted analysis of affaan-m/ECC@01e15490f0 (2026-08-13). Data as JSON: /api/errors/913238b7b0040a03. Report an issue: GitHub.