{"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":"exception","errorClass":"Error","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/01e15490f04e29cfefe3896951f43db46994d8ee/scripts/setup.js#L430-L466","documentation":"Thrown by setup.js in needsConfirmation flow when the run is non-interactive (no TTY) but --yes was not passed. A non-interactive run cannot answer the confirmation prompt, so setup aborts rather than guessing consent for a filesystem-mutating operation.","triggerScenarios":"Running setup with all required flags in CI but forgetting --yes; piping input that makes stdin non-TTY; running under cron/systemd.","commonSituations":"Automated install pipelines; Docker build steps; any harness that does not allocate a terminal.","solutions":["Add `--yes` to skip confirmation in non-interactive runs.","Add `--dry-run` first to preview the planned changes.","Provide a TTY if you genuinely want the interactive confirmation."],"exampleFix":"# before\nnode scripts/setup.js --mode claude-plugin --scope user --hooks standard\n# after\nnode scripts/setup.js --mode claude-plugin --scope user --hooks standard --yes","handlingStrategy":"validation","validationCode":"if (!process.stdin.isTTY && !process.argv.includes('--yes') && !process.argv.includes('--dry-run')) {\n  console.error('Non-interactive run requires --yes');\n  process.exit(2);\n}","typeGuard":"function isInteractive() { return Boolean(process.stdin.isTTY); }","tryCatchPattern":"try { await confirm(options, terminal); } catch (err) { console.error(err.message); process.exit(2); }","preventionTips":["Always pass --yes (or --dry-run) in non-interactive automation.","Run --dry-run first in CI to preview before the real mutation."],"tags":["cli","tty","setup","automation","safety"],"backgroundTag":null,"analyzedSha":"01e15490f04e29cfefe3896951f43db46994d8ee","analyzedAt":"2026-08-13T00:31:08.655Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}