{"record":{"id":"445726c528dcbcfd","repo":"paperclipai/paperclip","slug":"no-companies-are-accessible-with-this-board-creden","errorCode":null,"errorMessage":"No companies are accessible with this board credential.","messagePattern":"No companies are accessible with this board credential\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"cli/src/commands/client/connect.ts","lineNumber":195,"sourceCode":"async function askProfileName(defaultName: string): Promise<string> {\n  const profile = await p.text({\n    message: \"Profile name\",\n    initialValue: defaultName || \"default\",\n  });\n  assertNotCancelled(profile);\n  const value = String(profile).trim();\n  if (!value) throw new Error(\"Profile name is required\");\n  return value;\n}\n\nasync function chooseCompany(\n  companies: Company[],\n  preferredCompanyId: string | undefined,\n  opts: { optional: boolean },\n): Promise<Company | null> {\n  if (companies.length === 0) {\n    if (opts.optional) return null;\n    throw new Error(\"No companies are accessible with this board credential.\");\n  }\n  const preferred = preferredCompanyId ? companies.find((company) => company.id === preferredCompanyId) : null;\n  if (companies.length === 1 && !opts.optional) return companies[0] ?? null;\n  const selected = await p.select({\n    message: opts.optional ? \"Default company for this profile\" : \"Agent company\",\n    initialValue: preferred?.id ?? companies[0]?.id,\n    options: [\n      ...(opts.optional ? [{ value: \"\", label: \"(none)\" }] : []),\n      ...companies.map((company) => ({\n        value: company.id,\n        label: company.name,\n        hint: company.id,\n      })),\n    ],\n  });\n  assertNotCancelled(selected);\n  if (!selected) return null;\n  return companies.find((company) => company.id === selected) ?? null;","sourceCodeStart":177,"sourceCodeEnd":213,"githubUrl":"https://github.com/paperclipai/paperclip/blob/67001ec6eb96ae601aa27bc91d9b2415d665334a/cli/src/commands/client/connect.ts#L177-L213","documentation":"Thrown by chooseCompany when the companies list is empty and the caller marked the selection as required (optional:false). It means the board credential grants access to zero companies.","triggerScenarios":"GET /api/companies (called with the board token) returns [] during an agent-profile connect that requires a company.","commonSituations":"Brand-new install with no companies created; revoked company membership; board API key scoped to nothing; apiBase pointing at the wrong instance.","solutions":["Create a company in the board UI first, then re-run connect.","Verify the board credential and apiBase are correct (curl GET /api/companies with the token).","Have an admin grant your board user membership in an existing company."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const companies = (await boardApi.get('/api/companies')) ?? [];\nif (companies.length === 0) {\n  throw new Error('No companies accessible; create one in the board UI first.');\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Verify the board credential returns companies before connect.","Keep the board credential's company memberships up to date."],"tags":["cli","connect","auth","empty-state","company"],"backgroundTag":null,"analyzedSha":"67001ec6eb96ae601aa27bc91d9b2415d665334a","analyzedAt":"2026-08-12T12:05:45.408Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}