{"record":{"id":"1181743c3b07ef49","repo":"paperclipai/paperclip","slug":"paperclipai-connect-is-interactive-for-scripts","errorCode":null,"errorMessage":"`paperclipai connect` is interactive. For scripts, pass --api-base/--api-key or use context set/token commands.","messagePattern":"`paperclipai connect` is interactive\\. For scripts, pass --api-base/--api-key or use context set/token commands\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"cli/src/commands/client/connect.ts","lineNumber":58,"sourceCode":"      .command(\"connect\")\n      .description(\"Interactively connect the CLI as a board operator or agent\")\n      .option(\"--persona <persona>\", \"Persona to configure: board or agent\")\n      .option(\"--api-key-env-var-name <name>\", \"Env var name to store in the profile\", \"PAPERCLIP_API_KEY\")\n      .option(\"--token-name <name>\", \"Token label to create\")\n      .action(async (opts: ConnectOptions) => {\n        try {\n          const result = await connectWizard(opts);\n          printOutput(result, { json: opts.json });\n        } catch (err) {\n          handleCommandError(err);\n        }\n      }),\n  );\n}\n\nasync function connectWizard(opts: ConnectOptions) {\n  if (!process.stdin.isTTY || !process.stdout.isTTY) {\n    throw new Error(\"`paperclipai connect` is interactive. For scripts, pass --api-base/--api-key or use context set/token commands.\");\n  }\n\n  p.intro(pc.bgCyan(pc.black(\" paperclipai connect \")));\n\n  const context = readContext(opts.context);\n  const resolvedProfile = resolveProfile(context, opts.profile);\n  const initialApiBase = resolveApiBase(opts, resolvedProfile.profile);\n  const apiBaseInput = await p.text({\n    message: \"Paperclip API base\",\n    initialValue: initialApiBase,\n    placeholder: \"http://localhost:3100\",\n  });\n  assertNotCancelled(apiBaseInput);\n  const apiBase = normalizeApiBase(String(apiBaseInput || initialApiBase));\n  console.log(pc.dim(`Checking ${apiBase}/api/health ...`));\n  await verifyHealth(apiBase);\n\n  const boardLogin = await loginBoardCli({","sourceCodeStart":40,"sourceCodeEnd":76,"githubUrl":"https://github.com/paperclipai/paperclip/blob/120ae5428fa29bee300bcf806491cd4d965fbb7c/cli/src/commands/client/connect.ts#L40-L76","documentation":"connectWizard requires a TTY for its prompts; when run without the non-interactive flag组合 (no --api-base/--api-key) it aborts because the wizard cannot prompt in a script context.","triggerScenarios":"Thrown at cli/src/commands/client/connect.ts:58 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["In scripts, pass --api-base/--api-key or configure the context with `paperclipai context set` / token commands."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"120ae5428fa29bee300bcf806491cd4d965fbb7c","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}