paperclipai/paperclip · error · Error

Company ID is required.

Error message

Company ID is required.

What it means

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.

Source

Thrown at cli/src/commands/client/teams.ts:294

  slug: string | null;
  name: string;
  installedStatus: CatalogTeamInstalledStatus;
  installedAgentCount: number;
  catalogAgentCount: number | null;
  projectCount: number | null;
  trustLevel: CatalogTeam["trustLevel"] | null;
  present: boolean;
  outOfDate: boolean;
  currentContentHash: string | null;
  installedOriginHashes: string[];
}

async function listCatalogTeamStatusRows(
  ctx: ResolvedClientContext,
  opts: TeamListOptions,
): Promise<CatalogTeamStatusRow[]> {
  if (!ctx.companyId) {
    throw new Error("Company ID is required.");
  }

  const [teams, installed] = await Promise.all([
    listCatalogTeams(ctx, opts),
    ctx.api.get<InstalledCatalogTeam[]>(
      `/api/companies/${encodeURIComponent(ctx.companyId)}/teams/catalog/installed`,
    ),
  ]);

  const installedByCatalogId = new Map((installed ?? []).map((row) => [row.catalogId, row]));
  const rows = teams.map((team) => {
    const installedTeam = installedByCatalogId.get(team.id);
    if (installedTeam) {
      installedByCatalogId.delete(team.id);
    }
    return buildCatalogTeamStatusRow(team, installedTeam ?? null);
  });

View on GitHub (pinned to 67001ec6eb)

Solutions

  1. Pass --company-id explicitly: `paperclipai teams status --company-id <id>`.
  2. Set PAPERCLIP_COMPANY_ID in your environment.
  3. Run `paperclipai context set` to persist a default companyId in the profile.

Example fix

# before
paperclipai teams status
# after
paperclipai teams status --company-id 01HXYZ...
# or
export PAPERCLIP_COMPANY_ID=01HXYZ...
Defensive patterns

Strategy: validation

Validate before calling

const companyId = (process.env.PAPERCLIP_COMPANY_ID ?? opts.companyId ?? "").trim();
if (!companyId) throw new Error("Set --company-id or PAPERCLIP_COMPANY_ID before teams status.");
await run(["teams", "status", "--company-id", companyId]);

Type guard

function hasCompanyId(v: string | undefined): v is string {
  return typeof v === "string" && v.trim().length > 0;
}

Prevention

When it happens

Trigger: `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.

Common situations: Profile misconfiguration, running status before `paperclipai connect` set a default company, or a code path that calls listCatalogTeamStatusRows without the requireCompany option.

Related errors


AI-assisted analysis of paperclipai/paperclip@67001ec6eb (2026-08-12). Data as JSON: /api/errors/c1214e30f4a87afb. Report an issue: GitHub.