@gobi-ai/cli 2.0.17 → 2.0.18

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": "2.0.17",
7
+ "version": "2.0.18",
8
8
  "plugins": [
9
9
  {
10
10
  "name": "gobi",
11
11
  "description": "Manage the Gobi collaborative knowledge platform from the command line. Publish vault profiles, create posts and replies, manage saved notes and posts, manage sessions, generate images and videos.",
12
- "version": "2.0.17",
12
+ "version": "2.0.18",
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": "2.0.17",
4
+ "version": "2.0.18",
5
5
  "author": {
6
6
  "name": "gobi-ai"
7
7
  },
@@ -1,3 +1,4 @@
1
+ import { WEB_BASE_URL } from "../constants.js";
1
2
  import { apiGet, apiPost, apiPatch, apiDelete } from "../client.js";
2
3
  import { fetchDraftSummary, isJsonMode, jsonOut, readStdin, resolveVaultSlug, unwrapResp, } from "./utils.js";
3
4
  import { extractWikiLinks, uploadAttachments, uploadPostAttachments, assertPostAttachmentMix, } from "../attachments.js";
@@ -7,6 +8,16 @@ function readContent(value) {
7
8
  return readStdin();
8
9
  return value;
9
10
  }
11
+ function buildPersonalPostUrl(post) {
12
+ const id = post.id;
13
+ const vaultSlug = post.vault?.vaultSlug ||
14
+ post.authorVault?.vaultSlug ||
15
+ post.authorVaultSlug ||
16
+ undefined;
17
+ return vaultSlug
18
+ ? `${WEB_BASE_URL}/@${vaultSlug}?postId=${id}`
19
+ : `${WEB_BASE_URL}/posts/${id}`;
20
+ }
10
21
  function formatFeedLine(m) {
11
22
  const isReply = m.parentPostId != null ||
12
23
  m.type === "post-reply";
@@ -250,14 +261,16 @@ export function registerGlobalCommand(program) {
250
261
  console.error(`Warning: failed to link post to draft ${opts.draftId}: ${e.message}`);
251
262
  }
252
263
  }
264
+ const shareUrl = buildPersonalPostUrl(post);
253
265
  if (isJsonMode(global)) {
254
- jsonOut(post);
266
+ jsonOut({ ...post, shareUrl });
255
267
  return;
256
268
  }
257
269
  console.log(`Post created!\n` +
258
270
  ` ID: ${post.id}\n` +
259
271
  (post.title ? ` Title: ${post.title}\n` : "") +
260
- ` Created: ${post.createdAt}` +
272
+ ` Created: ${post.createdAt}\n` +
273
+ ` URL: ${shareUrl}` +
261
274
  (opts.draftId ? `\n Linked to draft: ${opts.draftId}` : ""));
262
275
  });
263
276
  // ── Edit post ──
@@ -1,3 +1,4 @@
1
+ import { WEB_BASE_URL } from "../constants.js";
1
2
  import { apiGet, apiPost, apiPatch, apiDelete } from "../client.js";
2
3
  import { requireSpace, selectSpace, setSpaceRequirement, writeSpaceSetting, } from "./init.js";
3
4
  import { fetchDraftSummary, isJsonMode, jsonOut, readStdin, resolveSpaceSlug, resolveVaultSlug, unwrapResp, } from "./utils.js";
@@ -386,14 +387,16 @@ export function registerSpaceCommand(program) {
386
387
  console.error(`Warning: failed to link post to draft ${opts.draftId}: ${e.message}`);
387
388
  }
388
389
  }
390
+ const shareUrl = `${WEB_BASE_URL}/spaces/${spaceSlug}/posts/${post.id}`;
389
391
  if (isJsonMode(space)) {
390
- jsonOut(post);
392
+ jsonOut({ ...post, shareUrl });
391
393
  return;
392
394
  }
393
395
  console.log(`Post created!\n` +
394
396
  ` ID: ${post.id}\n` +
395
397
  (post.title ? ` Title: ${post.title}\n` : "") +
396
- ` Created: ${post.createdAt}` +
398
+ ` Created: ${post.createdAt}\n` +
399
+ ` URL: ${shareUrl}` +
397
400
  (opts.draftId ? `\n Linked to draft: ${opts.draftId}` : ""));
398
401
  });
399
402
  space
@@ -1,6 +1,6 @@
1
1
  import { existsSync, readFileSync } from "fs";
2
2
  import { join, resolve as pathResolve } from "path";
3
- import { WEBDRIVE_BASE_URL } from "../constants.js";
3
+ import { WEB_BASE_URL, WEBDRIVE_BASE_URL } from "../constants.js";
4
4
  import { getValidToken } from "../auth/manager.js";
5
5
  import { GobiError } from "../errors.js";
6
6
  import { apiDelete, apiGet, apiPatch, apiPost } from "../client.js";
@@ -118,7 +118,7 @@ export function registerVaultCommand(program) {
118
118
  throw new GobiError(`Vault "${slug}" not found among vaults you own.`, "VAULT_NOT_FOUND");
119
119
  }
120
120
  const isPublished = v.public === true;
121
- const profileUrl = `https://gobispace.com/@${slug}`;
121
+ const profileUrl = `${WEB_BASE_URL}/@${slug}`;
122
122
  const status = {
123
123
  vaultSlug: slug,
124
124
  name: v.name,
package/dist/constants.js CHANGED
@@ -1,5 +1,6 @@
1
1
  export const BASE_URL = process.env.GOBI_BASE_URL || "https://api.joingobi.com";
2
2
  export const WEBDRIVE_BASE_URL = process.env.GOBI_WEBDRIVE_BASE_URL || "https://webdrive.joingobi.com";
3
+ export const WEB_BASE_URL = process.env.GOBI_WEB_BASE_URL || "https://gobispace.com";
3
4
  // Refresh access token when less than 5 minutes remain
4
5
  export const TOKEN_REFRESH_BUFFER_MS = 5 * 60 * 1000;
5
6
  // Max polling duration before giving up (ms) - 10 minutes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gobi-ai/cli",
3
- "version": "2.0.17",
3
+ "version": "2.0.18",
4
4
  "description": "CLI client for the Gobi collaborative knowledge platform",
5
5
  "license": "MIT",
6
6
  "type": "module",