@gobi-ai/cli 1.1.0 → 1.3.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.
@@ -9,27 +9,10 @@ function readContent(value) {
9
9
  return readFileSync("/dev/stdin", "utf8");
10
10
  return value;
11
11
  }
12
- function formatMessageLine(m) {
13
- const isReply = m.parentThreadId != null;
14
- const id = `[${isReply ? "r" : "t"}:${m.id}]`;
15
- const kind = isReply ? "reply " : "thread";
16
- const author = m.author?.name ||
17
- `User ${m.authorId ?? "?"}`;
18
- let label;
19
- if (isReply) {
20
- const text = m.content || "";
21
- label = text.length > 80 ? text.slice(0, 80) + "…" : text;
22
- label = label.replace(/\s+/g, " ").trim();
23
- }
24
- else {
25
- label = m.title || m.content || "";
26
- }
27
- return `${id} ${kind} ${author} "${label}" ${m.createdAt}`;
28
- }
29
12
  export function registerSpaceCommand(program) {
30
13
  const space = program
31
14
  .command("space")
32
- .description("Space commands. A Space is a shared room of members where they post threads and replies, organized by topics.")
15
+ .description("Space commands (threads, replies).")
33
16
  .option("--space-slug <slug>", "Space slug (overrides .gobi/settings.yaml)");
34
17
  // ── List spaces ──
35
18
  space
@@ -53,23 +36,6 @@ export function registerSpaceCommand(program) {
53
36
  }
54
37
  console.log(`Spaces (${items.length}):\n` + lines.join("\n"));
55
38
  });
56
- // ── Get space ──
57
- space
58
- .command("get [spaceSlug]")
59
- .description("Get details for a space. Pass a slug or omit to use the current space (from .gobi/settings.yaml or --space-slug).")
60
- .action(async (spaceSlug) => {
61
- const slug = spaceSlug || resolveSpaceSlug(space);
62
- const resp = (await apiGet(`/spaces/${slug}`));
63
- const s = unwrapResp(resp);
64
- if (isJsonMode(space)) {
65
- jsonOut(s);
66
- return;
67
- }
68
- const desc = s.description ? `\n Description: ${s.description}` : "";
69
- console.log(`Space [${s.slug}] ${s.name}${desc}\n` +
70
- ` ID: ${s.id}\n` +
71
- ` Created: ${s.createdAt}`);
72
- });
73
39
  // ── Warp (space selection) ──
74
40
  space
75
41
  .command("warp [spaceSlug]")
@@ -160,60 +126,6 @@ export function registerSpaceCommand(program) {
160
126
  lines.join("\n") +
161
127
  footer);
162
128
  });
163
- // ── Messages (unified feed) ──
164
- space
165
- .command("messages")
166
- .description("List the unified message feed (threads and replies, newest first) in a space.")
167
- .option("--limit <number>", "Items per page", "20")
168
- .option("--cursor <string>", "Pagination cursor from previous response")
169
- .action(async (opts) => {
170
- const spaceSlug = resolveSpaceSlug(space);
171
- const params = {
172
- limit: parseInt(opts.limit, 10),
173
- };
174
- if (opts.cursor)
175
- params.cursor = opts.cursor;
176
- const resp = (await apiGet(`/spaces/${spaceSlug}/messages`, params));
177
- if (isJsonMode(space)) {
178
- jsonOut({
179
- items: resp.data || [],
180
- pagination: resp.pagination || {},
181
- });
182
- return;
183
- }
184
- const items = (resp.data || []);
185
- const pagination = (resp.pagination || {});
186
- if (!items.length) {
187
- console.log("No messages found.");
188
- return;
189
- }
190
- const lines = items.map(formatMessageLine);
191
- const footer = pagination.hasMore ? `\n Next cursor: ${pagination.nextCursor}` : "";
192
- console.log(`Messages (${items.length} items, newest first):\n` + lines.join("\n") + footer);
193
- });
194
- // ── Ancestors ──
195
- space
196
- .command("ancestors <threadId>")
197
- .description("Show the ancestor lineage of a thread or reply (root → immediate parent).")
198
- .action(async (threadId) => {
199
- const spaceSlug = resolveSpaceSlug(space);
200
- const resp = (await apiGet(`/spaces/${spaceSlug}/threads/${threadId}/ancestors`));
201
- const data = unwrapResp(resp);
202
- const ancestors = (data.ancestors || []);
203
- if (isJsonMode(space)) {
204
- jsonOut({ ancestors });
205
- return;
206
- }
207
- if (!ancestors.length) {
208
- console.log("No ancestors (this is a root thread).");
209
- return;
210
- }
211
- const lines = [];
212
- ancestors.forEach((a, i) => {
213
- lines.push(`${i + 1}. ${formatMessageLine(a)}`);
214
- });
215
- console.log(`Ancestors (${ancestors.length} items, root first):\n` + lines.join("\n"));
216
- });
217
129
  // ── Threads (get, list, create, edit, delete) ──
218
130
  space
219
131
  .command("get-thread <threadId>")
package/dist/main.js CHANGED
@@ -5,8 +5,8 @@ import { ApiError, GobiError } from "./errors.js";
5
5
  import { registerAuthCommand } from "./commands/auth.js";
6
6
  import { registerInitCommand, printContext } from "./commands/init.js";
7
7
  import { registerSpaceCommand } from "./commands/space.js";
8
- import { registerGlobalCommand } from "./commands/global.js";
9
- import { registerVaultCommand } from "./commands/vault.js";
8
+ import { registerBrainCommand } from "./commands/brain.js";
9
+ import { registerFeedCommand } from "./commands/feed.js";
10
10
  import { registerSessionsCommand } from "./commands/sessions.js";
11
11
  import { registerSenseCommand } from "./commands/sense.js";
12
12
  import { registerSyncCommand } from "./commands/sync.js";
@@ -33,8 +33,8 @@ export async function cli() {
33
33
  registerAuthCommand(program);
34
34
  registerInitCommand(program);
35
35
  registerSpaceCommand(program);
36
- registerGlobalCommand(program);
37
- registerVaultCommand(program);
36
+ registerBrainCommand(program);
37
+ registerFeedCommand(program);
38
38
  registerSessionsCommand(program);
39
39
  registerSenseCommand(program);
40
40
  registerSyncCommand(program);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gobi-ai/cli",
3
- "version": "1.1.0",
3
+ "version": "1.3.0",
4
4
  "description": "CLI client for the Gobi collaborative knowledge platform",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -0,0 +1,103 @@
1
+ ---
2
+ name: gobi-brain
3
+ description: >-
4
+ Gobi brain commands for knowledge management: search public brains by text
5
+ and semantic similarity, ask brains questions, publish/unpublish BRAIN.md,
6
+ and manage brain updates (post/edit/delete). Use when the user wants to
7
+ search knowledge, ask a brain, publish their brain document, or manage
8
+ their brain updates. To browse the global feed of brain updates from
9
+ others, see the gobi-feed skill.
10
+ allowed-tools: Bash(gobi:*)
11
+ metadata:
12
+ author: gobi-ai
13
+ version: "0.8.0"
14
+ ---
15
+
16
+ # gobi-brain
17
+
18
+ Gobi brain commands for knowledge management (v0.8.0).
19
+
20
+ Requires gobi-cli installed and authenticated. See gobi-core skill for setup.
21
+
22
+ ## Gobi Brain — Knowledge Management
23
+
24
+ `gobi brain` commands manage your vault's brain: search across all spaces, ask brains questions, and publish/unpublish your BRAIN.md. Public brains are accessible at `https://gobispace.com/@{vaultSlug}`.
25
+
26
+ ## Important: JSON Mode
27
+
28
+ For programmatic/agent usage, always pass `--json` as a **global** option (before the subcommand):
29
+
30
+ ```bash
31
+ gobi --json brain search --query "machine learning"
32
+ ```
33
+
34
+ ## Available Commands
35
+
36
+ - `gobi brain search` — Search public brains by text and semantic similarity.
37
+ - `gobi brain ask` — Ask a brain a question. Creates a targeted session (1:1 conversation).
38
+ - `gobi brain publish` — Upload BRAIN.md to the vault root on webdrive. Triggers post-processing (brain sync, metadata update, Discord notification).
39
+ - `gobi brain unpublish` — Delete BRAIN.md from the vault on webdrive.
40
+ - `gobi brain post-update` — Post a brain update for a vault.
41
+ - `gobi brain edit-update` — Edit a published brain update. You must be the author.
42
+ - `gobi brain delete-update` — Delete a published brain update. You must be the author.
43
+
44
+ ## BRAIN.md Frontmatter Reference
45
+
46
+ `BRAIN.md` is the metadata file at the root of every vault. Its YAML frontmatter controls the vault's public profile, homepage, and AI agent behavior. Example:
47
+
48
+ ```yaml
49
+ ---
50
+ title: My Brain
51
+ tags:
52
+ - topic1
53
+ - topic2
54
+ description: A short description of what this brain is about.
55
+ thumbnail: "[[BRAIN.png]]"
56
+ homepage: "[[app/home.html?nav=false]]"
57
+ prompt: "[[system-prompt.md]]"
58
+ ---
59
+ ```
60
+
61
+ ### Fields
62
+
63
+ - **`title`** (required) — Display name of the brain/vault.
64
+ - **`description`** (required for public listing) — Short description shown on the brain card and public profile. Without both `title` and `description`, the brain won't appear in the public catalog.
65
+ - **`tags`** — Tags for categorization and discovery. Supports YAML block list or inline array format:
66
+ ```yaml
67
+ # Block list
68
+ tags:
69
+ - ambient ai
70
+ - wearables
71
+
72
+ # Inline array
73
+ tags: [ambient ai, wearables]
74
+ ```
75
+ - **`thumbnail`** — Profile image for the brain card. Uses wiki-link syntax pointing to an image file in the vault (e.g. `"[[BRAIN.png]]"`).
76
+ - **`homepage`** — Custom HTML page to serve as the vault's public homepage at `gobispace.com/@{vaultSlug}`. Uses wiki-link syntax pointing to an HTML file in the vault. Supports a `nav` query parameter to control Gobi's sidebar navigation:
77
+ - `"[[app/home.html]]"` — Shows the Gobi sidebar alongside the homepage (default)
78
+ - `"[[app/home.html?nav=false]]"` — Full-screen, no Gobi sidebar/chrome
79
+ - **`prompt`** — Wiki-link to a custom system prompt file for the brain's AI agent (e.g. `"[[system-prompt.md]]"`).
80
+
81
+ > For details on building custom HTML homepages and using the `window.gobi` API, see the **gobi-homepage** skill.
82
+
83
+ ## Publishing Workflow
84
+
85
+ After editing `BRAIN.md` frontmatter, follow these steps to make your changes live:
86
+
87
+ 1. **Edit `BRAIN.md`** in the vault root with the desired frontmatter fields.
88
+ 2. **Sync referenced files** — if the homepage HTML, thumbnail image, or prompt file is new or updated, upload them first:
89
+ ```bash
90
+ gobi sync
91
+ ```
92
+ 3. **Publish the brain**:
93
+ ```bash
94
+ gobi brain publish
95
+ ```
96
+ This uploads `BRAIN.md` to webdrive, triggers post-processing that extracts metadata (title, description, tags, thumbnail, homepage path), updates the vault's public profile, and sends a Discord notification.
97
+ 4. The vault is now live at `https://gobispace.com/@{vaultSlug}`.
98
+
99
+ > **Important:** Any time you change `BRAIN.md` frontmatter (e.g. adding or updating `homepage`), you must re-run `gobi brain publish` for the changes to take effect.
100
+
101
+ ## Reference Documentation
102
+
103
+ - [gobi brain](references/brain.md)
@@ -0,0 +1,110 @@
1
+ # gobi brain
2
+
3
+ ```
4
+ Usage: gobi brain [options] [command]
5
+
6
+ Brain commands (search, ask, publish, unpublish, updates).
7
+
8
+ Options:
9
+ -h, --help display help for command
10
+
11
+ Commands:
12
+ search [options] Search public brains by text and semantic similarity.
13
+ ask [options] Ask a brain a question. Creates a targeted session (1:1 conversation).
14
+ publish Upload BRAIN.md to the vault root on webdrive. Triggers post-processing (brain sync, metadata update, Discord notification).
15
+ unpublish Delete BRAIN.md from the vault on webdrive.
16
+ post-update [options] Post a brain update for a vault.
17
+ edit-update [options] <updateId> Edit a published brain update. You must be the author.
18
+ delete-update <updateId> Delete a published brain update. You must be the author.
19
+ help [command] display help for command
20
+ ```
21
+
22
+ ## search
23
+
24
+ ```
25
+ Usage: gobi brain search [options]
26
+
27
+ Search public brains by text and semantic similarity.
28
+
29
+ Options:
30
+ --query <query> Search query
31
+ -h, --help display help for command
32
+ ```
33
+
34
+ ## ask
35
+
36
+ ```
37
+ Usage: gobi brain ask [options]
38
+
39
+ Ask a brain a question. Creates a targeted session (1:1 conversation).
40
+
41
+ Options:
42
+ --vault-slug <vaultSlug> Slug of the brain/vault to ask
43
+ --question <question> The question to ask (markdown supported)
44
+ --rich-text <richText> Rich-text JSON array (e.g. [{"type":"text","text":"hello"}])
45
+ --mode <mode> Session mode: "auto" or "manual"
46
+ -h, --help display help for command
47
+ ```
48
+
49
+ ## publish
50
+
51
+ ```
52
+ Usage: gobi brain publish [options]
53
+
54
+ Upload BRAIN.md to the vault root on webdrive. Triggers post-processing (brain sync, metadata update, Discord notification).
55
+
56
+ Options:
57
+ -h, --help display help for command
58
+ ```
59
+
60
+ ## unpublish
61
+
62
+ ```
63
+ Usage: gobi brain unpublish [options]
64
+
65
+ Delete BRAIN.md from the vault on webdrive.
66
+
67
+ Options:
68
+ -h, --help display help for command
69
+ ```
70
+
71
+ ## post-update
72
+
73
+ ```
74
+ Usage: gobi brain post-update [options]
75
+
76
+ Post a brain update for a vault.
77
+
78
+ Options:
79
+ --vault-slug <vaultSlug> Vault slug (overrides .gobi/settings.yaml)
80
+ --title <title> Title of the update
81
+ --content <content> Update content (markdown supported)
82
+ --auto-attachments Upload wiki-linked [[files]] to webdrive before posting
83
+ -h, --help display help for command
84
+ ```
85
+
86
+ ## edit-update
87
+
88
+ ```
89
+ Usage: gobi brain edit-update [options] <updateId>
90
+
91
+ Edit a published brain update. You must be the author.
92
+
93
+ Options:
94
+ --title <title> New title for the update
95
+ --content <content> New content for the update (markdown supported)
96
+ --vault-slug <vaultSlug> Vault slug for attachment uploads (overrides .gobi/settings.yaml)
97
+ --auto-attachments Upload wiki-linked [[files]] to webdrive before editing
98
+ -h, --help display help for command
99
+ ```
100
+
101
+ ## delete-update
102
+
103
+ ```
104
+ Usage: gobi brain delete-update [options] <updateId>
105
+
106
+ Delete a published brain update. You must be the author.
107
+
108
+ Options:
109
+ -h, --help display help for command
110
+ ```
@@ -38,8 +38,9 @@ brew tap gobi-ai/tap && brew install gobi
38
38
 
39
39
  ## Key Concepts
40
40
 
41
- - **Space**: A shared space for a group or community. A logged-in user can be a member of one or more spaces. A space contains threads, sessions, and connected vaults.
42
- - **Vault**: A personal knowledge container — a filetree storage of information and knowledge that can also be searched and asked questions like a knowledge base. A local directory becomes a vault when it contains `.gobi/settings.yaml` with a vault slug and a space slug. Each vault is identified by a slug (e.g. `brave-path-zr962w`). Publish a `PUBLISH.md` document at the vault root to configure the vault's public profile and AI agent.
41
+ - **Space**: A shared space for a group or community. A logged-in user can be a member of one or more spaces. A space contains threads, sessions, brain updates, and connected vaults.
42
+ - **Vault**: A filetree storage of information and knowledge. A local directory becomes a vault when it contains `.gobi/settings.yaml` with a vault slug and a space slug. Each vault is identified by a slug (e.g. `brave-path-zr962w`).
43
+ - **Brain**: Another name for a vault when referring to its AI-searchable knowledge. You can search brains, ask them questions, and publish a `BRAIN.md` document to configure your vault's brain.
43
44
 
44
45
  ## First-Time Setup
45
46
 
@@ -55,7 +56,7 @@ This is an **interactive** command that:
55
56
  1. Logs in automatically if not already authenticated (opens a browser URL for Google OAuth)
56
57
  2. Prompts the user to select an existing vault or create a new one
57
58
  3. Writes `.gobi/settings.yaml` in the current directory with the chosen vault slug
58
- 4. Creates a `PUBLISH.md` file if one doesn't exist
59
+ 4. Creates a `BRAIN.md` file if one doesn't exist
59
60
 
60
61
  ### Step 2: Select a Space
61
62
 
@@ -127,7 +128,7 @@ JSON responses have the shape `{ "success": true, "data": ... }` on success or `
127
128
  |------|-------------|
128
129
  | `~/.gobi/credentials.json` | Stored authentication tokens (auto-managed) |
129
130
  | `.gobi/settings.yaml` | Per-project vault and space configuration |
130
- | `PUBLISH.md` | Vault profile document with YAML frontmatter, published via `gobi vault publish` |
131
+ | `BRAIN.md` | Brain document with YAML frontmatter, published via `gobi brain publish` |
131
132
 
132
133
  ## Environment Variables
133
134
 
@@ -3,7 +3,7 @@
3
3
  ```
4
4
  Usage: gobi space [options] [command]
5
5
 
6
- Space commands. A Space is a shared room of members where they post threads and replies, organized by topics.
6
+ Space commands (threads, replies).
7
7
 
8
8
  Options:
9
9
  --space-slug <slug> Space slug (overrides .gobi/settings.yaml)
@@ -11,12 +11,9 @@ Options:
11
11
 
12
12
  Commands:
13
13
  list List spaces you are a member of.
14
- get [spaceSlug] Get details for a space. Pass a slug or omit to use the current space (from .gobi/settings.yaml or --space-slug).
15
14
  warp [spaceSlug] Select the active space. Pass a slug to warp directly, or omit for interactive selection.
16
15
  list-topics [options] List topics in a space, ordered by most recent content linkage.
17
16
  list-topic-threads [options] <topicSlug> List threads tagged with a topic in a space (cursor-paginated).
18
- messages [options] List the unified message feed (threads and replies, newest first) in a space.
19
- ancestors <threadId> Show the ancestor lineage of a thread or reply (root → immediate parent).
20
17
  get-thread [options] <threadId> Get a thread and its replies (paginated).
21
18
  list-threads [options] List threads in a space (paginated).
22
19
  create-thread [options] Create a thread in a space.
@@ -0,0 +1,43 @@
1
+ ---
2
+ name: gobi-feed
3
+ description: >-
4
+ Gobi feed commands for the global brain-update feed: list recent brain
5
+ updates from people across the platform, read a single update with its
6
+ replies, and post replies. Use when the user wants to browse what others
7
+ are sharing, follow public discussions, or join a thread.
8
+ allowed-tools: Bash(gobi:*)
9
+ metadata:
10
+ author: gobi-ai
11
+ version: "1.3.0"
12
+ ---
13
+
14
+ # gobi-feed
15
+
16
+ Gobi feed commands for the global brain-update feed (v1.3.0).
17
+
18
+ Requires gobi-cli installed and authenticated. See gobi-core skill for setup.
19
+
20
+ ## What is the feed?
21
+
22
+ The feed is the platform-wide stream of brain updates from public vaults — short posts, learnings, and announcements people share publicly. Use `gobi feed` to read what others are posting and to reply to a discussion.
23
+
24
+ To post your own brain update, use `gobi brain post-update` (the feed is read-mostly; posts are scoped to your vault).
25
+
26
+ ## Important: JSON Mode
27
+
28
+ For programmatic/agent usage, always pass `--json` as a **global** option (before the subcommand):
29
+
30
+ ```bash
31
+ gobi --json feed list
32
+ ```
33
+
34
+ ## Available Commands
35
+
36
+ - `gobi feed` — Feed of brain updates from people across the platform.
37
+ - `gobi feed list` — List recent brain updates from the global public feed.
38
+ - `gobi feed get` — Get a feed brain update and its replies (paginated).
39
+ - `gobi feed reply` — Reply to a brain update in the feed.
40
+
41
+ ## Reference Documentation
42
+
43
+ - [gobi feed](references/feed.md)
@@ -0,0 +1,80 @@
1
+ # gobi feed
2
+
3
+ ```
4
+ Usage: gobi feed [options] [command]
5
+
6
+ Feed of brain updates from people across the platform.
7
+
8
+ Options:
9
+ -h, --help display help for command
10
+
11
+ Commands:
12
+ list [options] List recent brain updates from the global public feed.
13
+ get [options] <updateId> Get a feed brain update and its replies (paginated).
14
+ post-reply [options] <updateId> Post a reply to a brain update in the feed.
15
+ edit-reply [options] <replyId> Edit a reply you authored in the feed.
16
+ delete-reply <replyId> Delete a reply you authored in the feed.
17
+ help [command] display help for command
18
+ ```
19
+
20
+ ## list
21
+
22
+ ```
23
+ Usage: gobi feed list [options]
24
+
25
+ List recent brain updates from the global public feed.
26
+
27
+ Options:
28
+ --limit <number> Items per page (default: "20")
29
+ --cursor <string> Pagination cursor from previous response
30
+ -h, --help display help for command
31
+ ```
32
+
33
+ ## get
34
+
35
+ ```
36
+ Usage: gobi feed get [options] <updateId>
37
+
38
+ Get a feed brain update and its replies (paginated).
39
+
40
+ Options:
41
+ --limit <number> Replies per page (default: "20")
42
+ --cursor <string> Pagination cursor from previous response
43
+ --full Show full reply content without truncation
44
+ -h, --help display help for command
45
+ ```
46
+
47
+ ## post-reply
48
+
49
+ ```
50
+ Usage: gobi feed post-reply [options] <updateId>
51
+
52
+ Post a reply to a brain update in the feed.
53
+
54
+ Options:
55
+ --content <content> Reply content (markdown supported, use "-" for stdin)
56
+ -h, --help display help for command
57
+ ```
58
+
59
+ ## edit-reply
60
+
61
+ ```
62
+ Usage: gobi feed edit-reply [options] <replyId>
63
+
64
+ Edit a reply you authored in the feed.
65
+
66
+ Options:
67
+ --content <content> New reply content (markdown supported, use "-" for stdin)
68
+ -h, --help display help for command
69
+ ```
70
+
71
+ ## delete-reply
72
+
73
+ ```
74
+ Usage: gobi feed delete-reply [options] <replyId>
75
+
76
+ Delete a reply you authored in the feed.
77
+
78
+ Options:
79
+ -h, --help display help for command
80
+ ```