{"record":{"id":"a97cc5e9c9e0f8d1","repo":"paperclipai/paperclip","slug":"catalog-team-reference-is-required","errorCode":null,"errorMessage":"Catalog team reference is required.","messagePattern":"Catalog team reference is required\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"cli/src/commands/client/teams.ts","lineNumber":324,"sourceCode":"    const installedTeam = installedByCatalogId.get(team.id);\n    if (installedTeam) {\n      installedByCatalogId.delete(team.id);\n    }\n    return buildCatalogTeamStatusRow(team, installedTeam ?? null);\n  });\n\n  for (const installedTeam of installedByCatalogId.values()) {\n    if (installedTeam.present) continue;\n    rows.push(buildMissingInstalledTeamStatusRow(installedTeam));\n  }\n\n  return rows;\n}\n\nasync function getCatalogTeam(ctx: ResolvedClientContext, catalogRef: string): Promise<CatalogTeam> {\n  const ref = catalogRef.trim();\n  if (!ref) {\n    throw new Error(\"Catalog team reference is required.\");\n  }\n  const detail = await ctx.api.get<CatalogTeam>(`/api/teams/catalog/ref?ref=${encodeURIComponent(ref)}`);\n  if (!detail) {\n    throw new Error(`Catalog team not found: ${catalogRef}`);\n  }\n  return detail;\n}\n\nasync function getCatalogTeamFile(\n  ctx: ResolvedClientContext,\n  catalogRef: string,\n  filePath: string,\n): Promise<{ content: string } | null> {\n  const ref = catalogRef.trim();\n  const path = filePath.trim();\n  if (!ref) throw new Error(\"Catalog team reference is required.\");\n  if (!path) throw new Error(\"Catalog team file path is required.\");\n  const params = new URLSearchParams({ ref, path });","sourceCodeStart":306,"sourceCodeEnd":342,"githubUrl":"https://github.com/paperclipai/paperclip/blob/67001ec6eb96ae601aa27bc91d9b2415d665334a/cli/src/commands/client/teams.ts#L306-L342","documentation":"Thrown by getCatalogTeam() when the catalog team reference is empty after trimming. It guards the GET /api/teams/catalog/ref?ref=... call used by `teams inspect`/`teams show` to fetch a single catalog team's metadata. Identical pattern to the skills catalog ref guard.","triggerScenarios":"Running `paperclipai teams inspect <catalogRef>` with a blank argument (empty or whitespace), e.g. an unset variable expanded into the positional.","commonSituations":"Shell variable unset, script passing untrimmed input, or copy-paste of an empty cell from a spreadsheet.","solutions":["Pass a non-empty catalog team id, key, or unique slug.","Browse first with `paperclipai teams browse` to find a valid ref.","Validate the ref is non-empty in your wrapper before invoking."],"exampleFix":"// before\nawait run([\"teams\", \"inspect\", teamRefVar]);\n// after\nconst ref = (teamRefVar ?? \"\").trim();\nif (!ref) throw new Error(\"team ref required\");\nawait run([\"teams\", \"inspect\", ref]);","handlingStrategy":"validation","validationCode":"const ref = (catalogRef ?? \"\").trim();\nif (!ref) throw new Error(\"Catalog team ref is required.\");\nawait run([\"teams\", \"inspect\", ref]);","typeGuard":"function isValidTeamRef(ref: string | undefined): ref is string {\n  return typeof ref === \"string\" && ref.trim().length > 0;\n}","tryCatchPattern":null,"preventionTips":["Source team refs from `teams browse`.","Trim and validate before invoking.","Fail fast on empty variables in scripts."],"tags":["cli","validation","teams","catalog","input"],"backgroundTag":null,"analyzedSha":"67001ec6eb96ae601aa27bc91d9b2415d665334a","analyzedAt":"2026-08-12T12:05:45.408Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}