@guandata/guancli 1.0.35 → 1.0.37
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 +13 -0
- package/LICENSE +133 -0
- package/LICENSE.zh-CN +82 -0
- package/README.md +13 -0
- package/bin/run.js +26 -14
- package/binaries/guancli-darwin-arm64 +0 -0
- package/binaries/guancli-darwin-x64 +0 -0
- package/binaries/guancli-linux-arm64 +0 -0
- package/binaries/guancli-linux-x64 +0 -0
- package/binaries/guancli-win32-x64.exe +0 -0
- package/package.json +4 -2
- package/skills/guancli/SKILL.md +33 -5
- package/skills/guancli/references/metric-commands.md +56 -0
- package/skills/guancli/references/metric-mutation.md +2 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## @guandata/guancli 1.0.37 - 2026-07-01
|
|
4
|
+
|
|
5
|
+
- 新增 Personal Access Token 登录方式,支持在自动化、CI 或无浏览器环境中使用 PAT 完成认证。
|
|
6
|
+
- `auth` 相关命令增强 PAT profile 的状态展示和修改保护,避免把 PAT 配置误当普通登录配置处理。
|
|
7
|
+
- API 调用会根据当前认证上下文选择合适的身份信息,提升 PAT 场景下调用 ChatBI、指标和资源接口的稳定性。
|
|
8
|
+
|
|
9
|
+
## @guandata/guancli 1.0.36 - 2026-06-24
|
|
10
|
+
|
|
11
|
+
- `metric` 增加指标主题和指标目录创建能力,便于直接准备指标管理结构。
|
|
12
|
+
- 补充 SuperApp 创建指导,帮助 Agent 按应用和页面场景组织 BI 配置。
|
|
13
|
+
- 页面资源搜索和结果展示增强,按名称或 ID 查找页面时结果更稳定、更易读。
|
|
14
|
+
- `install-skill` 适配 WorkBuddy 配置目录,提升本机编码助手安装兼容性。
|
|
15
|
+
|
|
3
16
|
## @guandata/guancli 1.0.35 - 2026-06-17
|
|
4
17
|
|
|
5
18
|
- `metric by-dataset` 增强数据集下游指标查询,并补充指标创建/编辑参考说明。
|
package/LICENSE
ADDED
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
Guandata Developer Tools Free Evaluation License
|
|
2
|
+
|
|
3
|
+
Copyright (c) Hangzhou Guandata Co., Ltd.
|
|
4
|
+
|
|
5
|
+
This software and its related source code, documentation, examples, packages,
|
|
6
|
+
configuration files, command-line tools, MCP servers, SDKs, plugins, and tool
|
|
7
|
+
integrations are proprietary software of Hangzhou Guandata Co., Ltd. or its
|
|
8
|
+
licensors.
|
|
9
|
+
|
|
10
|
+
This license applies to Guandata developer tools, including but not limited to
|
|
11
|
+
Guandata CLI, Guandata MCP Server, related npm packages, source code,
|
|
12
|
+
documentation, examples, configuration files, and tool integrations.
|
|
13
|
+
|
|
14
|
+
1. Free Personal Evaluation Use
|
|
15
|
+
|
|
16
|
+
Hangzhou Guandata Co., Ltd. grants you a limited, non-exclusive,
|
|
17
|
+
non-transferable, revocable license to use this software free of charge solely
|
|
18
|
+
for personal learning, local testing, technical evaluation, and non-production
|
|
19
|
+
experiments.
|
|
20
|
+
|
|
21
|
+
This free license does not permit enterprise, commercial, production, internal
|
|
22
|
+
business, team, organizational, hosted, customer-facing, or revenue-generating
|
|
23
|
+
use.
|
|
24
|
+
|
|
25
|
+
2. Enterprise and Commercial Use
|
|
26
|
+
|
|
27
|
+
Any use by or for a company, organization, institution, government entity, team,
|
|
28
|
+
client, or other non-individual entity requires a separate commercial license
|
|
29
|
+
from Hangzhou Guandata Co., Ltd.
|
|
30
|
+
|
|
31
|
+
Enterprise or commercial use includes, but is not limited to:
|
|
32
|
+
|
|
33
|
+
- use in production, staging, shared, or hosted environments;
|
|
34
|
+
- use for internal business operations or automated business workflows;
|
|
35
|
+
- use by employees, contractors, consultants, service providers, or
|
|
36
|
+
representatives on behalf of an organization;
|
|
37
|
+
- integration into commercial products, services, platforms, workflows, AI
|
|
38
|
+
agents, MCP clients, or customer deliverables;
|
|
39
|
+
- connection to, access to, processing of, exposure of, or operation on
|
|
40
|
+
enterprise data, business systems, customer data, or production data;
|
|
41
|
+
- redistribution, hosting, resale, sublicensing, or provision of this software
|
|
42
|
+
as part of a paid or unpaid service.
|
|
43
|
+
|
|
44
|
+
To obtain an enterprise or commercial license, please contact Hangzhou Guandata
|
|
45
|
+
Co., Ltd. through its official sales, support, or business channels.
|
|
46
|
+
|
|
47
|
+
3. MCP Server and Agent Integration
|
|
48
|
+
|
|
49
|
+
For Guandata MCP Server or any MCP-compatible tool integration, the free license
|
|
50
|
+
is limited to local personal testing, learning, and non-production evaluation.
|
|
51
|
+
|
|
52
|
+
The free license does not permit use of the MCP Server in enterprise agent
|
|
53
|
+
platforms, production AI applications, shared team environments,
|
|
54
|
+
customer-facing systems, hosted services, automated business workflows, or
|
|
55
|
+
integrations that access, process, expose, or operate on enterprise data.
|
|
56
|
+
|
|
57
|
+
Any organizational, commercial, hosted, production, or data-connected use of the
|
|
58
|
+
MCP Server requires a separate commercial license from Hangzhou Guandata Co., Ltd.
|
|
59
|
+
|
|
60
|
+
4. Restrictions
|
|
61
|
+
|
|
62
|
+
Unless expressly permitted by this license, reasonably necessary to install and
|
|
63
|
+
use the software as allowed by this license, or expressly permitted by a
|
|
64
|
+
separate written agreement with Hangzhou Guandata Co., Ltd., you may not:
|
|
65
|
+
|
|
66
|
+
- copy, distribute, sublicense, sell, lease, host, or provide this software to
|
|
67
|
+
third parties;
|
|
68
|
+
- modify, adapt, translate, create derivative works of, or otherwise alter this
|
|
69
|
+
software;
|
|
70
|
+
- reverse engineer, decompile, disassemble, or attempt to derive the source
|
|
71
|
+
code, structure, sequence, organization, or underlying ideas of this software,
|
|
72
|
+
except to the extent such restriction is prohibited by applicable law;
|
|
73
|
+
- remove or alter copyright, trademark, license, or proprietary notices;
|
|
74
|
+
- use Guandata names, logos, trademarks, product names, or brand assets without
|
|
75
|
+
permission;
|
|
76
|
+
- use this software in violation of applicable laws, regulations, or third-party
|
|
77
|
+
rights;
|
|
78
|
+
- circumvent license, access control, usage limitation, telemetry, audit, or
|
|
79
|
+
security mechanisms, if any.
|
|
80
|
+
|
|
81
|
+
5. Ownership
|
|
82
|
+
|
|
83
|
+
Hangzhou Guandata Co., Ltd. and its licensors retain all rights, title, and
|
|
84
|
+
interest in and to this software. No rights are granted except as expressly
|
|
85
|
+
stated in this license.
|
|
86
|
+
|
|
87
|
+
6. Third-Party Components
|
|
88
|
+
|
|
89
|
+
Third-party open source components, if any, are licensed under their respective
|
|
90
|
+
licenses. This license applies only to software owned by Hangzhou Guandata Co., Ltd.
|
|
91
|
+
and does not modify any third-party license terms.
|
|
92
|
+
|
|
93
|
+
7. No Warranty
|
|
94
|
+
|
|
95
|
+
This software is provided "as is" and "as available", without warranties of any
|
|
96
|
+
kind, whether express, implied, statutory, or otherwise, including but not
|
|
97
|
+
limited to warranties of merchantability, fitness for a particular purpose,
|
|
98
|
+
accuracy, availability, security, and non-infringement.
|
|
99
|
+
|
|
100
|
+
8. Limitation of Liability
|
|
101
|
+
|
|
102
|
+
To the maximum extent permitted by applicable law, Hangzhou Guandata Co., Ltd.
|
|
103
|
+
shall not be liable for any indirect, incidental, special, consequential,
|
|
104
|
+
exemplary, or punitive damages, or for any loss of profits, revenue, data,
|
|
105
|
+
goodwill, business opportunity, or business interruption arising from or related
|
|
106
|
+
to this software, even if Hangzhou Guandata Co., Ltd. has been advised of the
|
|
107
|
+
possibility of such damages.
|
|
108
|
+
|
|
109
|
+
9. Termination
|
|
110
|
+
|
|
111
|
+
Your rights under this license terminate automatically if you violate any term of
|
|
112
|
+
this license. Upon termination, you must stop using the software and delete all
|
|
113
|
+
copies in your possession or control.
|
|
114
|
+
|
|
115
|
+
10. Governing Law and Dispute Resolution
|
|
116
|
+
|
|
117
|
+
This license shall be governed by the laws of the People's Republic of China,
|
|
118
|
+
without regard to its conflict of laws principles.
|
|
119
|
+
|
|
120
|
+
Any dispute arising from or related to this license or the software shall be
|
|
121
|
+
submitted to the competent court with jurisdiction in Hangzhou, Zhejiang
|
|
122
|
+
Province, China, unless otherwise required by applicable law.
|
|
123
|
+
|
|
124
|
+
11. Contact
|
|
125
|
+
|
|
126
|
+
For enterprise licensing, commercial authorization, partnership, procurement, or
|
|
127
|
+
other questions, please contact Hangzhou Guandata Co., Ltd. through its official
|
|
128
|
+
website or official business channels.
|
|
129
|
+
|
|
130
|
+
12. Language
|
|
131
|
+
|
|
132
|
+
If this license is provided in multiple languages, the English version controls
|
|
133
|
+
unless Hangzhou Guandata Co., Ltd. expressly states otherwise in writing.
|
package/LICENSE.zh-CN
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
观远开发者工具免费评估许可协议
|
|
2
|
+
|
|
3
|
+
版权所有 (c) 杭州观远数据有限公司。
|
|
4
|
+
|
|
5
|
+
本软件及其相关源代码、文档、示例、软件包、配置文件、命令行工具、MCP Server、SDK、插件和工具集成,属于杭州观远数据有限公司或其授权方的专有软件。
|
|
6
|
+
|
|
7
|
+
本协议适用于观远开发者工具,包括但不限于观远 CLI、观远 MCP Server、相关 npm 包、源代码、文档、示例、配置文件和工具集成。
|
|
8
|
+
|
|
9
|
+
1. 免费个人评估使用
|
|
10
|
+
|
|
11
|
+
杭州观远数据有限公司授予你一项有限的、非独占的、不可转让的、可撤销的许可,允许你免费使用本软件,但仅限于个人学习、本地测试、技术评估和非生产环境实验。
|
|
12
|
+
|
|
13
|
+
本免费许可不允许企业使用、商业使用、生产环境使用、内部业务使用、团队使用、组织使用、托管使用、面向客户的使用,或任何直接或间接产生商业收益的使用。
|
|
14
|
+
|
|
15
|
+
2. 企业及商业使用
|
|
16
|
+
|
|
17
|
+
任何由公司、组织、机构、政府单位、团队、客户或其他非个人主体进行的使用,或代表上述主体进行的使用,均需事先取得杭州观远数据有限公司的单独商业授权。
|
|
18
|
+
|
|
19
|
+
企业或商业使用包括但不限于:
|
|
20
|
+
|
|
21
|
+
- 在生产环境、预发布环境、共享环境或托管环境中使用;
|
|
22
|
+
- 用于内部业务运营或自动化业务流程;
|
|
23
|
+
- 由员工、承包商、顾问、服务商或代理人代表组织使用;
|
|
24
|
+
- 集成到商业产品、服务、平台、工作流、AI 智能体、MCP 客户端或客户交付物中;
|
|
25
|
+
- 连接、访问、处理、暴露或操作企业数据、业务系统、客户数据或生产数据;
|
|
26
|
+
- 对本软件进行分发、托管、转售、再许可,或作为任何付费或免费的服务的一部分提供。
|
|
27
|
+
|
|
28
|
+
如需企业或商业授权,请通过观远官方销售、支持或商务渠道联系杭州观远数据有限公司。
|
|
29
|
+
|
|
30
|
+
3. MCP Server 与智能体集成
|
|
31
|
+
|
|
32
|
+
对于观远 MCP Server 或任何兼容 MCP 的工具集成,免费许可仅限于个人本地测试、学习和非生产环境评估。
|
|
33
|
+
|
|
34
|
+
免费许可不允许将 MCP Server 用于企业级智能体平台、生产环境 AI 应用、团队共享环境、面向客户的系统、托管服务、自动化业务流程,或任何访问、处理、暴露、操作企业数据的集成场景。
|
|
35
|
+
|
|
36
|
+
任何组织用途、商业用途、托管用途、生产用途,或涉及企业数据连接的 MCP Server 使用,均需取得杭州观远数据有限公司的单独商业授权。
|
|
37
|
+
|
|
38
|
+
4. 限制
|
|
39
|
+
|
|
40
|
+
除非本协议明确允许、为按照本协议安装和使用本软件所合理必需,或杭州观远数据有限公司通过单独书面协议明确允许,你不得:
|
|
41
|
+
|
|
42
|
+
- 复制、分发、再许可、销售、出租、托管本软件,或向第三方提供本软件;
|
|
43
|
+
- 修改、改编、翻译本软件,创作本软件的衍生作品,或以其他方式变更本软件;
|
|
44
|
+
- 对本软件进行反向工程、反编译、反汇编,或试图获取本软件的源代码、结构、顺序、组织方式或底层思想,但适用法律禁止限制的情形除外;
|
|
45
|
+
- 删除或修改版权、商标、许可或专有权利声明;
|
|
46
|
+
- 未经许可使用杭州观远数据有限公司或观远品牌的名称、标识、商标、产品名称或品牌资产;
|
|
47
|
+
- 以违反适用法律法规或第三方权利的方式使用本软件;
|
|
48
|
+
- 绕过任何许可、访问控制、使用限制、遥测、审计或安全机制。
|
|
49
|
+
|
|
50
|
+
5. 权利归属
|
|
51
|
+
|
|
52
|
+
本软件的所有权利、所有权和利益均归杭州观远数据有限公司及其授权方所有。除本协议明确授予的权利外,不授予任何其他权利。
|
|
53
|
+
|
|
54
|
+
6. 第三方组件
|
|
55
|
+
|
|
56
|
+
本软件中如包含第三方开源组件,该等组件适用其各自的许可协议。本协议仅适用于杭州观远数据有限公司拥有权利的软件部分,并不修改任何第三方许可条款。
|
|
57
|
+
|
|
58
|
+
7. 无担保
|
|
59
|
+
|
|
60
|
+
本软件按“现状”和“现有”基础提供,不作任何明示、默示、法定或其他形式的担保,包括但不限于适销性、特定用途适用性、准确性、可用性、安全性和不侵权担保。
|
|
61
|
+
|
|
62
|
+
8. 责任限制
|
|
63
|
+
|
|
64
|
+
在适用法律允许的最大范围内,杭州观远数据有限公司不对因本软件引起或与本软件相关的任何间接、附带、特殊、后果性、惩罚性或惩戒性损害承担责任,也不对利润、收入、数据、商誉、商业机会损失或业务中断承担责任,即使杭州观远数据有限公司已被告知可能发生该等损害。
|
|
65
|
+
|
|
66
|
+
9. 终止
|
|
67
|
+
|
|
68
|
+
如果你违反本协议的任何条款,你在本协议项下的权利将自动终止。终止后,你必须停止使用本软件,并删除你持有或控制的所有副本。
|
|
69
|
+
|
|
70
|
+
10. 适用法律与争议解决
|
|
71
|
+
|
|
72
|
+
本协议适用中华人民共和国法律,但不包括其冲突法规则。
|
|
73
|
+
|
|
74
|
+
因本协议或本软件引起或与之相关的任何争议,应提交中国浙江省杭州市有管辖权的人民法院解决,除非适用法律另有强制性规定。
|
|
75
|
+
|
|
76
|
+
11. 联系方式
|
|
77
|
+
|
|
78
|
+
如需企业授权、商业许可、合作、采购或有其他问题,请通过观远官方网站或官方商务渠道联系杭州观远数据有限公司。
|
|
79
|
+
|
|
80
|
+
12. 语言
|
|
81
|
+
|
|
82
|
+
如本协议提供多个语言版本,除非杭州观远数据有限公司另有明确书面说明,以英文版本为准。
|
package/README.md
CHANGED
|
@@ -39,6 +39,19 @@ guancli chatbi query --theme-name "经营主题" --message "最近30天营业收
|
|
|
39
39
|
|
|
40
40
|
## 版本更新
|
|
41
41
|
|
|
42
|
+
### @guandata/guancli 1.0.37
|
|
43
|
+
|
|
44
|
+
- 新增 Personal Access Token 登录方式,支持在自动化、CI 或无浏览器环境中使用 PAT 完成认证。
|
|
45
|
+
- `auth` 相关命令增强 PAT profile 的状态展示和修改保护,避免把 PAT 配置误当普通登录配置处理。
|
|
46
|
+
- API 调用会根据当前认证上下文选择合适的身份信息,提升 PAT 场景下调用 ChatBI、指标和资源接口的稳定性。
|
|
47
|
+
|
|
48
|
+
### @guandata/guancli 1.0.36
|
|
49
|
+
|
|
50
|
+
- `metric` 增加指标主题和指标目录创建能力,便于直接准备指标管理结构。
|
|
51
|
+
- 补充 SuperApp 创建指导,帮助 Agent 按应用和页面场景组织 BI 配置。
|
|
52
|
+
- 页面资源搜索和结果展示增强,按名称或 ID 查找页面时结果更稳定、更易读。
|
|
53
|
+
- `install-skill` 适配 WorkBuddy 配置目录,提升本机编码助手安装兼容性。
|
|
54
|
+
|
|
42
55
|
### @guandata/guancli 1.0.35
|
|
43
56
|
|
|
44
57
|
- `metric by-dataset` 增强数据集下游指标查询,并补充指标创建/编辑参考说明。
|
package/bin/run.js
CHANGED
|
@@ -51,20 +51,32 @@ function copyDirectory(src, dest) {
|
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
function
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}
|
|
54
|
+
function installBuddySkills(pkgRoot, skill) {
|
|
55
|
+
const srcDir = path.join(pkgRoot, "skills", skill);
|
|
56
|
+
if (!fs.existsSync(path.join(srcDir, "SKILL.md"))) {
|
|
57
|
+
console.warn(`Warning: skipping buddy install; skill not found: ${srcDir}`);
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
61
60
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
61
|
+
const targets = [
|
|
62
|
+
{
|
|
63
|
+
name: "CodeBuddy",
|
|
64
|
+
configDir: process.env.CODEBUDDY_CONFIG_DIR || path.join(os.homedir(), ".codebuddy"),
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
name: "WorkBuddy",
|
|
68
|
+
configDir: process.env.WORKBUDDY_CONFIG_DIR || path.join(os.homedir(), ".workbuddy"),
|
|
69
|
+
},
|
|
70
|
+
];
|
|
71
|
+
|
|
72
|
+
for (const target of targets) {
|
|
73
|
+
try {
|
|
74
|
+
const destDir = path.join(target.configDir, "skills", skill);
|
|
75
|
+
copyDirectory(srcDir, destDir);
|
|
76
|
+
console.log(`Installed ${skill} to ${target.name}: ${destDir}`);
|
|
77
|
+
} catch (err) {
|
|
78
|
+
console.warn(`Warning: ${target.name} install failed for ${skill}: ${err.message}`);
|
|
79
|
+
}
|
|
68
80
|
}
|
|
69
81
|
}
|
|
70
82
|
|
|
@@ -91,7 +103,7 @@ if (process.argv[2] === "install-skill") {
|
|
|
91
103
|
const result = spawnSync("npx", args, { stdio: "inherit", env: process.env, shell: true });
|
|
92
104
|
if (result.error) throw result.error;
|
|
93
105
|
const status = result.status || 0;
|
|
94
|
-
if (status === 0)
|
|
106
|
+
if (status === 0) installBuddySkills(pkgRoot, "guancli");
|
|
95
107
|
process.exit(status);
|
|
96
108
|
}
|
|
97
109
|
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@guandata/guancli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.37",
|
|
4
4
|
"description": "观远 BI 命令行工具 - 通过 API 操作 ETL、数据集、页面、表单等资源,并提供 ChatBI 问数/洞察能力",
|
|
5
5
|
"bin": {
|
|
6
6
|
"guancli": "bin/run.js"
|
|
@@ -16,6 +16,8 @@
|
|
|
16
16
|
"binaries/",
|
|
17
17
|
"skills/",
|
|
18
18
|
"CHANGELOG.md",
|
|
19
|
+
"LICENSE",
|
|
20
|
+
"LICENSE.zh-CN",
|
|
19
21
|
"README.md"
|
|
20
22
|
],
|
|
21
23
|
"keywords": [
|
|
@@ -25,7 +27,7 @@
|
|
|
25
27
|
"etl",
|
|
26
28
|
"agent-skill"
|
|
27
29
|
],
|
|
28
|
-
"license": "
|
|
30
|
+
"license": "SEE LICENSE IN LICENSE",
|
|
29
31
|
"os": [
|
|
30
32
|
"darwin",
|
|
31
33
|
"linux",
|
package/skills/guancli/SKILL.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: guancli
|
|
3
|
-
description: 当用户要分析观远 BI / Guandata 的 ETL、数据集、页面/仪表板、卡片、血缘、节点 SQL、资源树、目录、表单填报数据、指标 metric、公共维度 public dimension、指标树归因 metric_attribution、指标泛化查询参数,或给出 ETL ID、dsId、page ID、card ID、metric ID、metric tree ID、公共维度 ID 想看现有内容/查询数据时,主动使用这个 skill
|
|
3
|
+
description: 当用户要分析观远 BI / Guandata 的 ETL、数据集、页面/仪表板、卡片、血缘、节点 SQL、资源树、目录、表单填报数据、指标 metric、公共维度 public dimension、指标树归因 metric_attribution、指标泛化查询参数,或给出 ETL ID、dsId、page ID、card ID、metric ID、metric tree ID、公共维度 ID 想看现有内容/查询数据时,主动使用这个 skill。用户要创建、新建、编辑、删除指标或公共维度,或创建指标主题/指标目录,尤其是“创建原子指标”“创建复合指标”“创建衍生指标”“新增 metric”“基于数据集建指标”“用两个指标算一个指标”“做同比/环比/最近N天/累计/期末值指标”“新建指标主题”“新建指标目录”“新建公共维度”“把几个数据集字段关联成公共维度”时,也要使用这个 skill 并读取对应写操作指引。用户提到“创建超级应用”“创建 SuperApp”“新建 SuperApp 项目”“SuperApp 模板项目”时,也要使用这个 skill,并引导使用 `guancli app create`。即使用户只说"看一下这个 page""贴一下这个 ETL 的 SQL""搜个叫 X 的数据集""这个数据集长啥样""页面卡片用了哪些 ds""帮我查这个指标""生成指标泛化查询命令""帮我创建一个原子指标""帮我创建一个复合指标""帮我创建一个同比指标""帮我创建一个指标主题""帮我创建一个指标目录""帮我创建一个公共维度""帮我创建一个超级应用",也要触发。它直接调用 BI HTTP API 拉数据并整理成 AI 友好的中文结论,定位是 BI 查询分析 + 表单填报 CRUD + 指标/公共维度写操作引导 + SuperApp 模板项目创建。修改 ETL 走 guanetl;新建/改 Card/Page 走 guanvis;数据源/数据集 CRUD/增量/调度走 guands;页面 PNG 视觉验证走 guanvis screenshot;管理员级 SVC SQL / 动态码走 guanadmin。若用户希望直接分析 BI 项目而不是手工点页面,或希望直接通过 ChatBI 进行主题问数/洞察分析,也应优先使用这个 skill。
|
|
4
4
|
compatibility: Requires Node.js 14+. Install via npm install -g @guandata/guancli.
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -17,9 +17,11 @@ compatibility: Requires Node.js 14+. Install via npm install -g @guandata/guancl
|
|
|
17
17
|
- 用户要搜索指标、获取指标详情、查询指标数据、查看指标目录、执行指标树归因,或让你生成/解释指标泛化查询命令。
|
|
18
18
|
- 用户给出数据集 ID,想查看该数据集创建或影响到的所有指标,包括直接原子指标以及下游复合指标、衍生指标。
|
|
19
19
|
- 用户要创建、新建、编辑或删除指标;当前指标写操作指引先覆盖原子指标、复合指标、衍生指标的创建和编辑前校验。
|
|
20
|
+
- 用户要创建指标主题或指标目录。
|
|
20
21
|
- 用户要查询、新建、编辑、转移责任人或删除指标公共维度。
|
|
22
|
+
- 用户要创建超级应用 / SuperApp / SuperApp 模板项目。
|
|
21
23
|
|
|
22
|
-
如果用户只想生成页面 PNG 截图成品,不要用本 skill,改用 `guanvis screenshot
|
|
24
|
+
如果用户只想生成页面 PNG 截图成品,不要用本 skill,改用 `guanvis screenshot`。
|
|
23
25
|
|
|
24
26
|
## 数据获取方式
|
|
25
27
|
|
|
@@ -45,13 +47,23 @@ guancli auth login
|
|
|
45
47
|
|
|
46
48
|
登录成功后 Token 自动保存在系统标准配置目录下的 `guancli/config.json`。密码方式支持 Token 过期后自动刷新。
|
|
47
49
|
|
|
48
|
-
### 方式二:直接输入
|
|
50
|
+
### 方式二:直接输入 uIdToken
|
|
49
51
|
|
|
50
52
|
```bash
|
|
51
53
|
guancli auth login
|
|
52
54
|
```
|
|
53
55
|
|
|
54
|
-
选择登录方式 `2`,直接粘贴已有的
|
|
56
|
+
选择登录方式 `2`,直接粘贴已有的 uIdToken。适用于已从 Web 界面或其他途径获取 uIdToken 的场景。
|
|
57
|
+
|
|
58
|
+
### 方式三:Personal Access Token
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
guancli auth login --url https://bi.example.com --pat <pat>
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
交互式登录时选择登录方式 `3`,直接粘贴 Personal Access Token。`--personal-token` 仍可作为长参数使用。PAT 请求会自动携带 `X-Personal-Token` 和 `X-Guandata-Client: cli`,`auth status` 会通过 `/pat/introspect` 做自检。
|
|
65
|
+
|
|
66
|
+
`chatbi` 子命令仍要求 uIdToken 登录;管理员动态码、管理员登录、SVC 查询等管理员能力由 `guanadmin` 提供,不使用 PAT。
|
|
55
67
|
|
|
56
68
|
### 多环境管理
|
|
57
69
|
|
|
@@ -81,7 +93,7 @@ ChatBI 统一复用当前 profile 的 `base_url` 和 `uIdToken`。
|
|
|
81
93
|
|
|
82
94
|
## 能力边界
|
|
83
95
|
|
|
84
|
-
guancli 是 BI 资源的**查询分析入口**,并支持少量明确边界的写操作(Form 表单填报 CRUD
|
|
96
|
+
guancli 是 BI 资源的**查询分析入口**,并支持少量明确边界的写操作(Form 表单填报 CRUD、指标写操作引导)和 SuperApp 模板项目创建。其他写入类任务由专用 skill 负责:
|
|
85
97
|
|
|
86
98
|
| 任务 | 应使用的工具 |
|
|
87
99
|
|------|-------------|
|
|
@@ -91,6 +103,20 @@ guancli 是 BI 资源的**查询分析入口**,并支持少量明确边界的
|
|
|
91
103
|
|
|
92
104
|
> guancli 能显示 ETL 的节点定义和 SQL,但 ETL 的新建、修改、保存、执行闭环应通过 `guanetl` 完成。
|
|
93
105
|
|
|
106
|
+
## SuperApp 项目创建
|
|
107
|
+
|
|
108
|
+
当用户提到创建超级应用、创建 SuperApp、新建 SuperApp 项目或基于 SuperApp 模板初始化项目时,使用 `guancli app create`。
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
guancli app create --name <project_name> --path <parent_dir>
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
关键规则:
|
|
115
|
+
|
|
116
|
+
- `--name` 是项目名称,`--path` 是项目所在的父目录;信息不全时先确认项目名称和目标目录。
|
|
117
|
+
- 该命令会下载 SuperApp 模板并创建项目目录,随后尝试复制 `.env.template`、更新 `package.json` 名称、初始化 git,并根据模板情况执行 `setup.sh` 或 `npm install` + 启动本地 dev server。
|
|
118
|
+
- 如果用户只是要创建本地 SuperApp 模板项目,不需要先做 BI 资源查询;直接给出或执行 `guancli app create`。
|
|
119
|
+
|
|
94
120
|
## 先做判断
|
|
95
121
|
|
|
96
122
|
1. 先用 `auth status` 确认认证是否有效。
|
|
@@ -117,6 +143,8 @@ guancli 是 BI 资源的**查询分析入口**,并支持少量明确边界的
|
|
|
117
143
|
关键规则:
|
|
118
144
|
|
|
119
145
|
- 普通指标数据查询用 `guancli metric query <metric_id>`,可加 `--dim`、`--filter`、排序、列筛选、输出格式等。
|
|
146
|
+
- 创建指标主题用 `guancli metric project-create <name>`;创建后后端会同步创建主题根目录。默认图标与 Web 新建主题一致,可用 `--icon`、`--icon-color` 覆盖;真实提交前可加 `--dry-run` 查看请求体。
|
|
147
|
+
- 创建指标目录用 `guancli metric dir-create <name> --project-id <metric_topic_id>`,也可用 `--project-name <name>` 按主题名称解析;默认创建在该主题根目录下。创建子目录优先传 `--parent-dir-id <dir_id>`,也可用 `--parent-dir-name <name>` 按父目录名称解析;真实提交前可加 `--dry-run` 查看请求体。信息不全时先用 `guancli metric project` 和 `guancli metric tree` 定位主题 ID、目录 ID。若用户只给主题名称且当前环境下有重复主题名,必须让用户从候选主题 ID 中指定一个;若用户只给父目录名称且同一主题下有重复目录名,必须让用户从候选目录 ID 中指定一个,不要自行猜测。
|
|
120
148
|
- 按数据集反查指标用 `guancli metric by-dataset <ds_id>`;新版 BI 会走后端批量接口直接返回直接指标和下游指标,旧版 BI 会兼容回退为先定位使用该数据集的原子指标、再沿指标下游血缘展开复合指标和衍生指标。适合回答“这个数据集关联了哪些指标 / 改这个数据集会影响哪些指标”。如果已知指标主题,可加 `-d <metric_topic_id>` 缩小范围;需要结构化结果时用 `-f json`。
|
|
121
149
|
- 只要传入 `--compare`、`--compare-value`、`--xtd`、`--last`、`--recent`、`--recent-base`、`--percentage`、`--percentage-dim`、`--rank-top`、`--rank-order`、`--rank-dim`、`--adv-calc-json` 任一参数,就进入指标泛化查询模式。
|
|
122
150
|
- 泛化查询要求 BI 版本 `>= 8.2.1`;如需确认环境版本,先执行 `guancli server-version --profile <profile>`。
|
|
@@ -35,6 +35,8 @@ guancli metric [command]
|
|
|
35
35
|
| `by-dataset` | 按数据集 ID 获取直接和下游关联指标 |
|
|
36
36
|
| `query` | 查询指标数据 |
|
|
37
37
|
| `tree` | 获取指标目录树 |
|
|
38
|
+
| `project-create` | 创建指标主题 |
|
|
39
|
+
| `dir-create` | 创建指标目录 |
|
|
38
40
|
| `create` | 新建原子指标(JSON 文件驱动) |
|
|
39
41
|
| `edit` | 编辑原子指标(JSON patch / replace) |
|
|
40
42
|
| `delete` | 删除指标(先执行删除影响校验) |
|
|
@@ -59,6 +61,30 @@ guancli metric project 经营 --profile default -f json
|
|
|
59
61
|
guancli metric project 经营 --profile default --raw
|
|
60
62
|
```
|
|
61
63
|
|
|
64
|
+
### metric project-create
|
|
65
|
+
|
|
66
|
+
创建指标主题。主题创建成功后,后端会同步创建该主题根目录。默认图标和颜色与 Web 新建主题一致,可按需覆盖。
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
guancli metric project-create <name> [flags]
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
专属参数:
|
|
73
|
+
|
|
74
|
+
| 参数 | 默认值 | 说明 |
|
|
75
|
+
| --- | --- | --- |
|
|
76
|
+
| `--icon string` | `finance_subject` | 主题图标 |
|
|
77
|
+
| `--icon-color string` | `#1A827F` | 主题图标颜色 |
|
|
78
|
+
| `--dry-run` | `false` | 只输出请求方法和请求体,不提交 |
|
|
79
|
+
|
|
80
|
+
示例:
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
guancli metric project-create 经营指标 --profile default --dry-run
|
|
84
|
+
guancli metric project-create 经营指标 --profile default
|
|
85
|
+
guancli metric project-create 经营指标 --profile default --icon finance_subject --icon-color '#1A827F'
|
|
86
|
+
```
|
|
87
|
+
|
|
62
88
|
### metric search
|
|
63
89
|
|
|
64
90
|
搜索指标;传关键词时后台用 `%keyword%` 模糊匹配,不传关键词返回所有指标。
|
|
@@ -183,6 +209,36 @@ guancli metric tree --profile default -f json
|
|
|
183
209
|
guancli metric tree --profile default --raw
|
|
184
210
|
```
|
|
185
211
|
|
|
212
|
+
### metric dir-create
|
|
213
|
+
|
|
214
|
+
创建指标目录。默认在指定主题根目录下创建;可用 `--project-id` 指定主题 ID,也可用 `--project-name` 按主题名称解析。创建子目录时可用 `--parent-dir-id` 指定父目录 ID,也可用 `--parent-dir-name` 按父目录名称解析。
|
|
215
|
+
如果当前环境下存在多个同名主题,CLI 会阻断创建并列出候选 ID,此时应让用户指定 `--project-id`。
|
|
216
|
+
如果同一主题下存在多个同名父目录,CLI 会阻断创建并列出候选路径和 ID,此时应让用户指定 `--parent-dir-id`。
|
|
217
|
+
|
|
218
|
+
```bash
|
|
219
|
+
guancli metric dir-create <name> (--project-id <metric_topic_id> | --project-name <metric_topic_name>) [flags]
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
专属参数:
|
|
223
|
+
|
|
224
|
+
| 参数 | 默认值 | 说明 |
|
|
225
|
+
| --- | --- | --- |
|
|
226
|
+
| `--project-id string` | 无 | 指标主题 ID;与 `--project-name` 二选一 |
|
|
227
|
+
| `--project-name string` | 无 | 指标主题名称;同名主题重复时改用 `--project-id` |
|
|
228
|
+
| `--parent-dir-id string` | 无 | 父目录 ID;为空时 CLI 自动使用主题根目录 |
|
|
229
|
+
| `--parent-dir-name string` | 无 | 父目录名称;同名目录重复时改用 `--parent-dir-id` |
|
|
230
|
+
| `--dry-run` | `false` | 只输出请求方法和请求体,不提交 |
|
|
231
|
+
|
|
232
|
+
示例:
|
|
233
|
+
|
|
234
|
+
```bash
|
|
235
|
+
guancli metric dir-create 广告分析 --profile default --project-id <metric_topic_id> --dry-run
|
|
236
|
+
guancli metric dir-create 广告分析 --profile default --project-id <metric_topic_id>
|
|
237
|
+
guancli metric dir-create 广告分析 --profile default --project-name 经营指标
|
|
238
|
+
guancli metric dir-create 投放效果 --profile default --project-id <metric_topic_id> --parent-dir-id <dir_id>
|
|
239
|
+
guancli metric dir-create 投放效果 --profile default --project-name 经营指标 --parent-dir-name 广告分析
|
|
240
|
+
```
|
|
241
|
+
|
|
186
242
|
### metric create
|
|
187
243
|
|
|
188
244
|
新建原子指标。写入流程先读 `metric-mutation.md` 和 `metric-common-fields.md`,原子字段、问询流程和 JSON 模板见 `metric-atomic-mutation.md`。复合指标和衍生指标创建当前使用 `guancli fetch POST /api/metric-platform/metrics/<type>-metrics --stdin`,分别见 `metric-composite-mutation.md` 和 `metric-derived-mutation.md`。
|
|
@@ -55,6 +55,8 @@
|
|
|
55
55
|
2. 信息不全时先查 ID,不凭空猜:
|
|
56
56
|
- 指标主题:`guancli metric project [keyword] -f json`
|
|
57
57
|
- 指标目录:`guancli metric tree -f json`
|
|
58
|
+
- 新建指标主题:`guancli metric project-create <name> --dry-run`,确认后去掉 `--dry-run`
|
|
59
|
+
- 新建指标目录:`guancli metric dir-create <name> --project-id <metric_topic_id> --dry-run`,也可用 `--project-name <metric_topic_name>`;确认后去掉 `--dry-run`。创建子目录可传 `--parent-dir-id`,也可传 `--parent-dir-name`。若主题名称重复必须让用户指定主题 ID;若父目录名称重复必须让用户指定目录 ID
|
|
58
60
|
- 指标详情:`guancli metric search <keyword> -f json`、`guancli metric get <metric_id> --brief`
|
|
59
61
|
- 数据集字段:`guancli ds search <keyword>`、`guancli ds get <dsId> --brief`
|
|
60
62
|
3. 读取启用的指标业务属性配置,补齐必填 `bizAttrs`。
|