@guandata/guanskill 0.1.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.
- package/CHANGELOG.md +7 -0
- package/README.md +47 -0
- package/bin/run.js +121 -0
- package/package.json +43 -0
package/CHANGELOG.md
ADDED
package/README.md
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# @guandata/guanskill
|
|
2
|
+
|
|
3
|
+
Guandata BI Skills 聚合安装包,用于一次性安装和更新观远 BI 命令行工具与常用 AI skills。
|
|
4
|
+
|
|
5
|
+
## 安装
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install -g @guandata/guanskill
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
安装后可直接使用以下命令:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
guancli
|
|
15
|
+
guands
|
|
16
|
+
guanetl
|
|
17
|
+
guanwf
|
|
18
|
+
guanvis
|
|
19
|
+
guanexport
|
|
20
|
+
guanadmin
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
如需把这些工具对应的 AI skills 安装到本机编码助手环境:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
guanskill install-skill
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## 包含组件
|
|
30
|
+
|
|
31
|
+
| 组件 | 版本 | 用途 |
|
|
32
|
+
|---|---:|---|
|
|
33
|
+
| `@guandata/guancli` | `1.0.29` | 观远 BI 基础命令行工具 |
|
|
34
|
+
| `@guandata/guands` | `0.1.12` | 数据源和数据集管理 |
|
|
35
|
+
| `@guandata/guanetl` | `0.1.11` | ETL 编辑、预览和执行 |
|
|
36
|
+
| `@guandata/guanwf` | `0.1.3` | 工作流数据流管理 |
|
|
37
|
+
| `@guandata/guanvis` | `0.1.20` | 图表、卡片和仪表板构建 |
|
|
38
|
+
| `@guandata/guanexport` | `0.1.8` | 导出相关 legacy 能力 |
|
|
39
|
+
| `@guandata/guanadmin` | `0.1.5` | 管理员操作 |
|
|
40
|
+
|
|
41
|
+
## 版本更新
|
|
42
|
+
|
|
43
|
+
### 0.1.0
|
|
44
|
+
|
|
45
|
+
- 新增 Guandata BI Skills 聚合安装包,统一安装和更新 guancli、guands、guanetl、guanwf、guanvis、guanexport、guanadmin。
|
|
46
|
+
- 聚合包提供同名命令转发入口,全局安装后可直接使用各组件命令。
|
|
47
|
+
- 新增 `guanskill install-skill`,用于一次性把聚合包内的 AI skills 安装到本机编码助手环境。
|
package/bin/run.js
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
"use strict";
|
|
4
|
+
|
|
5
|
+
const { spawnSync } = require("child_process");
|
|
6
|
+
const path = require("path");
|
|
7
|
+
|
|
8
|
+
const COMPONENTS = [
|
|
9
|
+
{ command: "guancli", packageName: "@guandata/guancli" },
|
|
10
|
+
{ command: "guands", packageName: "@guandata/guands" },
|
|
11
|
+
{ command: "guanetl", packageName: "@guandata/guanetl" },
|
|
12
|
+
{ command: "guanwf", packageName: "@guandata/guanwf" },
|
|
13
|
+
{ command: "guanvis", packageName: "@guandata/guanvis" },
|
|
14
|
+
{ command: "guanexport", packageName: "@guandata/guanexport" },
|
|
15
|
+
{ command: "guanadmin", packageName: "@guandata/guanadmin" },
|
|
16
|
+
];
|
|
17
|
+
|
|
18
|
+
function ownPackage() {
|
|
19
|
+
return require(path.join(__dirname, "..", "package.json"));
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function componentForCommand(command) {
|
|
23
|
+
return COMPONENTS.find((component) => component.command === command);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function runNodeScript(scriptPath, args) {
|
|
27
|
+
const result = spawnSync(process.execPath, [scriptPath, ...args], {
|
|
28
|
+
stdio: "inherit",
|
|
29
|
+
env: process.env,
|
|
30
|
+
});
|
|
31
|
+
if (result.error) {
|
|
32
|
+
throw result.error;
|
|
33
|
+
}
|
|
34
|
+
process.exit(result.status == null ? 1 : result.status);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function resolveComponentBin(component) {
|
|
38
|
+
try {
|
|
39
|
+
return require.resolve(`${component.packageName}/bin/run.js`);
|
|
40
|
+
} catch (err) {
|
|
41
|
+
console.error(
|
|
42
|
+
`Cannot find ${component.packageName}. Reinstall with: npm install -g @guandata/guanskill`
|
|
43
|
+
);
|
|
44
|
+
process.exit(1);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function printVersion() {
|
|
49
|
+
const pkg = ownPackage();
|
|
50
|
+
console.log(`${pkg.name} ${pkg.version}`);
|
|
51
|
+
for (const component of COMPONENTS) {
|
|
52
|
+
try {
|
|
53
|
+
const componentPkg = require(`${component.packageName}/package.json`);
|
|
54
|
+
console.log(`${component.packageName} ${componentPkg.version}`);
|
|
55
|
+
} catch (_) {
|
|
56
|
+
console.log(`${component.packageName} unavailable`);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function installAllSkills(extraArgs) {
|
|
62
|
+
for (const component of COMPONENTS) {
|
|
63
|
+
const scriptPath = resolveComponentBin(component);
|
|
64
|
+
console.log(`\n== ${component.command} install-skill ==`);
|
|
65
|
+
const result = spawnSync(process.execPath, [scriptPath, "install-skill", ...extraArgs], {
|
|
66
|
+
stdio: "inherit",
|
|
67
|
+
env: process.env,
|
|
68
|
+
});
|
|
69
|
+
if (result.error) {
|
|
70
|
+
throw result.error;
|
|
71
|
+
}
|
|
72
|
+
if (result.status) {
|
|
73
|
+
process.exit(result.status);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function printHelp() {
|
|
79
|
+
console.log(`Guandata BI Skills aggregate package
|
|
80
|
+
|
|
81
|
+
Usage:
|
|
82
|
+
guanskill version
|
|
83
|
+
guanskill install-skill
|
|
84
|
+
guancli <args>
|
|
85
|
+
guands <args>
|
|
86
|
+
guanetl <args>
|
|
87
|
+
guanwf <args>
|
|
88
|
+
guanvis <args>
|
|
89
|
+
guanexport <args>
|
|
90
|
+
guanadmin <args>
|
|
91
|
+
`);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function main() {
|
|
95
|
+
const invoked = path.basename(process.argv[1] || "").replace(/\.cmd$/i, "");
|
|
96
|
+
const args = process.argv.slice(2);
|
|
97
|
+
const component = componentForCommand(invoked);
|
|
98
|
+
if (component) {
|
|
99
|
+
runNodeScript(resolveComponentBin(component), args);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
const command = args[0];
|
|
103
|
+
if (!command || command === "help" || command === "--help" || command === "-h") {
|
|
104
|
+
printHelp();
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
if (command === "version" || command === "--version" || command === "-v") {
|
|
108
|
+
printVersion();
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
if (command === "install-skill") {
|
|
112
|
+
installAllSkills(args.slice(1));
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
console.error(`Unknown guanskill command: ${command}`);
|
|
117
|
+
printHelp();
|
|
118
|
+
process.exit(1);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
main();
|
package/package.json
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@guandata/guanskill",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Guandata BI Skills 聚合安装包 - 一次性安装和更新 guancli、guands、guanetl、guanwf、guanvis、guanexport、guanadmin",
|
|
5
|
+
"bin": {
|
|
6
|
+
"guanskill": "bin/run.js",
|
|
7
|
+
"guancli": "bin/run.js",
|
|
8
|
+
"guands": "bin/run.js",
|
|
9
|
+
"guanetl": "bin/run.js",
|
|
10
|
+
"guanwf": "bin/run.js",
|
|
11
|
+
"guanvis": "bin/run.js",
|
|
12
|
+
"guanexport": "bin/run.js",
|
|
13
|
+
"guanadmin": "bin/run.js"
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"bin/",
|
|
17
|
+
"CHANGELOG.md",
|
|
18
|
+
"README.md"
|
|
19
|
+
],
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"@guandata/guanadmin": "0.1.5",
|
|
22
|
+
"@guandata/guancli": "1.0.29",
|
|
23
|
+
"@guandata/guands": "0.1.12",
|
|
24
|
+
"@guandata/guanetl": "0.1.11",
|
|
25
|
+
"@guandata/guanexport": "0.1.8",
|
|
26
|
+
"@guandata/guanvis": "0.1.20",
|
|
27
|
+
"@guandata/guanwf": "0.1.3"
|
|
28
|
+
},
|
|
29
|
+
"keywords": [
|
|
30
|
+
"guandata",
|
|
31
|
+
"bi",
|
|
32
|
+
"cli",
|
|
33
|
+
"agent-skill"
|
|
34
|
+
],
|
|
35
|
+
"license": "UNLICENSED",
|
|
36
|
+
"engines": {
|
|
37
|
+
"node": ">=14"
|
|
38
|
+
},
|
|
39
|
+
"publishConfig": {
|
|
40
|
+
"registry": "https://registry.npmjs.org/",
|
|
41
|
+
"access": "public"
|
|
42
|
+
}
|
|
43
|
+
}
|