{"record":{"id":"fc44528b1f9a2ac1","repo":"affaan-m/ECC","slug":"non-interactive-setup-requires-yes","errorCode":null,"errorMessage":"Non-interactive setup requires --yes.","messagePattern":"Non-interactive setup requires --yes\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"scripts/setup.js","lineNumber":448,"sourceCode":"    }\n\n    if (interactiveDefaults) {\n      const confirmationAction = interactiveDefaults.multipleScopes\n        ? 'Resume migration'\n        : (\n          interactiveDefaults.installed && interactiveDefaults.scope !== options.scope\n            ? 'Migrate'\n            : 'Apply'\n        );\n      options = {\n        ...options,\n        confirmationAction,\n      };\n    }\n\n    if (needsConfirmation) {\n      if (!interactive) {\n        throw new Error('Non-interactive setup requires --yes.');\n      }\n      if (!terminal) {\n        terminal = readline.createInterface({\n          input: process.stdin,\n          output: process.stdout,\n        });\n      }\n      if (!await confirm(options, terminal)) {\n        printResult({\n          action: 'cancelled',\n          hooks: options.hooks || 'standard',\n          pluginId: 'ecc@ecc',\n          scope: options.scope || 'detected',\n        }, options.json);\n        return;\n      }\n    }\n","sourceCodeStart":430,"sourceCodeEnd":466,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/scripts/setup.js#L430-L466","documentation":"main throws this when the planned setup requires a confirmation (needsConfirmation is true) but the session is not interactive, and --yes was not passed. Confirmation normally happens via a readline prompt, which cannot run without a terminal, so non-interactive runs must pre-authorize with --yes.","triggerScenarios":"Running setup non-interactively (CI, piped stdio, no TTY) with flags that would change something, e.g. `ecc setup --mode claude-plugin --scope project` without --yes.","commonSituations":"CI pipelines forgetting the --yes flag; scripts where an earlier --dry-run was switched to a real run; automation that pipes setup output and thus disables interactivity.","solutions":["Add --yes (or -y) to the command: `ecc setup --mode claude-plugin --scope project --yes`.","Keep --dry-run in pipelines if changes should not be applied without review.","Run interactively in a TTY if you want the confirmation prompt instead."],"exampleFix":"// before\n# non-interactive CI\nnpx ecc setup --mode claude-plugin --scope project\n\n// after\nnpx ecc setup --mode claude-plugin --scope project --yes","handlingStrategy":"validation","validationCode":"const has = (f) => argv.includes(f);\nif (!has('--yes') && !has('--dry-run') && !process.stdout.isTTY) {\n  throw new Error('Non-interactive setup requires --yes.');\n}","typeGuard":"const isInteractive = () => Boolean(process.stdout.isTTY && process.stdin.isTTY);","tryCatchPattern":"try {\n  await runSetup(rawArgs);\n} catch (err) {\n  if (err.message.includes('Non-interactive setup requires --yes')) {\n    console.error(err.message);\n    process.exitCode = 2;\n  } else throw err;\n}","preventionTips":["Always add --yes to non-interactive mutation commands.","Keep --dry-run for CI verification runs that should not change state.","Review CI scripts after switching them from dry-run to real runs."],"tags":["cli","confirmation","non-interactive","ci"],"backgroundTag":"missing-required-flag","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"}