{"record":{"id":"730e96aea672e066","repo":"paperclipai/paperclip","slug":"company-id-is-required-pass-company-id-set-pap-730e96","errorCode":null,"errorMessage":"Company ID is required. Pass --company-id, set PAPERCLIP_COMPANY_ID, or configure a CLI context default.","messagePattern":"Company ID is required\\. Pass --company-id, set PAPERCLIP_COMPANY_ID, or configure a CLI context default\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"cli/src/commands/client/feedback.ts","lineNumber":212,"sourceCode":"          const ctx = resolveCommandContext(opts);\n          printOutput(await ctx.api.get(apiPath`/api/feedback-traces/${traceId}/bundle`), { json: ctx.json });\n        } catch (err) {\n          handleCommandError(err);\n        }\n      }),\n  );\n}\n\nexport async function resolveFeedbackCompanyId(\n  ctx: ResolvedClientContext,\n  explicitCompanyId?: string,\n): Promise<string> {\n  const direct = explicitCompanyId?.trim() || ctx.companyId?.trim();\n  if (direct) return direct;\n  const companies = (await ctx.api.get<Company[]>(\"/api/companies\")) ?? [];\n  const companyId = companies[0]?.id?.trim();\n  if (!companyId) {\n    throw new Error(\n      \"Company ID is required. Pass --company-id, set PAPERCLIP_COMPANY_ID, or configure a CLI context default.\",\n    );\n  }\n  return companyId;\n}\n\nexport function buildFeedbackTraceQuery(opts: FeedbackTraceQueryOptions, includePayload = true): string {\n  const params = new URLSearchParams();\n  if (opts.targetType) params.set(\"targetType\", opts.targetType);\n  if (opts.vote) params.set(\"vote\", opts.vote);\n  if (opts.status) params.set(\"status\", opts.status);\n  if (opts.projectId) params.set(\"projectId\", opts.projectId);\n  if (opts.issueId) params.set(\"issueId\", opts.issueId);\n  if (opts.from) params.set(\"from\", opts.from);\n  if (opts.to) params.set(\"to\", opts.to);\n  if (opts.sharedOnly) params.set(\"sharedOnly\", \"true\");\n  if (includePayload) params.set(\"includePayload\", \"true\");\n  const query = params.toString();","sourceCodeStart":194,"sourceCodeEnd":230,"githubUrl":"https://github.com/paperclipai/paperclip/blob/67001ec6eb96ae601aa27bc91d9b2415d665334a/cli/src/commands/client/feedback.ts#L194-L230","documentation":"resolveFeedbackCompanyId tries explicitCompanyId, then ctx.companyId, then the first company from GET /api/companies; if none yields an id it throws. Feedback-trace commands are company-scoped and need a resolved company.","triggerScenarios":"Running a feedback command with no --company-id, no PAPERCLIP_COMPANY_ID, no profile companyId, and an empty /api/companies result.","commonSituations":"New CLI profile never configured; env var unset in the shell; board credential with no companies.","solutions":["Set PAPERCLIP_COMPANY_ID in your shell.","Run `paperclipai context set --company-id <id>` for the active profile.","Pass --company-id on the feedback command.","Ensure at least one company exists for the board credential."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"function resolveCompanyId(explicit?: string, ctxCompanyId?: string, companies: Company[] = []) {\n  const direct = (explicit ?? '').trim() || (ctxCompanyId ?? '').trim();\n  if (direct) return direct;\n  const first = companies[0]?.id?.trim();\n  if (!first) throw new Error('Company ID is required.');\n  return first;\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always configure PAPERCLIP_COMPANY_ID or run `paperclipai context set --company-id`.","Validate company context in CI before invoking feedback commands."],"tags":["cli","feedback","config","company"],"backgroundTag":null,"analyzedSha":"67001ec6eb96ae601aa27bc91d9b2415d665334a","analyzedAt":"2026-08-12T12:05:45.408Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}