@gaiaworks/gaia-cli 0.0.3 → 0.0.4
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/README.md +4 -4
- package/package.json +2 -2
- package/scripts/install-wizard.js +7 -7
- package/scripts/install.js +0 -0
- package/scripts/run.js +0 -0
package/README.md
CHANGED
|
@@ -14,17 +14,17 @@ npx @gaiaworks/gaia-cli version
|
|
|
14
14
|
|
|
15
15
|
```bash
|
|
16
16
|
npx @gaiaworks/gaia-cli@latest install
|
|
17
|
-
gaia
|
|
17
|
+
gaia version
|
|
18
18
|
```
|
|
19
19
|
|
|
20
20
|
安装模式:
|
|
21
21
|
|
|
22
22
|
```bash
|
|
23
23
|
npx @gaiaworks/gaia-cli@latest install
|
|
24
|
-
npx @gaiaworks/gaia-cli@latest install --mode
|
|
25
|
-
npx @gaiaworks/gaia-cli@latest install --mode
|
|
24
|
+
npx @gaiaworks/gaia-cli@latest install --mode external
|
|
25
|
+
npx @gaiaworks/gaia-cli@latest install --mode internal
|
|
26
26
|
```
|
|
27
27
|
|
|
28
|
-
未指定 `--mode` 时默认写入 `
|
|
28
|
+
未指定 `--mode` 时默认写入 `external`。安装脚本会执行 `gaia setup --mode <external|internal>`,用于初始化本地 `install_mode` 和 Agent Skills。
|
|
29
29
|
|
|
30
30
|
安装时会根据 npm 包版本,从 OSS 的同版本目录下载当前平台对应的 `gaia-cli` 二进制。
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gaiaworks/gaia-cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"description": "JavaScript launcher for gaia-cli.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"private": false,
|
|
7
7
|
"bin": {
|
|
8
|
-
"gaia
|
|
8
|
+
"gaia": "scripts/run.js"
|
|
9
9
|
},
|
|
10
10
|
"os": [
|
|
11
11
|
"darwin",
|
|
@@ -11,7 +11,7 @@ const packageSpec = `${packageJson.name}@${packageJson.version}`;
|
|
|
11
11
|
const binaryPath = path.join(__dirname, '..', 'bin', binaryName());
|
|
12
12
|
|
|
13
13
|
function parseInstallArgs(args) {
|
|
14
|
-
let mode = '
|
|
14
|
+
let mode = 'external';
|
|
15
15
|
let explicitMode = false;
|
|
16
16
|
const npmArgs = [];
|
|
17
17
|
|
|
@@ -20,7 +20,7 @@ function parseInstallArgs(args) {
|
|
|
20
20
|
if (arg === '--mode') {
|
|
21
21
|
const value = args[i + 1];
|
|
22
22
|
if (!value) {
|
|
23
|
-
throw new Error('--mode requires a value:
|
|
23
|
+
throw new Error('--mode requires a value: external or internal');
|
|
24
24
|
}
|
|
25
25
|
mode = value;
|
|
26
26
|
explicitMode = true;
|
|
@@ -35,8 +35,8 @@ function parseInstallArgs(args) {
|
|
|
35
35
|
npmArgs.push(arg);
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
if (mode !== '
|
|
39
|
-
throw new Error(`Unsupported mode: ${mode}. Expected
|
|
38
|
+
if (mode !== 'external' && mode !== 'internal') {
|
|
39
|
+
throw new Error(`Unsupported mode: ${mode}. Expected external or internal.`);
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
return { explicitMode, mode, npmArgs };
|
|
@@ -70,11 +70,11 @@ function installWizard(args) {
|
|
|
70
70
|
|
|
71
71
|
ensureLocalBinary();
|
|
72
72
|
run('npm', ['install', '-g', packageSpec]);
|
|
73
|
-
run(binaryPath, ['
|
|
73
|
+
run(binaryPath, ['setup', '--mode', mode], { stdio: 'ignore' });
|
|
74
74
|
if (explicitMode) {
|
|
75
|
-
console.error(`[gaia-cli] 安装完成,当前模式: ${mode}。可以执行: gaia
|
|
75
|
+
console.error(`[gaia-cli] 安装完成,当前模式: ${mode}。可以执行: gaia version`);
|
|
76
76
|
} else {
|
|
77
|
-
console.error('[gaia-cli] 安装完成。可以执行: gaia
|
|
77
|
+
console.error('[gaia-cli] 安装完成。可以执行: gaia version');
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
|
package/scripts/install.js
CHANGED
|
File without changes
|
package/scripts/run.js
CHANGED
|
File without changes
|