@koda-sl/baker-cli 0.876.0 → 0.877.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/cli.js +1 -1
- package/dist/{gsc-PIMZ3KSE.js → gsc-YN4I6HMO.js} +2 -2
- package/dist/{query-JPISFZOF.js → query-T25LAJMA.js} +14 -5
- package/dist/query-T25LAJMA.js.map +1 -0
- package/package.json +1 -1
- package/dist/query-JPISFZOF.js.map +0 -1
- /package/dist/{gsc-PIMZ3KSE.js.map → gsc-YN4I6HMO.js.map} +0 -0
package/README.md
CHANGED
|
@@ -2609,6 +2609,7 @@ baker gsc query --list-presets
|
|
|
2609
2609
|
# Free-form
|
|
2610
2610
|
baker gsc query --dimensions "query,page" --days 28
|
|
2611
2611
|
baker gsc query --dimensions "query" --row-limit 25000 --out keywords.csv
|
|
2612
|
+
baker gsc query --dimensions "query" --filter '{"dimension":"query","operator":"contains","expression":"black"}'
|
|
2612
2613
|
```
|
|
2613
2614
|
|
|
2614
2615
|
csv, md and `--out file.csv` print the dimensions in the order asked for, then `clicks,impressions,ctr,position`. JSON rows carry their keys sorted; the envelope's `columns` gives the order.
|
|
@@ -2626,6 +2627,7 @@ csv, md and `--out file.csv` print the dimensions in the order asked for, then `
|
|
|
2626
2627
|
| `--start-row` | Skip this many rows — the `nextStartRow` a full page returned |
|
|
2627
2628
|
| `--type` | Search type: web\|image\|video\|news\|discover |
|
|
2628
2629
|
| `--site-url` | Site URL (auto-resolved if not provided) |
|
|
2630
|
+
| `--filter` | Keep only matching rows: one filter `{"dimension":"query","operator":"contains","expression":"brand"}`, a list of them (all must match), or Search Console filter groups |
|
|
2629
2631
|
| `--out` | Write to file |
|
|
2630
2632
|
| `--output` | Format: json\|csv\|jsonl\|md |
|
|
2631
2633
|
| `--no-cache` | Skip cache |
|
package/dist/cli.js
CHANGED
|
@@ -630,7 +630,7 @@ Introspection: Run 'baker schema <command>' to inspect argument schemas.`
|
|
|
630
630
|
analytics: () => import("./analytics-XIZ73QUC.js").then((m) => m.analyticsCommand),
|
|
631
631
|
experiment: () => import("./experiment-WJOL5Z2O.js").then((m) => m.experimentCommand),
|
|
632
632
|
ga4: () => import("./ga4-Z65WIL2M.js").then((m) => m.ga4Command),
|
|
633
|
-
gsc: () => import("./gsc-
|
|
633
|
+
gsc: () => import("./gsc-YN4I6HMO.js").then((m) => m.gscCommand),
|
|
634
634
|
research: () => import("./research-6444D4GN.js").then((m) => m.researchCommand),
|
|
635
635
|
decide: () => import("./decide-QBRUP7EO.js").then((m) => m.decideCommand),
|
|
636
636
|
data: () => import("./data-WRAB5HMY.js").then((m) => m.dataCommand),
|
|
@@ -20,11 +20,11 @@ Full guide: __tooling__/docs/tools/baker/gsc.md`
|
|
|
20
20
|
},
|
|
21
21
|
subCommands: {
|
|
22
22
|
sites: () => import("./sites-3HH27X3P.js").then((m) => m.sitesCommand),
|
|
23
|
-
query: () => import("./query-
|
|
23
|
+
query: () => import("./query-T25LAJMA.js").then((m) => m.queryCommand),
|
|
24
24
|
sitemaps: () => import("./sitemaps-73S55MZX.js").then((m) => m.sitemapsCommand)
|
|
25
25
|
}
|
|
26
26
|
});
|
|
27
27
|
export {
|
|
28
28
|
gscCommand
|
|
29
29
|
};
|
|
30
|
-
//# sourceMappingURL=gsc-
|
|
30
|
+
//# sourceMappingURL=gsc-YN4I6HMO.js.map
|
|
@@ -95,7 +95,11 @@ registerSchema({
|
|
|
95
95
|
required: false
|
|
96
96
|
},
|
|
97
97
|
type: { type: "string", description: "Search type: web|image|video|news|discover (default: web)", required: false },
|
|
98
|
-
filter: {
|
|
98
|
+
filter: {
|
|
99
|
+
type: "string",
|
|
100
|
+
description: `Filter JSON: one filter, a list of them (all must match), or Search Console's filter groups. Example: '{"dimension":"query","operator":"contains","expression":"brand"}'`,
|
|
101
|
+
required: false
|
|
102
|
+
},
|
|
99
103
|
"list-presets": { type: "boolean", description: "List available presets", required: false },
|
|
100
104
|
out: {
|
|
101
105
|
type: "string",
|
|
@@ -195,6 +199,7 @@ Presets (primary usage):
|
|
|
195
199
|
Free-form (escape hatch):
|
|
196
200
|
baker gsc query --dimensions "query,page" --days 28
|
|
197
201
|
baker gsc query --dimensions "query" --row-limit 25000 --out keywords.csv
|
|
202
|
+
baker gsc query --dimensions "query" --filter '{"dimension":"query","operator":"contains","expression":"black"}'
|
|
198
203
|
|
|
199
204
|
A page that comes back full answers truncated: true and nextStartRow \u2014 read the rest with --start-row:
|
|
200
205
|
baker gsc query --dimensions "query,page" --out qp.csv
|
|
@@ -219,7 +224,11 @@ columns in the envelope gives the order.`
|
|
|
219
224
|
required: false
|
|
220
225
|
},
|
|
221
226
|
type: { type: "string", description: "Search type (default: web)", required: false },
|
|
222
|
-
filter: {
|
|
227
|
+
filter: {
|
|
228
|
+
type: "string",
|
|
229
|
+
description: "Filter JSON: one filter, a list of them (all must match), or filter groups",
|
|
230
|
+
required: false
|
|
231
|
+
},
|
|
223
232
|
"list-presets": { type: "boolean", description: "List presets", required: false },
|
|
224
233
|
out: { type: "string", description: "Write the rows alone to this file (not the envelope)", required: false },
|
|
225
234
|
append: { type: "boolean", description: "Append to file", required: false },
|
|
@@ -255,7 +264,7 @@ columns in the envelope gives the order.`
|
|
|
255
264
|
const body = buildRequestBody(args, siteUrl, useCache);
|
|
256
265
|
const cacheKey = buildQueryCacheKey(siteUrl, JSON.stringify(body));
|
|
257
266
|
if (useCache) {
|
|
258
|
-
const cached = cacheGet("gsc-queries-
|
|
267
|
+
const cached = cacheGet("gsc-queries-v4", cacheKey);
|
|
259
268
|
if (cached) {
|
|
260
269
|
outputRows(cached.data.data ?? [], args, cached.data, true);
|
|
261
270
|
return;
|
|
@@ -264,7 +273,7 @@ columns in the envelope gives the order.`
|
|
|
264
273
|
try {
|
|
265
274
|
const response = await apiPost("/api/gsc/query", body);
|
|
266
275
|
if (useCache) {
|
|
267
|
-
cacheSet("gsc-queries-
|
|
276
|
+
cacheSet("gsc-queries-v4", cacheKey, response, getQueryTtl(JSON.stringify(body)));
|
|
268
277
|
}
|
|
269
278
|
outputRows(response.data ?? [], args, response, false);
|
|
270
279
|
} catch (err) {
|
|
@@ -275,4 +284,4 @@ columns in the envelope gives the order.`
|
|
|
275
284
|
export {
|
|
276
285
|
queryCommand
|
|
277
286
|
};
|
|
278
|
-
//# sourceMappingURL=query-
|
|
287
|
+
//# sourceMappingURL=query-T25LAJMA.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/commands/gsc/query.ts","../src/commands/gsc/presets.ts"],"sourcesContent":["import { appendFileSync, existsSync, readFileSync, writeFileSync } from \"node:fs\";\nimport { resolve } from \"node:path\";\nimport { defineCommand } from \"citty\";\nimport { apiPost } from \"../../client.ts\";\nimport { withWindowSpellings } from \"../../date-window.ts\";\nimport { registerSchema } from \"../../schemas.ts\";\nimport { buildQueryCacheKey, cacheGet, cacheSet, getQueryTtl } from \"../ads/cache.ts\";\nimport { rowsFileHolds, toCsvRow, writeAdsOutput, writeJsonEnvelope } from \"../ads/output.ts\";\nimport { refuseInvalidRowPosition } from \"../row-position.ts\";\nimport { GSC_PRESETS } from \"./presets.ts\";\nimport { handleGscSiteError, resolveSiteUrl } from \"./resolve.ts\";\n\nregisterSchema({\n command: \"gsc.query\",\n description:\n \"Run GSC Search Analytics queries. Use --preset for playbook-aligned queries (primary usage) or --dimensions for free-form queries. JSON rows keep their keys sorted; `columns` in the envelope lists them in the order asked for (dimensions, then clicks, impressions, ctr, position), the order csv, md and --out print.\",\n args: {\n \"site-url\": { type: \"string\", description: \"Site URL (auto-resolved if not provided)\", required: false },\n preset: {\n type: \"string\",\n description:\n \"Named preset (cannibalization, missed-revenue, brand-halo, negative-keywords, top-pages, top-queries)\",\n required: false,\n },\n brand: { type: \"string\", description: \"Brand name (required for brand-halo preset)\", required: false },\n dimensions: {\n type: \"string\",\n description: \"Comma-separated dimensions (escape hatch: query, page, country, device, date)\",\n required: false,\n },\n days: { type: \"string\", description: \"Lookback window in days (default: 28)\", required: false },\n \"start-date\": { type: \"string\", description: \"Explicit start date (YYYY-MM-DD)\", required: false },\n \"end-date\": { type: \"string\", description: \"Explicit end date (YYYY-MM-DD)\", required: false },\n \"row-limit\": { type: \"string\", description: \"Max rows (default: 1000, max: 25000)\", required: false },\n \"start-row\": {\n type: \"string\",\n description: \"Skip this many rows — read the rest of a full page with the nextStartRow it returned\",\n required: false,\n },\n type: { type: \"string\", description: \"Search type: web|image|video|news|discover (default: web)\", required: false },\n filter: {\n type: \"string\",\n description: `Filter JSON: one filter, a list of them (all must match), or Search Console's filter groups. Example: '{\"dimension\":\"query\",\"operator\":\"contains\",\"expression\":\"brand\"}'`,\n required: false,\n },\n \"list-presets\": { type: \"boolean\", description: \"List available presets\", required: false },\n out: {\n type: \"string\",\n description: \"Write the rows alone to a file, not the envelope (.csv, .jsonl, .json — a bare array of rows)\",\n required: false,\n },\n append: { type: \"boolean\", description: \"Append to existing file\", required: false },\n output: { type: \"string\", description: \"Format: json|csv|jsonl|md\", required: false, default: \"json\" },\n \"no-cache\": { type: \"boolean\", description: \"Skip cache\", required: false },\n },\n});\n\ninterface QueryApiResponse {\n ok: boolean;\n /** The row keys in the order asked for: Convex hands the row objects back with their keys sorted. */\n columns?: string[];\n data?: Array<Record<string, unknown>>;\n truncated?: boolean;\n nextStartRow?: number;\n preset?: string;\n error?: { code: string; message: string };\n}\n\nfunction columnsOf(response: QueryApiResponse, rows: Array<Record<string, unknown>>): string[] {\n if (response.columns && response.columns.length > 0) return response.columns;\n const first = rows[0];\n return first ? Object.keys(first) : [];\n}\n\nfunction writeRowsToFile(\n filePath: string,\n rows: Array<Record<string, unknown>>,\n fields: string[],\n append: boolean,\n): void {\n const ext = filePath.split(\".\").pop()?.toLowerCase();\n if (ext === \"csv\") {\n if (!append || !existsSync(filePath)) {\n writeFileSync(filePath, `${toCsvRow(fields)}\\n`, \"utf-8\");\n }\n const csvRows = rows.map((row) => toCsvRow(fields.map((f) => String(row[f] ?? \"\"))));\n appendFileSync(filePath, `${csvRows.join(\"\\n\")}\\n`, \"utf-8\");\n } else if (ext === \"jsonl\") {\n const content = `${rows.map((row) => JSON.stringify(row)).join(\"\\n\")}\\n`;\n if (append && existsSync(filePath)) {\n appendFileSync(filePath, content, \"utf-8\");\n } else {\n writeFileSync(filePath, content, \"utf-8\");\n }\n } else if (append && existsSync(filePath)) {\n const existing = JSON.parse(readFileSync(filePath, \"utf-8\")) as unknown[];\n writeFileSync(filePath, JSON.stringify([...existing, ...rows], null, 2), \"utf-8\");\n } else {\n writeFileSync(filePath, JSON.stringify(rows, null, 2), \"utf-8\");\n }\n}\n\n/** Search Console never counts a report's rows, so a full page is said to be possibly cut, in every format. */\nfunction truncationHints(response: QueryApiResponse, rows: number, toFile: boolean): string[] {\n if (!response.truncated || response.nextStartRow === undefined) return [];\n return [\n `These ${rows.toLocaleString(\"en-US\")} rows filled the row limit, so Search Console may have more — do not total them as the whole report. ` +\n `Read the next rows with the same arguments plus --start-row ${response.nextStartRow}${toFile ? \" --append\" : \"\"} ` +\n \"until truncated is false.\",\n ];\n}\n\nfunction outputRows(\n rows: Array<Record<string, unknown>>,\n args: Record<string, unknown>,\n response: QueryApiResponse,\n cached: boolean,\n): void {\n const hints = truncationHints(response, rows.length, !!args.out);\n if (args.out) {\n const filePath = resolve(args.out as string);\n writeRowsToFile(filePath, rows, columnsOf(response, rows), !!args.append);\n writeJsonEnvelope({\n ok: true,\n file: filePath,\n holds: rowsFileHolds(filePath),\n rows: rows.length,\n ...(response.truncated !== undefined && { truncated: response.truncated }),\n ...(response.nextStartRow !== undefined && { nextStartRow: response.nextStartRow }),\n ...(cached && { cached: true }),\n ...(hints.length > 0 && { hints }),\n });\n return;\n }\n const format = (args.output as string) || \"json\";\n if (format !== \"json\") {\n writeAdsOutput(rows, format, columnsOf(response, rows), hints);\n return;\n }\n writeJsonEnvelope({ ...response, ...(cached && { cached: true }), ...(hints.length > 0 && { hints }) });\n}\n\nfunction buildRequestBody(args: Record<string, unknown>, siteUrl: string, useCache: boolean): Record<string, unknown> {\n const body: Record<string, unknown> = { siteUrl };\n if (args.preset) body.preset = args.preset;\n if (args.brand) body.brand = args.brand;\n if (args.dimensions) body.dimensions = (args.dimensions as string).split(\",\").map((d) => d.trim());\n if (args.days) body.days = Number(args.days);\n if (args[\"start-date\"]) body.startDate = args[\"start-date\"];\n if (args[\"end-date\"]) body.endDate = args[\"end-date\"];\n if (args[\"row-limit\"]) body.rowLimit = Number(args[\"row-limit\"]);\n if (args[\"start-row\"]) body.startRow = Number(args[\"start-row\"]);\n if (args.type) body.type = args.type;\n if (args.filter) body.filter = args.filter;\n if (!useCache) body.skipCache = true;\n return body;\n}\n\nexport const queryCommand = defineCommand({\n meta: {\n name: \"query\",\n description: `Run GSC Search Analytics queries. Preset-first with free-form escape hatch.\n\nPresets (primary usage):\n baker gsc query --preset cannibalization\n baker gsc query --preset brand-halo --brand \"Acme\" --days 90\n baker gsc query --list-presets\n\nFree-form (escape hatch):\n baker gsc query --dimensions \"query,page\" --days 28\n baker gsc query --dimensions \"query\" --row-limit 25000 --out keywords.csv\n baker gsc query --dimensions \"query\" --filter '{\"dimension\":\"query\",\"operator\":\"contains\",\"expression\":\"black\"}'\n\nA page that comes back full answers truncated: true and nextStartRow — read the rest with --start-row:\n baker gsc query --dimensions \"query,page\" --out qp.csv\n baker gsc query --dimensions \"query,page\" --out qp.csv --start-row 1000 --append\n\nColumns come in the order asked for: the dimensions, then clicks, impressions, ctr, position.\ncsv, md and --out print that order; JSON rows keep their keys sorted, so read them by name —\ncolumns in the envelope gives the order.`,\n },\n args: withWindowSpellings({\n \"site-url\": { type: \"string\", description: \"Site URL\", required: false },\n preset: { type: \"string\", description: \"Named preset\", required: false },\n brand: { type: \"string\", description: \"Brand name for brand-halo preset\", required: false },\n dimensions: { type: \"string\", description: \"Comma-separated dimensions\", required: false },\n days: { type: \"string\", description: \"Lookback days (default: 28)\", required: false },\n \"start-date\": { type: \"string\", description: \"Start date override\", required: false },\n \"end-date\": { type: \"string\", description: \"End date override\", required: false },\n \"row-limit\": { type: \"string\", description: \"Max rows (default: 1000)\", required: false },\n \"start-row\": {\n type: \"string\",\n description: \"Skip this many rows (the nextStartRow a full page returned)\",\n required: false,\n },\n type: { type: \"string\", description: \"Search type (default: web)\", required: false },\n filter: {\n type: \"string\",\n description: \"Filter JSON: one filter, a list of them (all must match), or filter groups\",\n required: false,\n },\n \"list-presets\": { type: \"boolean\", description: \"List presets\", required: false },\n out: { type: \"string\", description: \"Write the rows alone to this file (not the envelope)\", required: false },\n append: { type: \"boolean\", description: \"Append to file\", required: false },\n output: { type: \"string\", description: \"Format: json|csv|jsonl|md\", required: false, default: \"json\" },\n \"no-cache\": { type: \"boolean\", description: \"Skip cache\", required: false },\n }),\n run: async ({ args }) => {\n if (args[\"list-presets\"]) {\n writeJsonEnvelope({\n ok: true,\n data: GSC_PRESETS.map((p) => ({\n name: p.name,\n description: p.description,\n playbook: p.playbook,\n ...(p.requiresBrand && { requiresBrand: true }),\n })),\n });\n return;\n }\n\n if (!args.preset && !args.dimensions) {\n writeJsonEnvelope({\n ok: false,\n error: {\n code: \"VALIDATION_ERROR\",\n message: \"Provide --preset or --dimensions. Run --list-presets to see options.\",\n },\n });\n process.exit(1);\n }\n\n refuseInvalidRowPosition(\"--start-row\", args[\"start-row\"]);\n\n const siteUrl = await resolveSiteUrl(args);\n const useCache = !args[\"no-cache\"];\n const body = buildRequestBody(args, siteUrl, useCache);\n const cacheKey = buildQueryCacheKey(siteUrl, JSON.stringify(body));\n\n if (useCache) {\n const cached = cacheGet<QueryApiResponse>(\"gsc-queries-v4\", cacheKey);\n if (cached) {\n outputRows(cached.data.data ?? [], args, cached.data, true);\n return;\n }\n }\n\n try {\n const response = await apiPost<QueryApiResponse>(\"/api/gsc/query\", body);\n if (useCache) {\n cacheSet(\"gsc-queries-v4\", cacheKey, response, getQueryTtl(JSON.stringify(body)));\n }\n outputRows(response.data ?? [], args, response, false);\n } catch (err) {\n await handleGscSiteError(err, siteUrl);\n }\n },\n});\n","interface GscPreset {\n name: string;\n description: string;\n playbook: string;\n requiresBrand?: boolean;\n}\n\nexport const GSC_PRESETS: GscPreset[] = [\n {\n name: \"cannibalization\",\n description: \"PPC-SEO arbitrage — find queries ranking #1-2 organically where you also pay for ads\",\n playbook: \"[05] PPC-SEO Arbitrage\",\n },\n {\n name: \"missed-revenue\",\n description: \"High-impression queries with no PPC coverage (position > 10)\",\n playbook: \"[05] Opportunity Finder\",\n },\n {\n name: \"brand-halo\",\n description: \"Brand search volume trends — proves upper-funnel awareness lift\",\n playbook: \"[21] YouTube/DG ROI\",\n requiresBrand: true,\n },\n {\n name: \"negative-keywords\",\n description: \"Discover negative keyword candidates (login, support, cancel queries)\",\n playbook: \"Negative Keyword Discovery\",\n },\n {\n name: \"top-pages\",\n description: \"Top performing pages by clicks\",\n playbook: \"General\",\n },\n {\n name: \"top-queries\",\n description: \"Top search queries by clicks\",\n playbook: \"General\",\n },\n];\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,gBAAgB,YAAY,cAAc,qBAAqB;AACxE,SAAS,eAAe;AACxB,SAAS,qBAAqB;;;ACKvB,IAAM,cAA2B;AAAA,EACtC;AAAA,IACE,MAAM;AAAA,IACN,aAAa;AAAA,IACb,UAAU;AAAA,EACZ;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,aAAa;AAAA,IACb,UAAU;AAAA,EACZ;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,aAAa;AAAA,IACb,UAAU;AAAA,IACV,eAAe;AAAA,EACjB;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,aAAa;AAAA,IACb,UAAU;AAAA,EACZ;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,aAAa;AAAA,IACb,UAAU;AAAA,EACZ;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,aAAa;AAAA,IACb,UAAU;AAAA,EACZ;AACF;;;AD3BA,eA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AI,UAAU;AACZ,YAAM,SAAS,SAA2B,kBAAkB,QAAQ;AACpE,UAAI,QAAQ;AACV,mBAAW,OAAO,KAAK,QAAQ,CAAC,GAAG,MAAM,OAAO,MAAM,IAAI;AAC1D;AAAA,MACF;AAAA,IACF;AAEA,QAAI;AACF,YAAM,WAAW,MAAM,QAA0B,kBAAkB,IAAI;AACvE,UAAI,UAAU;AACZ,iBAAS,kBAAkB,UAAU,UAAU,YAAY,KAAK,UAAU,IAAI,CAAC,CAAC;AAAA,MAClF;AACA,iBAAW,SAAS,QAAQ,CAAC,GAAG,MAAM,UAAU,KAAK;AAAA,IACvD,SAAS,KAAK;AACZ,YAAM,mBAAmB,KAAK,OAAO;AAAA,IACvC;AAAA,EACF;AACF,CAAC;","names":[]}
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/commands/gsc/query.ts","../src/commands/gsc/presets.ts"],"sourcesContent":["import { appendFileSync, existsSync, readFileSync, writeFileSync } from \"node:fs\";\nimport { resolve } from \"node:path\";\nimport { defineCommand } from \"citty\";\nimport { apiPost } from \"../../client.ts\";\nimport { withWindowSpellings } from \"../../date-window.ts\";\nimport { registerSchema } from \"../../schemas.ts\";\nimport { buildQueryCacheKey, cacheGet, cacheSet, getQueryTtl } from \"../ads/cache.ts\";\nimport { rowsFileHolds, toCsvRow, writeAdsOutput, writeJsonEnvelope } from \"../ads/output.ts\";\nimport { refuseInvalidRowPosition } from \"../row-position.ts\";\nimport { GSC_PRESETS } from \"./presets.ts\";\nimport { handleGscSiteError, resolveSiteUrl } from \"./resolve.ts\";\n\nregisterSchema({\n command: \"gsc.query\",\n description:\n \"Run GSC Search Analytics queries. Use --preset for playbook-aligned queries (primary usage) or --dimensions for free-form queries. JSON rows keep their keys sorted; `columns` in the envelope lists them in the order asked for (dimensions, then clicks, impressions, ctr, position), the order csv, md and --out print.\",\n args: {\n \"site-url\": { type: \"string\", description: \"Site URL (auto-resolved if not provided)\", required: false },\n preset: {\n type: \"string\",\n description:\n \"Named preset (cannibalization, missed-revenue, brand-halo, negative-keywords, top-pages, top-queries)\",\n required: false,\n },\n brand: { type: \"string\", description: \"Brand name (required for brand-halo preset)\", required: false },\n dimensions: {\n type: \"string\",\n description: \"Comma-separated dimensions (escape hatch: query, page, country, device, date)\",\n required: false,\n },\n days: { type: \"string\", description: \"Lookback window in days (default: 28)\", required: false },\n \"start-date\": { type: \"string\", description: \"Explicit start date (YYYY-MM-DD)\", required: false },\n \"end-date\": { type: \"string\", description: \"Explicit end date (YYYY-MM-DD)\", required: false },\n \"row-limit\": { type: \"string\", description: \"Max rows (default: 1000, max: 25000)\", required: false },\n \"start-row\": {\n type: \"string\",\n description: \"Skip this many rows — read the rest of a full page with the nextStartRow it returned\",\n required: false,\n },\n type: { type: \"string\", description: \"Search type: web|image|video|news|discover (default: web)\", required: false },\n filter: { type: \"string\", description: \"Dimension filter groups as JSON string\", required: false },\n \"list-presets\": { type: \"boolean\", description: \"List available presets\", required: false },\n out: {\n type: \"string\",\n description: \"Write the rows alone to a file, not the envelope (.csv, .jsonl, .json — a bare array of rows)\",\n required: false,\n },\n append: { type: \"boolean\", description: \"Append to existing file\", required: false },\n output: { type: \"string\", description: \"Format: json|csv|jsonl|md\", required: false, default: \"json\" },\n \"no-cache\": { type: \"boolean\", description: \"Skip cache\", required: false },\n },\n});\n\ninterface QueryApiResponse {\n ok: boolean;\n /** The row keys in the order asked for: Convex hands the row objects back with their keys sorted. */\n columns?: string[];\n data?: Array<Record<string, unknown>>;\n truncated?: boolean;\n nextStartRow?: number;\n preset?: string;\n error?: { code: string; message: string };\n}\n\nfunction columnsOf(response: QueryApiResponse, rows: Array<Record<string, unknown>>): string[] {\n if (response.columns && response.columns.length > 0) return response.columns;\n const first = rows[0];\n return first ? Object.keys(first) : [];\n}\n\nfunction writeRowsToFile(\n filePath: string,\n rows: Array<Record<string, unknown>>,\n fields: string[],\n append: boolean,\n): void {\n const ext = filePath.split(\".\").pop()?.toLowerCase();\n if (ext === \"csv\") {\n if (!append || !existsSync(filePath)) {\n writeFileSync(filePath, `${toCsvRow(fields)}\\n`, \"utf-8\");\n }\n const csvRows = rows.map((row) => toCsvRow(fields.map((f) => String(row[f] ?? \"\"))));\n appendFileSync(filePath, `${csvRows.join(\"\\n\")}\\n`, \"utf-8\");\n } else if (ext === \"jsonl\") {\n const content = `${rows.map((row) => JSON.stringify(row)).join(\"\\n\")}\\n`;\n if (append && existsSync(filePath)) {\n appendFileSync(filePath, content, \"utf-8\");\n } else {\n writeFileSync(filePath, content, \"utf-8\");\n }\n } else if (append && existsSync(filePath)) {\n const existing = JSON.parse(readFileSync(filePath, \"utf-8\")) as unknown[];\n writeFileSync(filePath, JSON.stringify([...existing, ...rows], null, 2), \"utf-8\");\n } else {\n writeFileSync(filePath, JSON.stringify(rows, null, 2), \"utf-8\");\n }\n}\n\n/** Search Console never counts a report's rows, so a full page is said to be possibly cut, in every format. */\nfunction truncationHints(response: QueryApiResponse, rows: number, toFile: boolean): string[] {\n if (!response.truncated || response.nextStartRow === undefined) return [];\n return [\n `These ${rows.toLocaleString(\"en-US\")} rows filled the row limit, so Search Console may have more — do not total them as the whole report. ` +\n `Read the next rows with the same arguments plus --start-row ${response.nextStartRow}${toFile ? \" --append\" : \"\"} ` +\n \"until truncated is false.\",\n ];\n}\n\nfunction outputRows(\n rows: Array<Record<string, unknown>>,\n args: Record<string, unknown>,\n response: QueryApiResponse,\n cached: boolean,\n): void {\n const hints = truncationHints(response, rows.length, !!args.out);\n if (args.out) {\n const filePath = resolve(args.out as string);\n writeRowsToFile(filePath, rows, columnsOf(response, rows), !!args.append);\n writeJsonEnvelope({\n ok: true,\n file: filePath,\n holds: rowsFileHolds(filePath),\n rows: rows.length,\n ...(response.truncated !== undefined && { truncated: response.truncated }),\n ...(response.nextStartRow !== undefined && { nextStartRow: response.nextStartRow }),\n ...(cached && { cached: true }),\n ...(hints.length > 0 && { hints }),\n });\n return;\n }\n const format = (args.output as string) || \"json\";\n if (format !== \"json\") {\n writeAdsOutput(rows, format, columnsOf(response, rows), hints);\n return;\n }\n writeJsonEnvelope({ ...response, ...(cached && { cached: true }), ...(hints.length > 0 && { hints }) });\n}\n\nfunction buildRequestBody(args: Record<string, unknown>, siteUrl: string, useCache: boolean): Record<string, unknown> {\n const body: Record<string, unknown> = { siteUrl };\n if (args.preset) body.preset = args.preset;\n if (args.brand) body.brand = args.brand;\n if (args.dimensions) body.dimensions = (args.dimensions as string).split(\",\").map((d) => d.trim());\n if (args.days) body.days = Number(args.days);\n if (args[\"start-date\"]) body.startDate = args[\"start-date\"];\n if (args[\"end-date\"]) body.endDate = args[\"end-date\"];\n if (args[\"row-limit\"]) body.rowLimit = Number(args[\"row-limit\"]);\n if (args[\"start-row\"]) body.startRow = Number(args[\"start-row\"]);\n if (args.type) body.type = args.type;\n if (args.filter) body.filter = args.filter;\n if (!useCache) body.skipCache = true;\n return body;\n}\n\nexport const queryCommand = defineCommand({\n meta: {\n name: \"query\",\n description: `Run GSC Search Analytics queries. Preset-first with free-form escape hatch.\n\nPresets (primary usage):\n baker gsc query --preset cannibalization\n baker gsc query --preset brand-halo --brand \"Acme\" --days 90\n baker gsc query --list-presets\n\nFree-form (escape hatch):\n baker gsc query --dimensions \"query,page\" --days 28\n baker gsc query --dimensions \"query\" --row-limit 25000 --out keywords.csv\n\nA page that comes back full answers truncated: true and nextStartRow — read the rest with --start-row:\n baker gsc query --dimensions \"query,page\" --out qp.csv\n baker gsc query --dimensions \"query,page\" --out qp.csv --start-row 1000 --append\n\nColumns come in the order asked for: the dimensions, then clicks, impressions, ctr, position.\ncsv, md and --out print that order; JSON rows keep their keys sorted, so read them by name —\ncolumns in the envelope gives the order.`,\n },\n args: withWindowSpellings({\n \"site-url\": { type: \"string\", description: \"Site URL\", required: false },\n preset: { type: \"string\", description: \"Named preset\", required: false },\n brand: { type: \"string\", description: \"Brand name for brand-halo preset\", required: false },\n dimensions: { type: \"string\", description: \"Comma-separated dimensions\", required: false },\n days: { type: \"string\", description: \"Lookback days (default: 28)\", required: false },\n \"start-date\": { type: \"string\", description: \"Start date override\", required: false },\n \"end-date\": { type: \"string\", description: \"End date override\", required: false },\n \"row-limit\": { type: \"string\", description: \"Max rows (default: 1000)\", required: false },\n \"start-row\": {\n type: \"string\",\n description: \"Skip this many rows (the nextStartRow a full page returned)\",\n required: false,\n },\n type: { type: \"string\", description: \"Search type (default: web)\", required: false },\n filter: { type: \"string\", description: \"Filter JSON\", required: false },\n \"list-presets\": { type: \"boolean\", description: \"List presets\", required: false },\n out: { type: \"string\", description: \"Write the rows alone to this file (not the envelope)\", required: false },\n append: { type: \"boolean\", description: \"Append to file\", required: false },\n output: { type: \"string\", description: \"Format: json|csv|jsonl|md\", required: false, default: \"json\" },\n \"no-cache\": { type: \"boolean\", description: \"Skip cache\", required: false },\n }),\n run: async ({ args }) => {\n if (args[\"list-presets\"]) {\n writeJsonEnvelope({\n ok: true,\n data: GSC_PRESETS.map((p) => ({\n name: p.name,\n description: p.description,\n playbook: p.playbook,\n ...(p.requiresBrand && { requiresBrand: true }),\n })),\n });\n return;\n }\n\n if (!args.preset && !args.dimensions) {\n writeJsonEnvelope({\n ok: false,\n error: {\n code: \"VALIDATION_ERROR\",\n message: \"Provide --preset or --dimensions. Run --list-presets to see options.\",\n },\n });\n process.exit(1);\n }\n\n refuseInvalidRowPosition(\"--start-row\", args[\"start-row\"]);\n\n const siteUrl = await resolveSiteUrl(args);\n const useCache = !args[\"no-cache\"];\n const body = buildRequestBody(args, siteUrl, useCache);\n const cacheKey = buildQueryCacheKey(siteUrl, JSON.stringify(body));\n\n if (useCache) {\n const cached = cacheGet<QueryApiResponse>(\"gsc-queries-v3\", cacheKey);\n if (cached) {\n outputRows(cached.data.data ?? [], args, cached.data, true);\n return;\n }\n }\n\n try {\n const response = await apiPost<QueryApiResponse>(\"/api/gsc/query\", body);\n if (useCache) {\n cacheSet(\"gsc-queries-v3\", cacheKey, response, getQueryTtl(JSON.stringify(body)));\n }\n outputRows(response.data ?? [], args, response, false);\n } catch (err) {\n await handleGscSiteError(err, siteUrl);\n }\n },\n});\n","interface GscPreset {\n name: string;\n description: string;\n playbook: string;\n requiresBrand?: boolean;\n}\n\nexport const GSC_PRESETS: GscPreset[] = [\n {\n name: \"cannibalization\",\n description: \"PPC-SEO arbitrage — find queries ranking #1-2 organically where you also pay for ads\",\n playbook: \"[05] PPC-SEO Arbitrage\",\n },\n {\n name: \"missed-revenue\",\n description: \"High-impression queries with no PPC coverage (position > 10)\",\n playbook: \"[05] Opportunity Finder\",\n },\n {\n name: \"brand-halo\",\n description: \"Brand search volume trends — proves upper-funnel awareness lift\",\n playbook: \"[21] YouTube/DG ROI\",\n requiresBrand: true,\n },\n {\n name: \"negative-keywords\",\n description: \"Discover negative keyword candidates (login, support, cancel queries)\",\n playbook: \"Negative Keyword Discovery\",\n },\n {\n name: \"top-pages\",\n description: \"Top performing pages by clicks\",\n playbook: \"General\",\n },\n {\n name: \"top-queries\",\n description: \"Top search queries by clicks\",\n playbook: \"General\",\n },\n];\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,gBAAgB,YAAY,cAAc,qBAAqB;AACxE,SAAS,eAAe;AACxB,SAAS,qBAAqB;;;ACKvB,IAAM,cAA2B;AAAA,EACtC;AAAA,IACE,MAAM;AAAA,IACN,aAAa;AAAA,IACb,UAAU;AAAA,EACZ;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,aAAa;AAAA,IACb,UAAU;AAAA,EACZ;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,aAAa;AAAA,IACb,UAAU;AAAA,IACV,eAAe;AAAA,EACjB;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,aAAa;AAAA,IACb,UAAU;AAAA,EACZ;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,aAAa;AAAA,IACb,UAAU;AAAA,EACZ;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,aAAa;AAAA,IACb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