paperclipai/paperclip · error · Error

Company ID is required. Pass --company-id, set PAPERCLIP_COM

Error message

Company ID is required. Pass --company-id, set PAPERCLIP_COMPANY_ID, or set context profile companyId via `paperclipai context set`.

What it means

requireCompanyId throws when ctx.companyId is unset. Plugin commands that operate on company-scoped plugin state (install/list/stream) need a resolved company before hitting the API.

Source

Thrown at cli/src/commands/client/plugin.ts:100

  author?: string;
  sdkPath?: string;
}

interface PluginJsonOptions extends BaseClientOptions {
  payloadJson?: string;
}

interface PluginStreamOptions extends BaseClientOptions {
  durationMs?: string;
}

interface PluginCompanyOptions extends PluginJsonOptions {
  companyId?: string;
}

function requireCompanyId(ctx: { companyId?: string }): string {
  if (!ctx.companyId) {
    throw new Error(
      "Company ID is required. Pass --company-id, set PAPERCLIP_COMPANY_ID, or set context profile companyId via `paperclipai context set`.",
    );
  }
  return ctx.companyId;
}

interface PluginInitResult {
  outputDir: string;
  nextCommands: string[];
}

// ---------------------------------------------------------------------------
// Helpers
// ---------------------------------------------------------------------------

function expandHomePath(packageArg: string): string {
  if (!packageArg.startsWith("~")) return packageArg;
  const home = process.env.HOME ?? process.env.USERPROFILE ?? "";

View on GitHub (pinned to 67001ec6eb)

Solutions

  1. Run `paperclipai context set --company-id <id>` for the active profile.
  2. Set PAPERCLIP_COMPANY_ID in your shell.
  3. Pass --company-id on the plugin command.

Example fix

// before
paperclipai plugin list
// after
paperclipai plugin list --company-id comp_123
Defensive patterns

Strategy: validation

Validate before calling

function requireCompanyId(ctx: {companyId?: string}) {
  if (!ctx.companyId) {
    throw new Error('Set PAPERCLIP_COMPANY_ID or run `paperclipai context set --company-id`.');
  }
  return ctx.companyId;
}

Prevention

When it happens

Trigger: Running a company-scoped plugin command with no --company-id, no PAPERCLIP_COMPANY_ID, and no profile companyId.

Common situations: New CLI profile never configured; env var unset; switched profiles.

Related errors


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