affaan-m/ECC · error · Error

Interactive --json mutations require --yes.

Error message

Interactive --json mutations require --yes.

What it means

Thrown by validateInteractiveJsonOptions when --json is used interactively with all choices supplied, but neither --yes nor --dry-run is set. JSON mutations in non-interactive/interactive JSON mode must be explicitly authorized to avoid silently changing the filesystem.

Source

Thrown at scripts/setup.js:358

}

function needsInteractiveChoices(options) {
  return (
    options.mode === undefined
    || options.scope === undefined
    || options.hooks === undefined
  );
}

function validateInteractiveJsonOptions(options, interactive) {
  if (!interactive || !options.json) return;
  if (needsInteractiveChoices(options)) {
    throw new Error(
      'Interactive --json requires explicit --mode, --scope, and --hooks values.'
    );
  }
  if (!options.yes && !options.dryRun) {
    throw new Error('Interactive --json mutations require --yes.');
  }
}

function reconcileClaudePlugin(options) {
  const setupOptions = {
    dryRun: options.dryRun,
    hooks: options.hooks,
    scope: options.scope,
  };
  if (options.moveScope) {
    return migrateClaudePluginScope(setupOptions);
  }

  try {
    return setupClaudePlugin(setupOptions);
  } catch (error) {
    const canAutoMigrate = (
      error instanceof ClaudeSetupError

View on GitHub (pinned to 01e15490f0)

Solutions

  1. Add `--yes` to authorize the mutation.
  2. Or add `--dry-run` to preview the JSON without writing.
  3. Run in a non-TTY (piped stdin) only if you also pass --yes per the non-interactive guard.

Example fix

# before
node scripts/setup.js --json --mode claude-plugin --scope user --hooks standard
# after
node scripts/setup.js --json --mode claude-plugin --scope user --hooks standard --yes
Defensive patterns

Strategy: validation

Validate before calling

const argv = process.argv.slice(2);
if (argv.includes('--json') && !argv.includes('--dry-run') && !argv.includes('--yes')) {
  console.error('Interactive --json mutations require --yes');
  process.exit(2);
}

Try / catch

try { validateInteractiveJsonOptions(options, interactive); } catch (err) { console.error(err.message); process.exit(2); }

Prevention

When it happens

Trigger: `node scripts/setup.js --json --mode claude-plugin --scope user --hooks standard` without --yes or --dry-run in a context flagged interactive.

Common situations: Setting up the full flag set for JSON output but forgetting the confirmation bypass; running in a TTY where 'interactive' is true by default.

Related errors


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