@gobi-ai/cli 0.9.2 → 0.9.3

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.
@@ -4,12 +4,12 @@
4
4
  "name": "gobi-ai"
5
5
  },
6
6
  "description": "Claude Code plugin for the Gobi collaborative knowledge platform CLI",
7
- "version": "0.9.1",
7
+ "version": "0.9.2",
8
8
  "plugins": [
9
9
  {
10
10
  "name": "gobi",
11
11
  "description": "Manage the Gobi collaborative knowledge platform from the command line. Search and ask brains, publish brain documents, create threads, manage sessions, generate images and videos.",
12
- "version": "0.9.1",
12
+ "version": "0.9.2",
13
13
  "author": {
14
14
  "name": "gobi-ai"
15
15
  },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "gobi",
3
3
  "description": "Manage the Gobi collaborative knowledge platform from the command line",
4
- "version": "0.9.1",
4
+ "version": "0.9.2",
5
5
  "author": {
6
6
  "name": "gobi-ai"
7
7
  },
@@ -404,6 +404,7 @@ export function registerMediaCommand(program) {
404
404
  .description("Download a generated image.")
405
405
  .option("--wait", "Poll until generation completes before downloading")
406
406
  .option("--type <type>", "Image type (image, thumbnail, asset)")
407
+ .option("-o, --output <path>", "Output file path (default: {jobId}.{ext} in current directory)")
407
408
  .action(async (jobId, opts) => {
408
409
  if (opts.wait) {
409
410
  console.log(`Waiting for image job ${jobId} to complete…`);
@@ -428,16 +429,22 @@ export function registerMediaCommand(program) {
428
429
  const ext = contentType.includes("jpeg") || contentType.includes("jpg") ? "jpg"
429
430
  : contentType.includes("webp") ? "webp"
430
431
  : "png";
431
- const filename = `${jobId}.${ext}`;
432
+ const filename = opts.output || `${jobId}.${ext}`;
432
433
  if (isJsonMode(media)) {
433
- // In JSON mode, return base64-encoded image
434
+ // In JSON mode, save to file and return metadata
435
+ const { writeFile, mkdir } = await import("fs/promises");
436
+ const { dirname } = await import("path");
434
437
  const buffer = Buffer.from(await res.arrayBuffer());
435
- jsonOut({ filename, contentType, size: buffer.length, base64: buffer.toString("base64") });
438
+ await mkdir(dirname(filename), { recursive: true });
439
+ await writeFile(filename, buffer);
440
+ jsonOut({ filename, contentType, size: buffer.length });
436
441
  return;
437
442
  }
438
443
  // Write to file
439
- const { writeFile } = await import("fs/promises");
444
+ const { writeFile, mkdir } = await import("fs/promises");
445
+ const { dirname } = await import("path");
440
446
  const buffer = Buffer.from(await res.arrayBuffer());
447
+ await mkdir(dirname(filename), { recursive: true });
441
448
  await writeFile(filename, buffer);
442
449
  console.log(`Image saved to ${filename} (${buffer.length} bytes)`);
443
450
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gobi-ai/cli",
3
- "version": "0.9.2",
3
+ "version": "0.9.3",
4
4
  "description": "CLI client for the Gobi collaborative knowledge platform",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -27,14 +27,23 @@ gobi --json media image-generate --prompt "a sunset over mountains"
27
27
 
28
28
  ## Typical Workflow (Image Generation)
29
29
 
30
- Always use `--wait` to poll until completion in a single command:
30
+ Always follow this two-step flow generate, then download to vault:
31
31
 
32
32
  ```bash
33
+ # Step 1: Generate (use --wait to poll until complete)
33
34
  gobi --json media image-generate --prompt "a sunset over mountains" --wait
35
+ # → returns JSON with jobId
36
+
37
+ # Step 2: Download to vault media/ folder
38
+ gobi --json media image-download <jobId> -o media/<name>.png
34
39
  ```
35
40
 
41
+ Then show the result as an embedded vault link: `![[media/<name>.png]]`
42
+
43
+ ### Key rules
36
44
  - `--name` is **optional** — auto-derived from prompt if omitted.
37
45
  - `--wait` avoids needing a separate `image-status` call.
46
+ - Always download with `-o media/<name>.png` — pick a short descriptive name (e.g., `happy-family.png`).
38
47
  - `image-status` takes a **positional** jobId (NOT `--job-id`): `gobi media image-status <jobId>`
39
48
 
40
49
  ## Available Commands
@@ -206,7 +206,8 @@ Usage: gobi media image-download [options] <jobId>
206
206
  Download a generated image.
207
207
 
208
208
  Options:
209
- --wait Poll until generation completes before downloading
210
- --type <type> Image type (image, thumbnail, asset)
211
- -h, --help display help for command
209
+ --wait Poll until generation completes before downloading
210
+ --type <type> Image type (image, thumbnail, asset)
211
+ -o, --output <path> Output file path (default: {jobId}.{ext} in current directory)
212
+ -h, --help display help for command
212
213
  ```