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 configure a CLI context default.
What it means
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.
Source
Thrown at cli/src/commands/client/feedback.ts:212
const ctx = resolveCommandContext(opts);
printOutput(await ctx.api.get(apiPath`/api/feedback-traces/${traceId}/bundle`), { json: ctx.json });
} catch (err) {
handleCommandError(err);
}
}),
);
}
export async function resolveFeedbackCompanyId(
ctx: ResolvedClientContext,
explicitCompanyId?: string,
): Promise<string> {
const direct = explicitCompanyId?.trim() || ctx.companyId?.trim();
if (direct) return direct;
const companies = (await ctx.api.get<Company[]>("/api/companies")) ?? [];
const companyId = companies[0]?.id?.trim();
if (!companyId) {
throw new Error(
"Company ID is required. Pass --company-id, set PAPERCLIP_COMPANY_ID, or configure a CLI context default.",
);
}
return companyId;
}
export function buildFeedbackTraceQuery(opts: FeedbackTraceQueryOptions, includePayload = true): string {
const params = new URLSearchParams();
if (opts.targetType) params.set("targetType", opts.targetType);
if (opts.vote) params.set("vote", opts.vote);
if (opts.status) params.set("status", opts.status);
if (opts.projectId) params.set("projectId", opts.projectId);
if (opts.issueId) params.set("issueId", opts.issueId);
if (opts.from) params.set("from", opts.from);
if (opts.to) params.set("to", opts.to);
if (opts.sharedOnly) params.set("sharedOnly", "true");
if (includePayload) params.set("includePayload", "true");
const query = params.toString();View on GitHub (pinned to 67001ec6eb)
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.
Defensive patterns
Strategy: validation
Validate before calling
function resolveCompanyId(explicit?: string, ctxCompanyId?: string, companies: Company[] = []) {
const direct = (explicit ?? '').trim() || (ctxCompanyId ?? '').trim();
if (direct) return direct;
const first = companies[0]?.id?.trim();
if (!first) throw new Error('Company ID is required.');
return first;
} Prevention
- Always configure PAPERCLIP_COMPANY_ID or run `paperclipai context set --company-id`.
- Validate company context in CI before invoking feedback commands.
When it happens
Trigger: Running a feedback command with no --company-id, no PAPERCLIP_COMPANY_ID, no profile companyId, and an empty /api/companies result.
Common situations: New CLI profile never configured; env var unset in the shell; board credential with no companies.
Related errors
- Company ID is required. Pass --company-id, set PAPERCLIP_COM
- Failed to parse JSON at ${filePath}: ${err instanceof Error
- Company ID is required. Pass --company-id, set PAPERCLIP_COM
- Invalid --include value. Use one or more of: company,agents,
- No companies are accessible with this board credential.
AI-assisted analysis of paperclipai/paperclip@67001ec6eb (2026-08-12).
Data as JSON: /api/errors/730e96aea672e066.
Report an issue: GitHub.