diff --git a/src/commands/research.ts b/src/commands/research.ts index 5d8d70c3e..26bff5e30 100644 --- a/src/commands/research.ts +++ b/src/commands/research.ts @@ -36,10 +36,17 @@ function appendParam( } function withQuery(path: string, params: URLSearchParams): string { + if (!params.has('integration')) { + params.set('integration', 'cli'); + } const qs = params.toString(); return qs ? `${path}?${qs}` : path; } +function withIntegration(path: string): string { + return withQuery(path, new URLSearchParams()); +} + async function getResearch( path: string, options: ResearchBaseOptions @@ -218,7 +225,7 @@ export async function handleInspectPaperCommand( ): Promise { try { const data = await getResearch<{ paper?: PaperHit }>( - `${BASE}/papers/${encodeURIComponent(options.paperId)}`, + withIntegration(`${BASE}/papers/${encodeURIComponent(options.paperId)}`), options ); writeResearchOutput(data, fmtPaperMetadata(data.paper), options);