{"record":{"id":"c1214e30f4a87afb","repo":"paperclipai/paperclip","slug":"company-id-is-required","errorCode":null,"errorMessage":"Company ID is required.","messagePattern":"Company ID is required\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"cli/src/commands/client/teams.ts","lineNumber":294,"sourceCode":"  slug: string | null;\n  name: string;\n  installedStatus: CatalogTeamInstalledStatus;\n  installedAgentCount: number;\n  catalogAgentCount: number | null;\n  projectCount: number | null;\n  trustLevel: CatalogTeam[\"trustLevel\"] | null;\n  present: boolean;\n  outOfDate: boolean;\n  currentContentHash: string | null;\n  installedOriginHashes: string[];\n}\n\nasync function listCatalogTeamStatusRows(\n  ctx: ResolvedClientContext,\n  opts: TeamListOptions,\n): Promise<CatalogTeamStatusRow[]> {\n  if (!ctx.companyId) {\n    throw new Error(\"Company ID is required.\");\n  }\n\n  const [teams, installed] = await Promise.all([\n    listCatalogTeams(ctx, opts),\n    ctx.api.get<InstalledCatalogTeam[]>(\n      `/api/companies/${encodeURIComponent(ctx.companyId)}/teams/catalog/installed`,\n    ),\n  ]);\n\n  const installedByCatalogId = new Map((installed ?? []).map((row) => [row.catalogId, row]));\n  const rows = teams.map((team) => {\n    const installedTeam = installedByCatalogId.get(team.id);\n    if (installedTeam) {\n      installedByCatalogId.delete(team.id);\n    }\n    return buildCatalogTeamStatusRow(team, installedTeam ?? null);\n  });\n","sourceCodeStart":276,"sourceCodeEnd":312,"githubUrl":"https://github.com/paperclipai/paperclip/blob/67001ec6eb96ae601aa27bc91d9b2415d665334a/cli/src/commands/client/teams.ts#L276-L312","documentation":"Thrown by listCatalogTeamStatusRows() when ctx.companyId is empty. Unlike most teams commands, the status command builds a company-scoped installed-teams URL (/api/companies/{id}/teams/catalog/installed) and guards companyId itself rather than (or in addition to) resolveCommandContext's requireCompany. Without a company it cannot compute install state.","triggerScenarios":"`paperclipai teams status` (or status-like flows) when no company id resolves from --company-id, PAPERCLIP_COMPANY_ID, or the context profile, and requireCompany was not enforced upstream.","commonSituations":"Profile misconfiguration, running status before `paperclipai connect` set a default company, or a code path that calls listCatalogTeamStatusRows without the requireCompany option.","solutions":["Pass --company-id explicitly: `paperclipai teams status --company-id <id>`.","Set PAPERCLIP_COMPANY_ID in your environment.","Run `paperclipai context set` to persist a default companyId in the profile."],"exampleFix":"# before\npaperclipai teams status\n# after\npaperclipai teams status --company-id 01HXYZ...\n# or\nexport PAPERCLIP_COMPANY_ID=01HXYZ...","handlingStrategy":"validation","validationCode":"const companyId = (process.env.PAPERCLIP_COMPANY_ID ?? opts.companyId ?? \"\").trim();\nif (!companyId) throw new Error(\"Set --company-id or PAPERCLIP_COMPANY_ID before teams status.\");\nawait run([\"teams\", \"status\", \"--company-id\", companyId]);","typeGuard":"function hasCompanyId(v: string | undefined): v is string {\n  return typeof v === \"string\" && v.trim().length > 0;\n}","tryCatchPattern":null,"preventionTips":["Always export PAPERCLIP_COMPANY_ID in CI/agent shells.","Run `paperclipai context set` to persist a default company.","Pass --company-id explicitly for one-off commands."],"tags":["cli","validation","teams","company-id","catalog"],"backgroundTag":null,"analyzedSha":"67001ec6eb96ae601aa27bc91d9b2415d665334a","analyzedAt":"2026-08-12T12:05:45.408Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}