@gobi-ai/cli 0.6.17 → 0.6.19
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.
- package/.claude-plugin/marketplace.json +24 -0
- package/.claude-plugin/plugin.json +13 -0
- package/dist/commands/update.js +73 -0
- package/dist/main.js +3 -1
- package/package.json +3 -2
- package/skills/gobi/SKILL.md +2 -2
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "gobi",
|
|
3
|
+
"owner": {
|
|
4
|
+
"name": "gobi-ai"
|
|
5
|
+
},
|
|
6
|
+
"description": "Claude Code plugin for the Gobi collaborative knowledge platform CLI",
|
|
7
|
+
"version": "0.6.18",
|
|
8
|
+
"plugins": [
|
|
9
|
+
{
|
|
10
|
+
"name": "gobi",
|
|
11
|
+
"description": "Manage the Gobi collaborative knowledge platform from the command line. Search and ask brains, publish brain documents, create threads, manage sessions.",
|
|
12
|
+
"version": "0.6.18",
|
|
13
|
+
"author": {
|
|
14
|
+
"name": "gobi-ai"
|
|
15
|
+
},
|
|
16
|
+
"homepage": "https://github.com/gobi-ai/gobi-cli",
|
|
17
|
+
"source": "./",
|
|
18
|
+
"skills": [
|
|
19
|
+
"./skills/gobi"
|
|
20
|
+
],
|
|
21
|
+
"commands": "./commands"
|
|
22
|
+
}
|
|
23
|
+
]
|
|
24
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "gobi",
|
|
3
|
+
"description": "Manage the Gobi collaborative knowledge platform from the command line",
|
|
4
|
+
"version": "0.6.18",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "gobi-ai"
|
|
7
|
+
},
|
|
8
|
+
"homepage": "https://github.com/gobi-ai/gobi-cli",
|
|
9
|
+
"skills": [
|
|
10
|
+
"./skills/gobi"
|
|
11
|
+
],
|
|
12
|
+
"commands": "./commands"
|
|
13
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { execSync } from "child_process";
|
|
2
|
+
import { createRequire } from "module";
|
|
3
|
+
const require = createRequire(import.meta.url);
|
|
4
|
+
const { version: currentVersion } = require("../../package.json");
|
|
5
|
+
async function fetchLatestVersion() {
|
|
6
|
+
const res = await fetch("https://registry.npmjs.org/@gobi-ai/cli/latest");
|
|
7
|
+
if (!res.ok) {
|
|
8
|
+
throw new Error(`Failed to check for updates: HTTP ${res.status}`);
|
|
9
|
+
}
|
|
10
|
+
const data = (await res.json());
|
|
11
|
+
return data.version;
|
|
12
|
+
}
|
|
13
|
+
function detectInstallMethod() {
|
|
14
|
+
try {
|
|
15
|
+
const gobiBin = execSync("which gobi", { encoding: "utf-8" }).trim();
|
|
16
|
+
if (gobiBin.includes("/Cellar/") || gobiBin.includes("/homebrew/")) {
|
|
17
|
+
return "brew";
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
catch {
|
|
21
|
+
// ignore
|
|
22
|
+
}
|
|
23
|
+
try {
|
|
24
|
+
const npmGlobalDir = execSync("npm root -g", { encoding: "utf-8" }).trim();
|
|
25
|
+
const gobiBin = execSync("which gobi", { encoding: "utf-8" }).trim();
|
|
26
|
+
if (gobiBin.includes(npmGlobalDir.replace("/lib/node_modules", ""))) {
|
|
27
|
+
return "npm";
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
catch {
|
|
31
|
+
// ignore
|
|
32
|
+
}
|
|
33
|
+
return "npm"; // default to npm
|
|
34
|
+
}
|
|
35
|
+
export function registerUpdateCommand(program) {
|
|
36
|
+
program
|
|
37
|
+
.command("update")
|
|
38
|
+
.description("Update gobi-cli to the latest version.")
|
|
39
|
+
.option("--check", "Only check for updates without installing")
|
|
40
|
+
.action(async (opts) => {
|
|
41
|
+
const latestVersion = await fetchLatestVersion();
|
|
42
|
+
if (currentVersion === latestVersion) {
|
|
43
|
+
console.log(`Already up to date (v${currentVersion}).`);
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
console.log(`Current version: v${currentVersion}`);
|
|
47
|
+
console.log(`Latest version: v${latestVersion}`);
|
|
48
|
+
if (opts.check) {
|
|
49
|
+
console.log("\nRun 'gobi update' to install the latest version.");
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
const method = detectInstallMethod();
|
|
53
|
+
console.log(`\nUpdating via ${method}...`);
|
|
54
|
+
try {
|
|
55
|
+
if (method === "brew") {
|
|
56
|
+
execSync("brew upgrade gobi", { stdio: "inherit" });
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
execSync("npm install -g @gobi-ai/cli@latest", {
|
|
60
|
+
stdio: "inherit",
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
console.log(`\nSuccessfully updated to v${latestVersion}.`);
|
|
64
|
+
}
|
|
65
|
+
catch {
|
|
66
|
+
console.error("\nUpdate failed. Try manually:\n" +
|
|
67
|
+
(method === "brew"
|
|
68
|
+
? " brew upgrade gobi"
|
|
69
|
+
: " npm install -g @gobi-ai/cli@latest"));
|
|
70
|
+
process.exit(1);
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
}
|
package/dist/main.js
CHANGED
|
@@ -9,9 +9,10 @@ import { registerBrainCommand } from "./commands/brain.js";
|
|
|
9
9
|
import { registerSessionsCommand } from "./commands/sessions.js";
|
|
10
10
|
import { registerSenseCommand } from "./commands/sense.js";
|
|
11
11
|
import { registerSyncCommand } from "./commands/sync.js";
|
|
12
|
+
import { registerUpdateCommand } from "./commands/update.js";
|
|
12
13
|
const require = createRequire(import.meta.url);
|
|
13
14
|
const { version } = require("../package.json");
|
|
14
|
-
const SKIP_BANNER_COMMANDS = new Set(["auth", "init"]);
|
|
15
|
+
const SKIP_BANNER_COMMANDS = new Set(["auth", "init", "update"]);
|
|
15
16
|
function shouldShowBanner() {
|
|
16
17
|
const args = process.argv.slice(2);
|
|
17
18
|
if (args.length === 0)
|
|
@@ -34,6 +35,7 @@ export async function cli() {
|
|
|
34
35
|
registerSessionsCommand(program);
|
|
35
36
|
registerSenseCommand(program);
|
|
36
37
|
registerSyncCommand(program);
|
|
38
|
+
registerUpdateCommand(program);
|
|
37
39
|
// Propagate helpWidth to all subcommands
|
|
38
40
|
const helpWidth = process.stdout.columns || 200;
|
|
39
41
|
for (const cmd of program.commands) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gobi-ai/cli",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.19",
|
|
4
4
|
"description": "CLI client for the Gobi collaborative knowledge platform",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -27,7 +27,8 @@
|
|
|
27
27
|
"files": [
|
|
28
28
|
"dist",
|
|
29
29
|
"!dist/**/*.test.js",
|
|
30
|
-
"skills"
|
|
30
|
+
"skills",
|
|
31
|
+
".claude-plugin"
|
|
31
32
|
],
|
|
32
33
|
"bin": {
|
|
33
34
|
"gobi": "./dist/index.js"
|
package/skills/gobi/SKILL.md
CHANGED
|
@@ -10,12 +10,12 @@ description: >-
|
|
|
10
10
|
allowed-tools: Bash(gobi:*)
|
|
11
11
|
metadata:
|
|
12
12
|
author: gobi-ai
|
|
13
|
-
version: "0.6.
|
|
13
|
+
version: "0.6.18"
|
|
14
14
|
---
|
|
15
15
|
|
|
16
16
|
# gobi-cli
|
|
17
17
|
|
|
18
|
-
A CLI client for the Gobi collaborative knowledge platform (v0.6.
|
|
18
|
+
A CLI client for the Gobi collaborative knowledge platform (v0.6.18).
|
|
19
19
|
|
|
20
20
|
## Prerequisites
|
|
21
21
|
|