paperclipai/paperclip · error · Error
Pass either inline JSON or a JSON file, not both.
Error message
Pass either inline JSON or a JSON file, not both.
What it means
Error "Pass either inline JSON or a JSON file, not both." thrown in paperclipai/paperclip.
Source
Thrown at cli/src/commands/pipelines.ts:682
if (opts.fieldsJson || opts.fieldsFile) body.fields = await readJsonFromOptions(opts.fieldsJson, opts.fieldsFile);
if (opts.workspaceRefJson) body.workspaceRef = parseJson(opts.workspaceRefJson);
if (opts.blockedBy) body.blockedByCaseIds = parseCsv(opts.blockedBy);
if (opts.blockedByKey) body.blockedByCaseKeys = parseCsv(opts.blockedByKey);
return body;
}
async function buildReviewEdits(opts: ReviewOptions): Promise<JsonObject | undefined> {
const fromFile = await readJsonFromOptions(opts.editsJson, opts.editsFile);
const edits = fromFile === undefined ? {} : asObject(fromFile);
setIfDefined(edits, "title", opts.title);
setIfDefined(edits, "summary", opts.summary);
const fields = await readJsonFromOptions(opts.fieldsJson, opts.fieldsFile);
if (fields !== undefined) edits.fields = fields;
return Object.keys(edits).length ? edits : undefined;
}
async function readJsonFromOptions(json?: string, file?: string): Promise<unknown | undefined> {
if (json && file) throw new Error("Pass either inline JSON or a JSON file, not both.");
if (json) return parseJson(json);
if (file) return readJsonFile(file);
return undefined;
}
async function readJsonFile(file: string): Promise<unknown> {
return parseJson(await readFile(file, "utf8"));
}
function parseJson(value: string): unknown {
try {
return JSON.parse(value) as unknown;
} catch (error) {
throw new Error(`Invalid JSON: ${error instanceof Error ? error.message : String(error)}`);
}
}
function asObject(value: unknown): JsonObject {View on GitHub (pinned to 67001ec6eb)
When it happens
Trigger: Thrown at cli/src/commands/pipelines.ts:682 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of paperclipai/paperclip@67001ec6eb (2026-08-12).
Data as JSON: /api/errors/ad8d111c9771415a.
Report an issue: GitHub.