@koda-sl/baker-cli 0.28.1 → 0.31.0-dev.31ee8d9c

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 (74) hide show
  1. package/README.md +279 -15
  2. package/dist/cli.js +1 -1
  3. package/dist/commands/actions/complete.d.ts +2 -2
  4. package/dist/commands/actions/complete.d.ts.map +1 -1
  5. package/dist/commands/actions/complete.js +10 -8
  6. package/dist/commands/actions/complete.js.map +1 -1
  7. package/dist/commands/actions/shared.d.ts +1 -0
  8. package/dist/commands/actions/shared.d.ts.map +1 -1
  9. package/dist/commands/actions/shared.js +3 -0
  10. package/dist/commands/actions/shared.js.map +1 -1
  11. package/dist/commands/images/extract.d.ts +23 -0
  12. package/dist/commands/images/extract.d.ts.map +1 -0
  13. package/dist/commands/images/extract.js +53 -0
  14. package/dist/commands/images/extract.js.map +1 -0
  15. package/dist/commands/images/find.d.ts +33 -0
  16. package/dist/commands/images/find.d.ts.map +1 -0
  17. package/dist/commands/images/find.js +70 -0
  18. package/dist/commands/images/find.js.map +1 -0
  19. package/dist/commands/images/gif.d.ts +33 -0
  20. package/dist/commands/images/gif.d.ts.map +1 -0
  21. package/dist/commands/images/gif.js +81 -0
  22. package/dist/commands/images/gif.js.map +1 -0
  23. package/dist/commands/images/google.d.ts +38 -0
  24. package/dist/commands/images/google.d.ts.map +1 -0
  25. package/dist/commands/images/google.js +77 -0
  26. package/dist/commands/images/google.js.map +1 -0
  27. package/dist/commands/images/icon.d.ts +23 -0
  28. package/dist/commands/images/icon.d.ts.map +1 -0
  29. package/dist/commands/images/icon.js +57 -0
  30. package/dist/commands/images/icon.js.map +1 -0
  31. package/dist/commands/images/index.d.ts.map +1 -1
  32. package/dist/commands/images/index.js +45 -7
  33. package/dist/commands/images/index.js.map +1 -1
  34. package/dist/commands/images/ingest.d.ts +28 -0
  35. package/dist/commands/images/ingest.d.ts.map +1 -0
  36. package/dist/commands/images/ingest.js +60 -0
  37. package/dist/commands/images/ingest.js.map +1 -0
  38. package/dist/commands/images/library.d.ts +55 -0
  39. package/dist/commands/images/library.d.ts.map +1 -0
  40. package/dist/commands/images/library.js +86 -0
  41. package/dist/commands/images/library.js.map +1 -0
  42. package/dist/commands/images/logo.d.ts +18 -0
  43. package/dist/commands/images/logo.d.ts.map +1 -0
  44. package/dist/commands/images/logo.js +49 -0
  45. package/dist/commands/images/logo.js.map +1 -0
  46. package/dist/commands/images/meme.d.ts +28 -0
  47. package/dist/commands/images/meme.d.ts.map +1 -0
  48. package/dist/commands/images/meme.js +66 -0
  49. package/dist/commands/images/meme.js.map +1 -0
  50. package/dist/commands/images/screenshot.d.ts +23 -0
  51. package/dist/commands/images/screenshot.d.ts.map +1 -0
  52. package/dist/commands/images/screenshot.js +64 -0
  53. package/dist/commands/images/screenshot.js.map +1 -0
  54. package/dist/commands/images/search.d.ts.map +1 -1
  55. package/dist/commands/images/search.js +1 -0
  56. package/dist/commands/images/search.js.map +1 -1
  57. package/dist/commands/images/sticker.d.ts +33 -0
  58. package/dist/commands/images/sticker.d.ts.map +1 -0
  59. package/dist/commands/images/sticker.js +81 -0
  60. package/dist/commands/images/sticker.js.map +1 -0
  61. package/dist/commands/images/stock.d.ts +58 -0
  62. package/dist/commands/images/stock.d.ts.map +1 -0
  63. package/dist/commands/images/stock.js +116 -0
  64. package/dist/commands/images/stock.js.map +1 -0
  65. package/dist/commands/images/use.d.ts +18 -0
  66. package/dist/commands/images/use.d.ts.map +1 -0
  67. package/dist/commands/images/use.js +57 -0
  68. package/dist/commands/images/use.js.map +1 -0
  69. package/dist/output.d.ts.map +1 -1
  70. package/dist/output.js +1 -0
  71. package/dist/output.js.map +1 -1
  72. package/dist/output.test.js +1 -0
  73. package/dist/output.test.js.map +1 -1
  74. package/package.json +1 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"find.js","sourceRoot":"","sources":["../../../src/commands/images/find.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,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,CAAC;YACxC,IAAI,IAAI,CAAC,SAAS;gBAAE,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;YAC5D,IAAI,IAAI,CAAC,aAAa,CAAC;gBAAE,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC;YAEvE,MAAM,IAAI,GAAG,MAAM,OAAO,CAA0B,kBAAkB,EAAE,IAAI,CAAC,CAAC;YAC9E,SAAS,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;QAChC,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,IAAI,GAAG,YAAY,QAAQ,EAAE,CAAC;gBAC5B,SAAS,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;gBAC1E,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAClB,CAAC;YACD,SAAS,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE,OAAO,EAAE,kBAAkB,EAAE,EAAE,CAAC,CAAC;YACzF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC;CACF,CAAC,CAAC"}
@@ -0,0 +1,33 @@
1
+ export declare const gifCommand: import("citty").CommandDef<{
2
+ readonly query: {
3
+ readonly type: "positional";
4
+ readonly description: "Search query (omit with --trending)";
5
+ readonly required: false;
6
+ };
7
+ readonly trending: {
8
+ readonly type: "boolean";
9
+ readonly description: "Trending feed";
10
+ readonly required: false;
11
+ };
12
+ readonly limit: {
13
+ readonly type: "string";
14
+ readonly description: "Max results";
15
+ readonly required: false;
16
+ };
17
+ readonly rating: {
18
+ readonly type: "string";
19
+ readonly description: "Content rating";
20
+ readonly required: false;
21
+ };
22
+ readonly lang: {
23
+ readonly type: "string";
24
+ readonly description: "Language code";
25
+ readonly required: false;
26
+ };
27
+ readonly "auto-ingest": {
28
+ readonly type: "string";
29
+ readonly description: "Auto-ingest top N";
30
+ readonly required: false;
31
+ };
32
+ }>;
33
+ //# sourceMappingURL=gif.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gif.d.ts","sourceRoot":"","sources":["../../../src/commands/images/gif.ts"],"names":[],"mappings":"AAgCA,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4CrB,CAAC"}
@@ -0,0 +1,81 @@
1
+ import { defineCommand } from "citty";
2
+ import { ApiError, apiPost } from "../../client.js";
3
+ import { writeJson } from "../../output.js";
4
+ import { registerSchema } from "../../schemas.js";
5
+ registerSchema({
6
+ command: "images.gif",
7
+ description: "Search Giphy for GIFs / reaction memes (paid social creative).",
8
+ args: {
9
+ query: { type: "string", description: "Search query (omit when --trending)", required: false },
10
+ trending: {
11
+ type: "boolean",
12
+ description: "Return the trending GIF feed instead of running a query",
13
+ required: false,
14
+ default: false,
15
+ },
16
+ limit: { type: "number", description: "Max results (default 20, max 50)", required: false, default: 20 },
17
+ rating: {
18
+ type: "string",
19
+ description: "Content rating: g | pg | pg-13 | r (default pg)",
20
+ required: false,
21
+ },
22
+ lang: { type: "string", description: "ISO 639-1 language code, e.g. en, es", required: false },
23
+ "auto-ingest": {
24
+ type: "number",
25
+ description: "Auto-ingest top N hits (default 0 — browse-style)",
26
+ required: false,
27
+ default: 0,
28
+ },
29
+ },
30
+ });
31
+ export const gifCommand = defineCommand({
32
+ meta: {
33
+ name: "gif",
34
+ description: "Search Giphy for GIFs / reaction memes — built for paid-social creative (Meta, TikTok, LinkedIn, X). Free API. Each hit carries WebP + GIF + MP4 URLs in providerMeta so you can pick the right format per platform.\n\nExample: baker images gif 'this is fine' --limit 10\nExample: baker images gif 'office reaction' --rating pg --auto-ingest 2\nExample: baker images gif --trending --limit 25",
35
+ },
36
+ args: {
37
+ query: { type: "positional", description: "Search query (omit with --trending)", required: false },
38
+ trending: { type: "boolean", description: "Trending feed", required: false },
39
+ limit: { type: "string", description: "Max results", required: false },
40
+ rating: { type: "string", description: "Content rating", required: false },
41
+ lang: { type: "string", description: "Language code", required: false },
42
+ "auto-ingest": { type: "string", description: "Auto-ingest top N", required: false },
43
+ },
44
+ run: async ({ args }) => {
45
+ try {
46
+ const query = args.query;
47
+ const trending = args.trending === true;
48
+ if (!query && !trending) {
49
+ writeJson({
50
+ ok: false,
51
+ error: { code: "VALIDATION_ERROR", message: "Query is required unless --trending is set" },
52
+ });
53
+ process.exit(1);
54
+ }
55
+ const body = {};
56
+ if (query)
57
+ body.query = query;
58
+ if (trending)
59
+ body.trending = true;
60
+ if (args.limit)
61
+ body.limit = Number(args.limit);
62
+ if (args.rating)
63
+ body.rating = args.rating;
64
+ if (args.lang)
65
+ body.lang = args.lang;
66
+ if (args["auto-ingest"])
67
+ body.autoIngest = Number(args["auto-ingest"]);
68
+ const data = await apiPost("/api/images/gif", body);
69
+ writeJson({ ok: true, data });
70
+ }
71
+ catch (err) {
72
+ if (err instanceof ApiError) {
73
+ writeJson({ ok: false, error: { code: err.code, message: err.message } });
74
+ process.exit(1);
75
+ }
76
+ writeJson({ ok: false, error: { code: "INTERNAL_ERROR", message: "Unexpected error" } });
77
+ process.exit(1);
78
+ }
79
+ },
80
+ });
81
+ //# sourceMappingURL=gif.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gif.js","sourceRoot":"","sources":["../../../src/commands/images/gif.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,cAAc,C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,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC;YAEvE,MAAM,IAAI,GAAG,MAAM,OAAO,CAA0B,iBAAiB,EAAE,IAAI,CAAC,CAAC;YAC7E,SAAS,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;QAChC,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,IAAI,GAAG,YAAY,QAAQ,EAAE,CAAC;gBAC5B,SAAS,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;gBAC1E,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAClB,CAAC;YACD,SAAS,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE,OAAO,EAAE,kBAAkB,EAAE,EAAE,CAAC,CAAC;YACzF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC;CACF,CAAC,CAAC"}
@@ -0,0 +1,38 @@
1
+ export declare const googleCommand: import("citty").CommandDef<{
2
+ readonly query: {
3
+ readonly type: "positional";
4
+ readonly description: "Search query";
5
+ readonly required: false;
6
+ };
7
+ readonly type: {
8
+ readonly type: "string";
9
+ readonly description: "imgType filter";
10
+ readonly required: false;
11
+ };
12
+ readonly size: {
13
+ readonly type: "string";
14
+ readonly description: "imgSize filter";
15
+ readonly required: false;
16
+ };
17
+ readonly color: {
18
+ readonly type: "string";
19
+ readonly description: "imgColorType filter";
20
+ readonly required: false;
21
+ };
22
+ readonly safe: {
23
+ readonly type: "string";
24
+ readonly description: "safe (off|active)";
25
+ readonly required: false;
26
+ };
27
+ readonly limit: {
28
+ readonly type: "string";
29
+ readonly description: "Max results (1-50)";
30
+ readonly required: false;
31
+ };
32
+ readonly "auto-ingest": {
33
+ readonly type: "string";
34
+ readonly description: "Auto-ingest top N";
35
+ readonly required: false;
36
+ };
37
+ }>;
38
+ //# sourceMappingURL=google.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"google.d.ts","sourceRoot":"","sources":["../../../src/commands/images/google.ts"],"names":[],"mappings":"AAgCA,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyCxB,CAAC"}
@@ -0,0 +1,77 @@
1
+ import { defineCommand } from "citty";
2
+ import { ApiError, apiPost } from "../../client.js";
3
+ import { writeJson } from "../../output.js";
4
+ import { registerSchema } from "../../schemas.js";
5
+ registerSchema({
6
+ command: "images.google",
7
+ description: "Google Images search via the official Custom Search JSON API. Unverified source — inspect before placing.",
8
+ args: {
9
+ query: { type: "string", description: "Search query", required: true },
10
+ type: {
11
+ type: "string",
12
+ description: "imgType: photo | clipart | lineart | stock | animated | face | news",
13
+ required: false,
14
+ },
15
+ size: {
16
+ type: "string",
17
+ description: "imgSize: icon | small | medium | large | xlarge | xxlarge | huge",
18
+ required: false,
19
+ },
20
+ color: {
21
+ type: "string",
22
+ description: "imgColorType: color | gray | mono | trans",
23
+ required: false,
24
+ },
25
+ safe: { type: "string", description: "safe: off | active", required: false },
26
+ limit: { type: "number", description: "Max results (1-50, paginated 10 per call)", required: false, default: 10 },
27
+ "auto-ingest": { type: "number", description: "Auto-ingest top N", required: false, default: 0 },
28
+ },
29
+ });
30
+ export const googleCommand = defineCommand({
31
+ meta: {
32
+ name: "google",
33
+ description: "Google Images via the official Custom Search JSON API ($0.005/query, free 100/day). ⚠ Source unverified — watermarks, low-res, mislabeled results are common. Use as last resort.\n\nExample: baker images google 'industrial workshop' --type photo --size large --limit 20",
34
+ },
35
+ args: {
36
+ query: { type: "positional", description: "Search query", required: false },
37
+ type: { type: "string", description: "imgType filter", required: false },
38
+ size: { type: "string", description: "imgSize filter", required: false },
39
+ color: { type: "string", description: "imgColorType filter", required: false },
40
+ safe: { type: "string", description: "safe (off|active)", required: false },
41
+ limit: { type: "string", description: "Max results (1-50)", required: false },
42
+ "auto-ingest": { type: "string", description: "Auto-ingest top N", required: false },
43
+ },
44
+ run: async ({ args }) => {
45
+ try {
46
+ const query = args.query;
47
+ if (!query) {
48
+ writeJson({ ok: false, error: { code: "VALIDATION_ERROR", message: "Query is required" } });
49
+ process.exit(1);
50
+ }
51
+ const body = { query };
52
+ if (args.type)
53
+ body.type = args.type;
54
+ if (args.size)
55
+ body.size = args.size;
56
+ if (args.color)
57
+ body.color = args.color;
58
+ if (args.safe)
59
+ body.safe = args.safe;
60
+ if (args.limit)
61
+ body.limit = Number(args.limit);
62
+ if (args["auto-ingest"])
63
+ body.autoIngest = Number(args["auto-ingest"]);
64
+ const data = await apiPost("/api/images/google", body);
65
+ writeJson({ ok: true, data });
66
+ }
67
+ catch (err) {
68
+ if (err instanceof ApiError) {
69
+ writeJson({ ok: false, error: { code: err.code, message: err.message } });
70
+ process.exit(1);
71
+ }
72
+ writeJson({ ok: false, error: { code: "INTERNAL_ERROR", message: "Unexpected error" } });
73
+ process.exit(1);
74
+ }
75
+ },
76
+ });
77
+ //# sourceMappingURL=google.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"google.js","sourceRoot":"","sources":["../../../src/commands/images/google.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,cAAc,CAAC;IACb,OAAO,EAAE,eAAe;IACxB,WAAW,EACT,2GAA2G;IAC7G,IAAI,EAAE;QACJ,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,cAAc,EAAE,QAAQ,EAAE,IAAI,EAAE;QACtE,IAAI,EAAE;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C,CAAC,CAAC;YAEvE,MAAM,IAAI,GAAG,MAAM,OAAO,CAA0B,oBAAoB,EAAE,IAAI,CAAC,CAAC;YAChF,SAAS,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;QAChC,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,IAAI,GAAG,YAAY,QAAQ,EAAE,CAAC;gBAC5B,SAAS,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;gBAC1E,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAClB,CAAC;YACD,SAAS,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE,OAAO,EAAE,kBAAkB,EAAE,EAAE,CAAC,CAAC;YACzF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC;CACF,CAAC,CAAC"}
@@ -0,0 +1,23 @@
1
+ export declare const iconCommand: import("citty").CommandDef<{
2
+ readonly name: {
3
+ readonly type: "positional";
4
+ readonly description: "Icon name or prefixed id";
5
+ readonly required: false;
6
+ };
7
+ readonly set: {
8
+ readonly type: "string";
9
+ readonly description: "Iconify set";
10
+ readonly required: false;
11
+ };
12
+ readonly color: {
13
+ readonly type: "string";
14
+ readonly description: "Hex color";
15
+ readonly required: false;
16
+ };
17
+ readonly width: {
18
+ readonly type: "string";
19
+ readonly description: "Width in px";
20
+ readonly required: false;
21
+ };
22
+ }>;
23
+ //# sourceMappingURL=icon.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../../src/commands/images/icon.ts"],"names":[],"mappings":"AAoBA,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;EAmCtB,CAAC"}
@@ -0,0 +1,57 @@
1
+ import { defineCommand } from "citty";
2
+ import { ApiError, apiPost } from "../../client.js";
3
+ import { writeJson } from "../../output.js";
4
+ import { registerSchema } from "../../schemas.js";
5
+ registerSchema({
6
+ command: "images.icon",
7
+ description: "Icon lookup via Iconify (200+ icon sets, free CDN).",
8
+ args: {
9
+ name: { type: "string", description: "Icon name (or prefixed 'lucide:check')", required: true },
10
+ set: {
11
+ type: "string",
12
+ description: "Iconify set (simple-icons, logos, lucide, devicon, heroicons, tabler, …)",
13
+ required: false,
14
+ },
15
+ color: { type: "string", description: "Hex color (replaces currentColor)", required: false },
16
+ width: { type: "number", description: "Render width in px", required: false },
17
+ },
18
+ });
19
+ export const iconCommand = defineCommand({
20
+ meta: {
21
+ name: "icon",
22
+ description: "Icon via Iconify (simple-icons, logos, lucide, devicon, heroicons, tabler, phosphor, material-symbols, …). Free CDN, no API key.\n\nExample: baker images icon react --set devicon\nExample: baker images icon lucide:check --color '#0a0a0a'",
23
+ },
24
+ args: {
25
+ name: { type: "positional", description: "Icon name or prefixed id", required: false },
26
+ set: { type: "string", description: "Iconify set", required: false },
27
+ color: { type: "string", description: "Hex color", required: false },
28
+ width: { type: "string", description: "Width in px", required: false },
29
+ },
30
+ run: async ({ args }) => {
31
+ try {
32
+ const name = args.name;
33
+ if (!name) {
34
+ writeJson({ ok: false, error: { code: "VALIDATION_ERROR", message: "Icon name is required" } });
35
+ process.exit(1);
36
+ }
37
+ const body = { name };
38
+ if (args.set)
39
+ body.set = args.set;
40
+ if (args.color)
41
+ body.color = args.color;
42
+ if (args.width)
43
+ body.width = Number(args.width);
44
+ const data = await apiPost("/api/images/icon", body);
45
+ writeJson({ ok: true, data });
46
+ }
47
+ catch (err) {
48
+ if (err instanceof ApiError) {
49
+ writeJson({ ok: false, error: { code: err.code, message: err.message } });
50
+ process.exit(1);
51
+ }
52
+ writeJson({ ok: false, error: { code: "INTERNAL_ERROR", message: "Unexpected error" } });
53
+ process.exit(1);
54
+ }
55
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C,CAAC;gBAC1E,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAClB,CAAC;YACD,SAAS,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE,OAAO,EAAE,kBAAkB,EAAE,EAAE,CAAC,CAAC;YACzF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC;CACF,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/images/index.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,aAAa,qDAkBxB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/images/index.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,aAAa,qDA4CxB,CAAC"}
@@ -1,22 +1,60 @@
1
1
  import { defineCommand } from "citty";
2
2
  import { deleteCommand } from "./delete.js";
3
+ import { extractCommand } from "./extract.js";
4
+ import { findCommand } from "./find.js";
3
5
  import { getCommand } from "./get.js";
6
+ import { gifCommand } from "./gif.js";
7
+ import { googleCommand } from "./google.js";
8
+ import { iconCommand } from "./icon.js";
9
+ import { ingestCommand } from "./ingest.js";
10
+ import { libraryCommand } from "./library.js";
11
+ import { logoCommand } from "./logo.js";
12
+ import { screenshotCommand } from "./screenshot.js";
4
13
  import { searchCommand } from "./search.js";
14
+ import { stickerCommand } from "./sticker.js";
15
+ import { stockCommand } from "./stock.js";
5
16
  import { uploadCommand } from "./upload.js";
17
+ import { useCommand } from "./use.js";
6
18
  export const imagesCommand = defineCommand({
7
19
  meta: {
8
20
  name: "images",
9
- description: `Find and manage images in Baker. Subcommands: search, get, upload, delete.
21
+ description: `Find and source images. Subcommands route by provider so cost + license are explicit.
10
22
 
11
- Examples:
12
- baker images search "hero banner" --limit 5
13
- baker images search "logo" --aspect-ratio 1:1 --tags logo
14
- baker images get <image-id>
15
- baker images upload ./logo.png --source uploaded
16
- baker images delete <image-id> --dry-run`,
23
+ Library + search:
24
+ baker images library <q> Search the company library (replaces search)
25
+ baker images find <q> --sources … Fanout: library first, then opt-in providers
26
+
27
+ External providers:
28
+ baker images stock <q> [--type photo|vector|psd] Magnific (Freepik's dev API) — photos, vectors, illustrations, PSDs
29
+ baker images google <q> Google Images via the official Custom Search API
30
+ baker images logo <domain> Brand logo via Brandfetch CDN
31
+ baker images icon <name> [--set …] Iconify (200+ sets)
32
+ baker images gif <q> [--trending] Giphy GIFs / reaction memes (paid-social creative)
33
+ baker images sticker <q> [--trending] Giphy stickers — transparent overlays for ad creative
34
+ baker images extract <url> Firecrawl page extract
35
+ baker images screenshot <url> ScreenshotOne capture
36
+
37
+ Ingest + management:
38
+ baker images ingest <url> --source <enum> Save remote URL to library
39
+ baker images use <url> Ingest and wait for ready
40
+ baker images upload ./file Upload local file
41
+ baker images get <id> Get a single record
42
+ baker images delete <id> Delete a record`,
17
43
  },
18
44
  subCommands: {
19
45
  get: getCommand,
46
+ library: libraryCommand,
47
+ find: findCommand,
48
+ stock: stockCommand,
49
+ google: googleCommand,
50
+ logo: logoCommand,
51
+ icon: iconCommand,
52
+ gif: gifCommand,
53
+ sticker: stickerCommand,
54
+ extract: extractCommand,
55
+ screenshot: screenshotCommand,
56
+ ingest: ingestCommand,
57
+ use: useCommand,
20
58
  search: searchCommand,
21
59
  upload: uploadCommand,
22
60
  delete: deleteCommand,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/images/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,MAAM,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AAI,EAAE,QAAQ;QACd,WAAW,EAAE;;;;;;;;;;;;;;;;;;;;;uEAqBsD;KACpE;IACD,WAAW,EAAE;QACX,GAAG,EAAE,UAAU;QACf,OAAO,EAAE,cAAc;QACvB,IAAI,EAAE,WAAW;QACjB,KAAK,EAAE,YAAY;QACnB,MAAM,EAAE,aAAa;QACrB,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,WAAW;QACjB,GAAG,EAAE,UAAU;QACf,OAAO,EAAE,cAAc;QACvB,OAAO,EAAE,cAAc;QACvB,UAAU,EAAE,iBAAiB;QAC7B,MAAM,EAAE,aAAa;QACrB,GAAG,EAAE,UAAU;QACf,MAAM,EAAE,aAAa;QACrB,MAAM,EAAE,aAAa;QACrB,MAAM,EAAE,aAAa;KACtB;CACF,CAAC,CAAC"}
@@ -0,0 +1,28 @@
1
+ export declare const ingestCommand: import("citty").CommandDef<{
2
+ readonly url: {
3
+ readonly type: "positional";
4
+ readonly description: "Image URL";
5
+ readonly required: false;
6
+ };
7
+ readonly source: {
8
+ readonly type: "string";
9
+ readonly description: "Source enum";
10
+ readonly required: false;
11
+ };
12
+ readonly "external-id": {
13
+ readonly type: "string";
14
+ readonly description: "Provider asset id";
15
+ readonly required: false;
16
+ };
17
+ readonly "external-url": {
18
+ readonly type: "string";
19
+ readonly description: "Canonical page URL";
20
+ readonly required: false;
21
+ };
22
+ readonly context: {
23
+ readonly type: "string";
24
+ readonly description: "Description context";
25
+ readonly required: false;
26
+ };
27
+ }>;
28
+ //# sourceMappingURL=ingest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ingest.d.ts","sourceRoot":"","sources":["../../../src/commands/images/ingest.ts"],"names":[],"mappings":"AAiBA,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;EAyCxB,CAAC"}
@@ -0,0 +1,60 @@
1
+ import { defineCommand } from "citty";
2
+ import { ApiError, apiPost } from "../../client.js";
3
+ import { writeJson } from "../../output.js";
4
+ import { registerSchema } from "../../schemas.js";
5
+ registerSchema({
6
+ command: "images.ingest",
7
+ description: "Ingest a remote image URL into the library (full describe + embed).",
8
+ args: {
9
+ url: { type: "string", description: "Image URL to ingest", required: true },
10
+ source: { type: "string", description: "Image source enum", required: true },
11
+ "external-id": { type: "string", description: "Provider asset id", required: false },
12
+ "external-url": { type: "string", description: "Canonical page URL", required: false },
13
+ context: { type: "string", description: "Description context hint", required: false },
14
+ },
15
+ });
16
+ export const ingestCommand = defineCommand({
17
+ meta: {
18
+ name: "ingest",
19
+ description: "Download a remote URL and store it in the library. Hash-deduped on bytes + externalId.\n\nExample: baker images ingest https://img.freepik.com/free-photo/xyz.jpg --source magnific --external-id 12345",
20
+ },
21
+ args: {
22
+ url: { type: "positional", description: "Image URL", required: false },
23
+ source: { type: "string", description: "Source enum", required: false },
24
+ "external-id": { type: "string", description: "Provider asset id", required: false },
25
+ "external-url": { type: "string", description: "Canonical page URL", required: false },
26
+ context: { type: "string", description: "Description context", required: false },
27
+ },
28
+ run: async ({ args }) => {
29
+ try {
30
+ const url = args.url;
31
+ const source = args.source;
32
+ if (!url) {
33
+ writeJson({ ok: false, error: { code: "VALIDATION_ERROR", message: "URL is required" } });
34
+ process.exit(1);
35
+ }
36
+ if (!source) {
37
+ writeJson({ ok: false, error: { code: "VALIDATION_ERROR", message: "--source is required" } });
38
+ process.exit(1);
39
+ }
40
+ const body = { url, source };
41
+ if (args["external-id"])
42
+ body.externalId = args["external-id"];
43
+ if (args["external-url"])
44
+ body.externalUrl = args["external-url"];
45
+ if (args.context)
46
+ body.descriptionContext = args.context;
47
+ const data = await apiPost("/api/images/ingest", body);
48
+ writeJson({ ok: true, data });
49
+ }
50
+ catch (err) {
51
+ if (err instanceof ApiError) {
52
+ writeJson({ ok: false, error: { code: err.code, message: err.message } });
53
+ process.exit(1);
54
+ }
55
+ writeJson({ ok: false, error: { code: "INTERNAL_ERROR", message: "Unexpected error" } });
56
+ process.exit(1);
57
+ }
58
+ },
59
+ });
60
+ //# s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,CAAC,cAAc,CAAC,CAAC;YAClE,IAAI,IAAI,CAAC,OAAO;gBAAE,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAC,OAAO,CAAC;YAEzD,MAAM,IAAI,GAAG,MAAM,OAAO,CAA0B,oBAAoB,EAAE,IAAI,CAAC,CAAC;YAChF,SAAS,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;QAChC,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,IAAI,GAAG,YAAY,QAAQ,EAAE,CAAC;gBAC5B,SAAS,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;gBAC1E,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAClB,CAAC;YACD,SAAS,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE,OAAO,EAAE,kBAAkB,EAAE,EAAE,CAAC,CAAC;YACzF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC;CACF,CAAC,CAAC"}
@@ -0,0 +1,55 @@
1
+ export declare const libraryCommand: import("citty").CommandDef<{
2
+ readonly query: {
3
+ readonly type: "positional";
4
+ readonly description: "Search query text";
5
+ readonly required: false;
6
+ };
7
+ readonly limit: {
8
+ readonly type: "string";
9
+ readonly description: "Max results (default 5)";
10
+ readonly required: false;
11
+ };
12
+ readonly "min-score": {
13
+ readonly type: "string";
14
+ readonly description: "Minimum relevance score (0-1)";
15
+ readonly required: false;
16
+ };
17
+ readonly "aspect-ratio": {
18
+ readonly type: "string";
19
+ readonly description: "Aspect ratio filter";
20
+ readonly required: false;
21
+ };
22
+ readonly tags: {
23
+ readonly type: "string";
24
+ readonly description: "Comma-separated tags to filter by";
25
+ readonly required: false;
26
+ };
27
+ readonly source: {
28
+ readonly type: "string";
29
+ readonly description: "Filter by source";
30
+ readonly required: false;
31
+ };
32
+ readonly "external-url-host": {
33
+ readonly type: "string";
34
+ readonly description: "Filter library by externalUrl host substring (e.g. competitor.com)";
35
+ readonly required: false;
36
+ };
37
+ readonly output: {
38
+ readonly type: "string";
39
+ readonly description: "Output format: json|files|md";
40
+ readonly required: false;
41
+ readonly default: "json";
42
+ };
43
+ readonly fields: {
44
+ readonly type: "string";
45
+ readonly description: "Comma-separated field names to include";
46
+ readonly required: false;
47
+ };
48
+ readonly full: {
49
+ readonly type: "boolean";
50
+ readonly description: "Include full metadata";
51
+ readonly required: false;
52
+ readonly default: false;
53
+ };
54
+ }>;
55
+ //# sourceMappingURL=library.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"library.d.ts","sourceRoot":"","sources":["../../../src/commands/images/library.ts"],"names":[],"mappings":"AAgCA,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwDzB,CAAC"}