@koda-sl/baker-cli 0.5.1 → 0.9.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.
Files changed (124) hide show
  1. package/README.md +655 -162
  2. package/dist/cli.js +7 -3
  3. package/dist/cli.js.map +1 -1
  4. package/dist/commands/ads/cache.d.ts +8 -0
  5. package/dist/commands/ads/cache.d.ts.map +1 -0
  6. package/dist/commands/ads/cache.js +79 -0
  7. package/dist/commands/ads/cache.js.map +1 -0
  8. package/dist/commands/ads/cache.test.d.ts +2 -0
  9. package/dist/commands/ads/cache.test.d.ts.map +1 -0
  10. package/dist/commands/ads/cache.test.js +44 -0
  11. package/dist/commands/ads/cache.test.js.map +1 -0
  12. package/dist/commands/ads/field-descriptions.d.ts +2 -0
  13. package/dist/commands/ads/field-descriptions.d.ts.map +1 -0
  14. package/dist/commands/ads/field-descriptions.js +91 -0
  15. package/dist/commands/ads/field-descriptions.js.map +1 -0
  16. package/dist/commands/ads/google/accounts.d.ts +14 -0
  17. package/dist/commands/ads/google/accounts.d.ts.map +1 -0
  18. package/dist/commands/ads/google/accounts.js +72 -0
  19. package/dist/commands/ads/google/accounts.js.map +1 -0
  20. package/dist/commands/ads/google/changes.d.ts +29 -0
  21. package/dist/commands/ads/google/changes.d.ts.map +1 -0
  22. package/dist/commands/ads/google/changes.js +77 -0
  23. package/dist/commands/ads/google/changes.js.map +1 -0
  24. package/dist/commands/ads/google/correction-table.d.ts +3 -0
  25. package/dist/commands/ads/google/correction-table.d.ts.map +1 -0
  26. package/dist/commands/ads/google/correction-table.js +332 -0
  27. package/dist/commands/ads/google/correction-table.js.map +1 -0
  28. package/dist/commands/ads/google/currency.d.ts +13 -0
  29. package/dist/commands/ads/google/currency.d.ts.map +1 -0
  30. package/dist/commands/ads/google/currency.js +62 -0
  31. package/dist/commands/ads/google/currency.js.map +1 -0
  32. package/dist/commands/ads/google/error-parser.d.ts +3 -0
  33. package/dist/commands/ads/google/error-parser.d.ts.map +1 -0
  34. package/dist/commands/ads/google/error-parser.js +89 -0
  35. package/dist/commands/ads/google/error-parser.js.map +1 -0
  36. package/dist/commands/ads/google/error-parser.test.d.ts +2 -0
  37. package/dist/commands/ads/google/error-parser.test.d.ts.map +1 -0
  38. package/dist/commands/ads/google/error-parser.test.js +48 -0
  39. package/dist/commands/ads/google/error-parser.test.js.map +1 -0
  40. package/dist/commands/ads/google/index.d.ts +2 -0
  41. package/dist/commands/ads/google/index.d.ts.map +1 -0
  42. package/dist/commands/ads/google/index.js +30 -0
  43. package/dist/commands/ads/google/index.js.map +1 -0
  44. package/dist/commands/ads/google/keywords/discover.d.ts +49 -0
  45. package/dist/commands/ads/google/keywords/discover.d.ts.map +1 -0
  46. package/dist/commands/ads/google/keywords/discover.js +137 -0
  47. package/dist/commands/ads/google/keywords/discover.js.map +1 -0
  48. package/dist/commands/ads/google/keywords/index.d.ts +2 -0
  49. package/dist/commands/ads/google/keywords/index.d.ts.map +1 -0
  50. package/dist/commands/ads/google/keywords/index.js +18 -0
  51. package/dist/commands/ads/google/keywords/index.js.map +1 -0
  52. package/dist/commands/ads/google/keywords/metrics.d.ts +34 -0
  53. package/dist/commands/ads/google/keywords/metrics.d.ts.map +1 -0
  54. package/dist/commands/ads/google/keywords/metrics.js +109 -0
  55. package/dist/commands/ads/google/keywords/metrics.js.map +1 -0
  56. package/dist/commands/ads/google/preflight.d.ts +3 -0
  57. package/dist/commands/ads/google/preflight.d.ts.map +1 -0
  58. package/dist/commands/ads/google/preflight.js +115 -0
  59. package/dist/commands/ads/google/preflight.js.map +1 -0
  60. package/dist/commands/ads/google/preflight.test.d.ts +2 -0
  61. package/dist/commands/ads/google/preflight.test.d.ts.map +1 -0
  62. package/dist/commands/ads/google/preflight.test.js +50 -0
  63. package/dist/commands/ads/google/preflight.test.js.map +1 -0
  64. package/dist/commands/ads/google/presets.d.ts +12 -0
  65. package/dist/commands/ads/google/presets.d.ts.map +1 -0
  66. package/dist/commands/ads/google/presets.js +71 -0
  67. package/dist/commands/ads/google/presets.js.map +1 -0
  68. package/dist/commands/ads/google/presets.test.d.ts +2 -0
  69. package/dist/commands/ads/google/presets.test.d.ts.map +1 -0
  70. package/dist/commands/ads/google/presets.test.js +79 -0
  71. package/dist/commands/ads/google/presets.test.js.map +1 -0
  72. package/dist/commands/ads/google/query.d.ts +69 -0
  73. package/dist/commands/ads/google/query.d.ts.map +1 -0
  74. package/dist/commands/ads/google/query.js +305 -0
  75. package/dist/commands/ads/google/query.js.map +1 -0
  76. package/dist/commands/ads/index.d.ts +2 -0
  77. package/dist/commands/ads/index.d.ts.map +1 -0
  78. package/dist/commands/ads/index.js +19 -0
  79. package/dist/commands/ads/index.js.map +1 -0
  80. package/dist/commands/ads/output.d.ts +17 -0
  81. package/dist/commands/ads/output.d.ts.map +1 -0
  82. package/dist/commands/ads/output.js +78 -0
  83. package/dist/commands/ads/output.js.map +1 -0
  84. package/dist/commands/ads/output.test.d.ts +2 -0
  85. package/dist/commands/ads/output.test.d.ts.map +1 -0
  86. package/dist/commands/ads/output.test.js +100 -0
  87. package/dist/commands/ads/output.test.js.map +1 -0
  88. package/dist/commands/ads/types.d.ts +69 -0
  89. package/dist/commands/ads/types.d.ts.map +1 -0
  90. package/dist/commands/ads/types.js +2 -0
  91. package/dist/commands/ads/types.js.map +1 -0
  92. package/dist/commands/research/advertisers.d.ts +29 -0
  93. package/dist/commands/research/advertisers.d.ts.map +1 -0
  94. package/dist/commands/research/advertisers.js +71 -0
  95. package/dist/commands/research/advertisers.js.map +1 -0
  96. package/dist/commands/research/index.d.ts +2 -0
  97. package/dist/commands/research/index.d.ts.map +1 -0
  98. package/dist/commands/research/index.js +34 -0
  99. package/dist/commands/research/index.js.map +1 -0
  100. package/dist/commands/research/intent.d.ts +19 -0
  101. package/dist/commands/research/intent.d.ts.map +1 -0
  102. package/dist/commands/research/intent.js +67 -0
  103. package/dist/commands/research/intent.js.map +1 -0
  104. package/dist/commands/research/keyword-gap.d.ts +44 -0
  105. package/dist/commands/research/keyword-gap.d.ts.map +1 -0
  106. package/dist/commands/research/keyword-gap.js +92 -0
  107. package/dist/commands/research/keyword-gap.js.map +1 -0
  108. package/dist/commands/research/keywords-for-site.d.ts +39 -0
  109. package/dist/commands/research/keywords-for-site.d.ts.map +1 -0
  110. package/dist/commands/research/keywords-for-site.js +79 -0
  111. package/dist/commands/research/keywords-for-site.js.map +1 -0
  112. package/dist/commands/research/lighthouse.d.ts +19 -0
  113. package/dist/commands/research/lighthouse.d.ts.map +1 -0
  114. package/dist/commands/research/lighthouse.js +50 -0
  115. package/dist/commands/research/lighthouse.js.map +1 -0
  116. package/dist/commands/research/output.d.ts +26 -0
  117. package/dist/commands/research/output.d.ts.map +1 -0
  118. package/dist/commands/research/output.js +80 -0
  119. package/dist/commands/research/output.js.map +1 -0
  120. package/dist/env.d.ts +1 -0
  121. package/dist/env.d.ts.map +1 -1
  122. package/dist/env.js +5 -1
  123. package/dist/env.js.map +1 -1
  124. package/package.json +1 -1
@@ -0,0 +1,92 @@
1
+ import { defineCommand } from "citty";
2
+ import { apiPost } from "../../client.js";
3
+ import { registerSchema } from "../../schemas.js";
4
+ import { handleResearchError, writeResearchJson, writeResearchOutput } from "./output.js";
5
+ registerSchema({
6
+ command: "research.keyword-gap",
7
+ description: "Find keywords a competitor ranks for (organic or paid) that you don't. Discovers expansion opportunities.",
8
+ args: {
9
+ competitor: { type: "string", description: "Competitor domain (positional 1)", required: true },
10
+ ours: { type: "string", description: "Your domain (positional 2)", required: true },
11
+ location: {
12
+ type: "string",
13
+ description: "Country code (us, uk, es, de...) or DataForSEO location code. Default: us",
14
+ required: false,
15
+ },
16
+ language: { type: "string", description: "Language code or name (default: en)", required: false },
17
+ type: { type: "string", description: "Filter: paid, organic, all (default: all)", required: false },
18
+ limit: { type: "string", description: "Max results per page (default: 50, max: 1000)", required: false },
19
+ offset: { type: "string", description: "Pagination offset (default: 0)", required: false },
20
+ },
21
+ });
22
+ const FIELDS = {
23
+ keyword: "Keyword in the gap (they rank, you don't)",
24
+ search_volume: "Monthly search volume",
25
+ cpc: "Cost per click USD",
26
+ their_position: "Competitor's ranking position",
27
+ };
28
+ export const keywordGapCommand = defineCommand({
29
+ meta: {
30
+ name: "keyword-gap",
31
+ description: `Find keywords a competitor has that you don't. Supports pagination via --offset.
32
+
33
+ Examples:
34
+ baker research keyword-gap "competitor.com" "mysite.com"
35
+ baker research keyword-gap "competitor.com" "mysite.com" --type paid --limit 100
36
+ baker research keyword-gap "competitor.com" "mysite.com" --offset 50 --limit 50`,
37
+ },
38
+ args: {
39
+ competitor: { type: "positional", description: "Competitor domain", required: true },
40
+ ours: { type: "positional", description: "Your domain", required: true },
41
+ location: { type: "string", description: "Country code or location code (default: us)", required: false },
42
+ language: { type: "string", description: "Language code or name (default: en)", required: false },
43
+ type: { type: "string", description: "Filter: paid, organic, all (default: all)", required: false },
44
+ limit: { type: "string", description: "Max results per page (default: 50, max: 1000)", required: false },
45
+ offset: { type: "string", description: "Pagination offset (default: 0)", required: false },
46
+ output: { type: "string", description: "Format: json|csv|md|jsonl", required: false, default: "json" },
47
+ },
48
+ run: async ({ args }) => {
49
+ const competitor = args.competitor;
50
+ const ours = args.ours;
51
+ const location = args.location || undefined;
52
+ const language = args.language || undefined;
53
+ const type = args.type || undefined;
54
+ const limit = args.limit ? Number(args.limit) : undefined;
55
+ const offset = args.offset ? Number(args.offset) : undefined;
56
+ try {
57
+ const result = await apiPost("/api/research/keyword-gap", {
58
+ competitor,
59
+ ours,
60
+ location,
61
+ language,
62
+ type,
63
+ limit,
64
+ offset,
65
+ });
66
+ const currentOffset = offset ?? 0;
67
+ const currentLimit = limit ?? 50;
68
+ const hasMore = currentOffset + result.data.length < result.total_count;
69
+ const format = args.output || "json";
70
+ if (format !== "json") {
71
+ writeResearchOutput(result.data, format);
72
+ return;
73
+ }
74
+ writeResearchJson({
75
+ ok: true,
76
+ data: result.data,
77
+ fields: FIELDS,
78
+ total_count: result.total_count,
79
+ pagination: {
80
+ offset: currentOffset,
81
+ limit: currentLimit,
82
+ has_more: hasMore,
83
+ next_offset: hasMore ? currentOffset + currentLimit : undefined,
84
+ },
85
+ });
86
+ }
87
+ catch (err) {
88
+ handleResearchError(err);
89
+ }
90
+ },
91
+ });
92
+ //# sourceMappingURL=keyword-gap.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"keyword-gap.js","sourceRoot":"","sources":["../../../src/commands/research/keyword-gap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAE1F,cAAc,CAAC;IACb,OAAO,EAAE,sBAAsB;IAC/B,WAAW,EACT,2GAA2G;IAC7G,IAAI,EAAE;QACJ,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,kCAAkC,EAAE,QAAQ,EAAE,IAAI,EAAE;QAC/F,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,4BAA4B,EAAE,QAAQ,EAAE,IAAI,EAAE;QACnF,QAAQ,EAAE;YACR,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,2EAA2E;YACxF,QAAQ,EAAE,KAAK;SAChB;QACD,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,qCAAqC,EAAE,QAAQ,EAAE,KAAK,EAAE;QACjG,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,2CAA2C,EAAE,QAAQ,EAAE,KAAK,EAAE;QACnG,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,+CAA+C,EAAE,QAAQ,EAAE,KAAK,EAAE;QACxG,MAAM,EAAE,EAAE,I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AC,IAAI;gBACjB,MAAM,EAAE,MAAM;gBACd,WAAW,EAAE,MAAM,CAAC,WAAW;gBAC/B,UAAU,EAAE;oBACV,MAAM,EAAE,aAAa;oBACrB,KAAK,EAAE,YAAY;oBACnB,QAAQ,EAAE,OAAO;oBACjB,WAAW,EAAE,OAAO,CAAC,CAAC,CAAC,aAAa,GAAG,YAAY,CAAC,CAAC,CAAC,SAAS;iBAChE;aACF,CAAC,CAAC;QACL,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,mBAAmB,CAAC,GAAG,CAAC,CAAC;QAC3B,CAAC;IACH,CAAC;CACF,CAAC,CAAC"}
@@ -0,0 +1,39 @@
1
+ export declare const keywordsForSiteCommand: import("citty").CommandDef<{
2
+ readonly target: {
3
+ readonly type: "positional";
4
+ readonly description: "Domain or URL to analyze";
5
+ readonly required: true;
6
+ };
7
+ readonly location: {
8
+ readonly type: "string";
9
+ readonly description: "Country code or location code (default: us)";
10
+ readonly required: false;
11
+ };
12
+ readonly language: {
13
+ readonly type: "string";
14
+ readonly description: "Language code or name (default: en)";
15
+ readonly required: false;
16
+ };
17
+ readonly sort: {
18
+ readonly type: "string";
19
+ readonly description: "Sort: relevance, search_volume, competition, cpc";
20
+ readonly required: false;
21
+ };
22
+ readonly type: {
23
+ readonly type: "string";
24
+ readonly description: "Filter: paid, organic, all (default: all)";
25
+ readonly required: false;
26
+ };
27
+ readonly limit: {
28
+ readonly type: "string";
29
+ readonly description: "Max results (default: 50, max: 1000)";
30
+ readonly required: false;
31
+ };
32
+ readonly output: {
33
+ readonly type: "string";
34
+ readonly description: "Format: json|csv|md|jsonl";
35
+ readonly required: false;
36
+ readonly default: "json";
37
+ };
38
+ }>;
39
+ //# sourceMappingURL=keywords-for-site.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"keywords-for-site.d.ts","sourceRoot":"","sources":["../../../src/commands/research/keywords-for-site.ts"],"names":[],"mappings":"AA2CA,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+CjC,CAAC"}
@@ -0,0 +1,79 @@
1
+ import { defineCommand } from "citty";
2
+ import { apiPost } from "../../client.js";
3
+ import { registerSchema } from "../../schemas.js";
4
+ import { handleResearchError, writeResearchJson, writeResearchOutput } from "./output.js";
5
+ registerSchema({
6
+ command: "research.keywords-for-site",
7
+ description: "Get keywords a competitor targets in Google. Use --type paid to see only paid keywords, --type organic for organic only.",
8
+ args: {
9
+ target: { type: "string", description: "Domain or URL to analyze (positional)", required: true },
10
+ location: {
11
+ type: "string",
12
+ description: "Country code (us, uk, es, de...) or DataForSEO location code. Default: us",
13
+ required: false,
14
+ },
15
+ language: { type: "string", description: "Language code or name (default: en)", required: false },
16
+ sort: {
17
+ type: "string",
18
+ description: "Sort: relevance, search_volume, competition, cpc (default: search_volume)",
19
+ required: false,
20
+ },
21
+ type: { type: "string", description: "Filter: paid, organic, all (default: all)", required: false },
22
+ limit: { type: "string", description: "Max results (default: 50, max: 1000)", required: false },
23
+ },
24
+ });
25
+ const FIELDS = {
26
+ keyword: "Keyword the site targets",
27
+ search_volume: "Monthly search volume",
28
+ cpc: "Cost per click in USD",
29
+ competition: "LOW, MEDIUM, or HIGH",
30
+ competition_index: "Competition score 0-100",
31
+ };
32
+ export const keywordsForSiteCommand = defineCommand({
33
+ meta: {
34
+ name: "keywords-for-site",
35
+ description: `Get keywords a competitor targets in Google. Use --type to filter paid/organic.
36
+
37
+ Examples:
38
+ baker research keywords-for-site "competitor.com"
39
+ baker research keywords-for-site "competitor.com" --type paid --limit 20
40
+ baker research keywords-for-site "competitor.com" --type organic --location uk`,
41
+ },
42
+ args: {
43
+ target: { type: "positional", description: "Domain or URL to analyze", required: true },
44
+ location: { type: "string", description: "Country code or location code (default: us)", required: false },
45
+ language: { type: "string", description: "Language code or name (default: en)", required: false },
46
+ sort: { type: "string", description: "Sort: relevance, search_volume, competition, cpc", required: false },
47
+ type: { type: "string", description: "Filter: paid, organic, all (default: all)", required: false },
48
+ limit: { type: "string", description: "Max results (default: 50, max: 1000)", required: false },
49
+ output: { type: "string", description: "Format: json|csv|md|jsonl", required: false, default: "json" },
50
+ },
51
+ run: async ({ args }) => {
52
+ const target = args.target;
53
+ const location = args.location || undefined;
54
+ const language = args.language || undefined;
55
+ const sort = args.sort || undefined;
56
+ const type = args.type || undefined;
57
+ const limit = args.limit ? Number(args.limit) : undefined;
58
+ try {
59
+ const data = await apiPost("/api/research/keywords-for-site", {
60
+ target,
61
+ location,
62
+ language,
63
+ sort,
64
+ type,
65
+ limit,
66
+ });
67
+ const format = args.output || "json";
68
+ if (format !== "json") {
69
+ writeResearchOutput(data, format);
70
+ return;
71
+ }
72
+ writeResearchJson({ ok: true, data, fields: FIELDS });
73
+ }
74
+ catch (err) {
75
+ handleResearchError(err);
76
+ }
77
+ },
78
+ });
79
+ //# sourceMappingURL=keywords-for-site.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"keywords-for-site.js","sourceRoot":"","sources":["../../../src/commands/research/keywords-for-site.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAE1F,cAAc,CAAC;IACb,OAAO,EAAE,4BAA4B;IACrC,WAAW,EACT,0HAA0H;IAC5H,IAAI,EAAE;QACJ,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,uCAAuC,EAAE,QAAQ,EAAE,IAAI,EAAE;QAChG,QAAQ,EAAE;YACR,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,2EAA2E;YACxF,QAAQ,EAAE,KAAK;SAChB;QACD,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,E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AAC;CACF,CAAC,CAAC"}
@@ -0,0 +1,19 @@
1
+ export declare const lighthouseCommand: import("citty").CommandDef<{
2
+ readonly url: {
3
+ readonly type: "positional";
4
+ readonly description: "Full URL to audit (with https://)";
5
+ readonly required: true;
6
+ };
7
+ readonly mobile: {
8
+ readonly type: "string";
9
+ readonly description: "Test as mobile: true|false (default: true)";
10
+ readonly required: false;
11
+ };
12
+ readonly output: {
13
+ readonly type: "string";
14
+ readonly description: "Format: json|csv|md|jsonl";
15
+ readonly required: false;
16
+ readonly default: "json";
17
+ };
18
+ }>;
19
+ //# sourceMappingURL=lighthouse.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lighthouse.d.ts","sourceRoot":"","sources":["../../../src/commands/research/lighthouse.ts"],"names":[],"mappings":"AAiCA,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;EA6B5B,CAAC"}
@@ -0,0 +1,50 @@
1
+ import { defineCommand } from "citty";
2
+ import { apiPost } from "../../client.js";
3
+ import { registerSchema } from "../../schemas.js";
4
+ import { handleResearchError, writeResearchJson } from "./output.js";
5
+ registerSchema({
6
+ command: "research.lighthouse",
7
+ description: "Landing page performance audit. Returns metrics that affect Google Ads Quality Score and CPC.",
8
+ args: {
9
+ url: { type: "string", description: "Full URL to audit (with https://)", required: true },
10
+ mobile: { type: "boolean", description: "Test as mobile (default: true)", required: false },
11
+ },
12
+ });
13
+ const FIELDS = {
14
+ performance_score: "Lighthouse performance score 0-100 (aim for 90+)",
15
+ fcp_ms: "First Contentful Paint in ms (good: < 1800)",
16
+ lcp_ms: "Largest Contentful Paint in ms (good: < 2500)",
17
+ cls: "Cumulative Layout Shift (good: < 0.1)",
18
+ speed_index_ms: "Speed Index in ms (good: < 3400)",
19
+ interactive_ms: "Time to Interactive in ms (good: < 3800)",
20
+ };
21
+ export const lighthouseCommand = defineCommand({
22
+ meta: {
23
+ name: "lighthouse",
24
+ description: `Landing page performance audit. Metrics affecting Google Ads Quality Score.
25
+
26
+ Examples:
27
+ baker research lighthouse "https://example.com/landing"
28
+ baker research lighthouse "https://example.com" --mobile false`,
29
+ },
30
+ args: {
31
+ url: { type: "positional", description: "Full URL to audit (with https://)", required: true },
32
+ mobile: { type: "string", description: "Test as mobile: true|false (default: true)", required: false },
33
+ output: { type: "string", description: "Format: json|csv|md|jsonl", required: false, default: "json" },
34
+ },
35
+ run: async ({ args }) => {
36
+ const url = args.url;
37
+ const mobile = args.mobile === "false" ? false : undefined;
38
+ try {
39
+ const data = await apiPost("/api/research/lighthouse", {
40
+ url,
41
+ mobile,
42
+ });
43
+ writeResearchJson({ ok: true, data, fields: FIELDS });
44
+ }
45
+ catch (err) {
46
+ handleResearchError(err);
47
+ }
48
+ },
49
+ });
50
+ //# sourceMappingURL=lighthouse.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lighthouse.js","sourceRoot":"","sources":["../../../src/commands/research/lighthouse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAErE,cAAc,CAAC;IACb,OAAO,EAAE,qBAAqB;IAC9B,WAAW,EAAE,+FAA+F;IAC5G,IAAI,EAAE;QACJ,GAAG,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,mCAAmC,EAAE,QAAQ,EAAE,IAAI,EAAE;QACzF,MAAM,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,gCAAgC,EAAE,QAAQ,EAAE,KAAK,EAAE;KAC5F;CACF,CAAC,CAAC;AAYH,MAAM,MAAM,GAA2B;IACrC,iBAAiB,EAAE,kDAAkD;IACrE,MAAM,EAAE,6CAA6C;IACrD,MAAM,EAAE,+CAA+C;IACvD,GAAG,EAA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Envelope<T> {
8
+ ok: true;
9
+ data: T;
10
+ fields?: Record<string, string>;
11
+ total_count?: number;
12
+ pagination?: PaginationInfo;
13
+ }
14
+ interface ResearchErrorEnvelope {
15
+ ok: false;
16
+ error: {
17
+ code: string;
18
+ message: string;
19
+ };
20
+ }
21
+ type ResearchOutput = ResearchSuccessEnvelope<unknown> | ResearchErrorEnvelope;
22
+ export declare function writeResearchJson(envelope: ResearchOutput): void;
23
+ export declare function writeResearchOutput(data: Array<Record<string, unknown>>, format: string, fields?: string[]): void;
24
+ export declare function handleResearchError(err: unknown): never;
25
+ export {};
26
+ //# sourceMappingURL=output.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"output.d.ts","sourceRoot":"","sources":["../../../src/commands/research/output.ts"],"names":[],"mappings":"AAEA,UAAU,cAAc;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,UAAU,uBAAuB,CAAC,CAAC;IACjC,EAAE,EAAE,IAAI,CAAC;IACT,IAAI,EAAE,CAAC,CAAC;IACR,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,cAAc,CAAC;CAC7B;AAED,UAAU,qBAAqB;IAC7B,EAAE,EAAE,KAAK,CAAC;IACV,KAAK,EAAE;QACL,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;CACH;AAED,KAAK,cAAc,GAAG,uBAAuB,CAAC,OAAO,CAAC,GAAG,qBAAqB,CAAC;AAE/E,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,cAAc,GAAG,IAAI,CAEhE;AAgDD,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAcjH;AAED,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,OAAO,GAAG,KAAK,CAgBvD"}
@@ -0,0 +1,80 @@
1
+ import { ApiError } from "../../client.js";
2
+ export function writeResearchJson(envelope) {
3
+ process.stdout.write(`${JSON.stringify(envelope, null, 2)}\n`);
4
+ }
5
+ function toCsvRow(values) {
6
+ return values
7
+ .map((v) => {
8
+ if (v.includes(",") || v.includes('"') || v.includes("\n")) {
9
+ return `"${v.replace(/"/g, '""')}"`;
10
+ }
11
+ return v;
12
+ })
13
+ .join(",");
14
+ }
15
+ function flattenRow(row) {
16
+ const flat = {};
17
+ for (const [key, val] of Object.entries(row)) {
18
+ flat[key] = typeof val === "object" && val !== null ? JSON.stringify(val) : String(val ?? "");
19
+ }
20
+ return flat;
21
+ }
22
+ function writeCsv(data, fields) {
23
+ if (data.length === 0)
24
+ return;
25
+ const cols = fields ?? Object.keys(data[0] ?? {});
26
+ process.stdout.write(`${toCsvRow(cols)}\n`);
27
+ for (const row of data) {
28
+ const flat = flattenRow(row);
29
+ process.stdout.write(`${toCsvRow(cols.map((f) => flat[f] ?? ""))}\n`);
30
+ }
31
+ }
32
+ function writeJsonl(data) {
33
+ for (const row of data) {
34
+ process.stdout.write(`${JSON.stringify(row)}\n`);
35
+ }
36
+ }
37
+ function writeMd(data, fields) {
38
+ if (data.length === 0)
39
+ return;
40
+ const cols = fields ?? Object.keys(data[0] ?? {});
41
+ process.stdout.write(`| ${cols.join(" | ")} |\n`);
42
+ process.stdout.write(`| ${cols.map(() => "---").join(" | ")} |\n`);
43
+ for (const row of data) {
44
+ const flat = flattenRow(row);
45
+ process.stdout.write(`| ${cols.map((f) => flat[f] ?? "").join(" | ")} |\n`);
46
+ }
47
+ }
48
+ export function writeResearchOutput(data, format, fields) {
49
+ switch (format) {
50
+ case "csv":
51
+ writeCsv(data, fields);
52
+ break;
53
+ case "jsonl":
54
+ writeJsonl(data);
55
+ break;
56
+ case "md":
57
+ writeMd(data, fields);
58
+ break;
59
+ default:
60
+ writeResearchJson({ ok: true, data });
61
+ }
62
+ }
63
+ export function handleResearchError(err) {
64
+ if (err instanceof ApiError) {
65
+ writeResearchJson({
66
+ ok: false,
67
+ error: {
68
+ code: err.code,
69
+ message: err.message,
70
+ },
71
+ });
72
+ process.exit(1);
73
+ }
74
+ writeResearchJson({
75
+ ok: false,
76
+ error: { code: "NETWORK_ERROR", message: err instanceof Error ? err.message : "Unexpected error" },
77
+ });
78
+ process.exit(1);
79
+ }
80
+ //# sourceMappingURL=output.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"output.js","sourceRoot":"","sources":["../../../src/commands/research/output.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AA2B3C,MAAM,UAAU,iBAAiB,CAAC,QAAwB;IACxD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;AACjE,CAAC;AAED,SAAS,QAAQ,CAAC,MAAgB;IAChC,OAAO,MAAM;SACV,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;QACT,IAAI,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;YAC3D,OAAO,IAAI,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC;QACtC,CAAC;QACD,OAAO,CAAC,CAAC;IACX,CAAC,CAAC;SACD,IAAI,CAAC,GAAG,CAAC,CAAC;AACf,CAAC;AAED,SAAS,UAAU,CAAC,GAA4B;IAC9C,MAAM,IAAI,GAA2B,EAAE,CAAC;IACxC,KAAK,M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AAK;YACT,KAAK,EAAE;gBACL,IAAI,EAAE,GAAG,CAAC,IAAI;gBACd,OAAO,EAAE,GAAG,CAAC,OAAO;aACrB;SACF,CAAC,CAAC;QACH,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IACD,iBAAiB,CAAC;QAChB,EAAE,EAAE,KAAK;QACT,KAAK,EAAE,EAAE,IAAI,EAAE,eAAe,EAAE,OAAO,EAAE,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,kBAAkB,EAAE;KACnG,CAAC,CAAC;IACH,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC"}
package/dist/env.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  type Env = {
2
2
  BAKER_API_KEY: string;
3
3
  BAKER_API_URL: string;
4
+ BAKER_GOOGLE_ADS_CUSTOMER_ID?: string;
4
5
  };
5
6
  export declare function getEnv(): Env;
6
7
  export {};
package/dist/env.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../src/env.ts"],"names":[],"mappings":"AAGA,KAAK,GAAG,GAAG;IACT,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AAIF,wBAAgB,MAAM,IAAI,GAAG,CAW5B"}
1
+ {"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../src/env.ts"],"names":[],"mappings":"AAGA,KAAK,GAAG,GAAG;IACT,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,4BAA4B,CAAC,EAAE,MAAM,CAAC;CACvC,CAAC;AAIF,wBAAgB,MAAM,IAAI,GAAG,CAe5B"}
package/dist/env.js CHANGED
@@ -6,7 +6,11 @@ export function getEnv() {
6
6
  cached = createEnv({
7
7
  server: {
8
8
  BAKER_API_KEY: z.string().startsWith("bk_", "API key must start with 'bk_'"),
9
- BAKER_API_URL: z.string().url("BAKER_API_URL must be a valid URL"),
9
+ BAKER_API_URL: z.url("BAKER_API_URL must be a valid URL"),
10
+ BAKER_GOOGLE_ADS_CUSTOMER_ID: z
11
+ .string()
12
+ .regex(/^\d{10}$/)
13
+ .optional(),
10
14
  },
11
15
  runtimeEnv: process.env,
12
16
  });
package/dist/env.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"env.js","sourceRoot":"","sources":["../src/env.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,IAAI,MAAuB,CAAC;AAE5B,MAAM,UAAU,MAAM;IACpB,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,GAAG,SAAS,CAAC;YACjB,MAAM,EAAE;gBACN,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,+BAA+B,CAAC;gBAC5E,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,mCAAmC,CAAC;aACnE;YACD,UAAU,EAAE,OAAO,CAAC,GAAG;SACxB,CAAC,CAAC;IACL,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
1
+ {"version":3,"file":"env.js","sourceRoot":"","sources":["../src/env.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB,IAAI,MAAuB,CAAC;AAE5B,MAAM,UAAU,MAAM;IACpB,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,GAAG,SAAS,CAAC;YACjB,MAAM,EAAE;gBACN,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,+BAA+B,CAAC;gBAC5E,aAAa,EAAE,CAAC,CAAC,GAAG,CAAC,mCAAmC,CAAC;gBACzD,4BAA4B,EAAE,CAAC;qBAC5B,MAAM,EAAE;qBACR,KAAK,CAAC,UAAU,CAAC;qBACjB,QAAQ,EAAE;aACd;YACD,UAAU,EAAE,OAAO,CAAC,GAAG;SACxB,CAAC,CAAC;IACL,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@koda-sl/baker-cli",
3
- "version": "0.5.1",
3
+ "version": "0.9.0",
4
4
  "description": "AI-agent-first CLI for interacting with Baker",
5
5
  "type": "module",
6
6
  "bin": {