{"record":{"id":"09008d36f808bf44","repo":"affaan-m/ECC","slug":"interactive-setup-requires-a-terminal-pass-mode","errorCode":null,"errorMessage":"Interactive setup requires a terminal. Pass --mode claude-plugin and the required flags.","messagePattern":"Interactive setup requires a terminal\\. Pass --mode claude-plugin and the required flags\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scripts/setup.js","lineNumber":426,"sourceCode":"    const shouldCollectInteractiveChoices = needsInteractiveChoices(options);\n    const needsConfirmation = !options.yes && !options.dryRun;\n    const interactiveDefaults = interactive\n      && (shouldCollectInteractiveChoices || needsConfirmation)\n      ? resolveInteractiveDefaults()\n      : undefined;\n    if (interactive && shouldCollectInteractiveChoices) {\n      terminal = readline.createInterface({\n        input: process.stdin,\n        output: process.stdout,\n      });\n      options = await collectInteractiveOptions(\n        options,\n        interactiveDefaults,\n        terminal\n      );\n    } else if (!options.mode) {\n      if (!interactive) {\n        throw new Error(\n          'Interactive setup requires a terminal. Pass --mode claude-plugin and the required flags.'\n        );\n      }\n    }\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    }","sourceCodeStart":408,"sourceCodeEnd":444,"githubUrl":"https://github.com/affaan-m/ECC/blob/01e15490f04e29cfefe3896951f43db46994d8ee/scripts/setup.js#L408-L444","documentation":"Thrown by setup.js when stdin is not a TTY (non-interactive), the user did not pass --mode, and there is no interactive path available. Without a terminal the script cannot prompt for the missing mode/scope/hooks, so it refuses to proceed and points the user at the required flags.","triggerScenarios":"Running `node scripts/setup.js` in CI, a Docker container, or any pipe (stdin not a TTY) without --mode and the supporting flags.","commonSituations":"First-time install in a fresh container; piping yes/no into the script; running under a scheduler that provides no TTY.","solutions":["Pass the full non-interactive flag set: `--mode claude-plugin --scope user --hooks standard --yes`.","Allocate a TTY (e.g. `docker run -it`, `script -q`) if you want prompts.","Combine with --json for machine-readable output in automation."],"exampleFix":"# before\nnode scripts/setup.js   # inside CI, no TTY\n# after\nnode scripts/setup.js --mode claude-plugin --scope user --hooks standard --yes","handlingStrategy":"validation","validationCode":"if (!process.stdin.isTTY && !process.argv.includes('--mode')) {\n  console.error('Non-interactive shell: pass --mode claude-plugin and required flags');\n  process.exit(2);\n}","typeGuard":"function isInteractive() { return Boolean(process.stdin.isTTY); }","tryCatchPattern":"try { await runSetup(options, interactive); } catch (err) { console.error(err.message); process.exit(2); }","preventionTips":["Detect TTY absence in CI wrappers and inject the full flag set automatically.","Document the canonical non-interactive command for containers and pipelines."],"tags":["cli","tty","setup","automation","environment"],"backgroundTag":null,"analyzedSha":"01e15490f04e29cfefe3896951f43db46994d8ee","analyzedAt":"2026-08-13T00:31:08.655Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}