huaweicloud-devkit 0.1.20 → 0.1.21

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.
Files changed (67) hide show
  1. package/.agents/plugins/marketplace.json +20 -20
  2. package/LICENSE +201 -201
  3. package/README.md +169 -155
  4. package/bin/setup.cjs +7 -7
  5. package/integrations/opencode/commands/huaweicloud-doctor.md +14 -14
  6. package/integrations/opencode/opencode.json +14 -14
  7. package/integrations/opencode/skills/huaweicloud-core/SKILL.md +30 -30
  8. package/package.json +43 -43
  9. package/plugins/huaweicloud-core/.claude-plugin/plugin.json +1 -1
  10. package/plugins/huaweicloud-core/.codex-plugin/plugin.json +1 -1
  11. package/plugins/huaweicloud-core/.cursor-plugin/plugin.json +1 -1
  12. package/plugins/huaweicloud-core/.mcp.json +13 -13
  13. package/plugins/huaweicloud-core/hooks/hooks.json +26 -26
  14. package/plugins/huaweicloud-core/hooks/huaweicloud-safety.py +88 -88
  15. package/plugins/huaweicloud-core/safety/policy.json +85 -85
  16. package/plugins/huaweicloud-core/skills/huawei-apig/SKILL.md +144 -144
  17. package/plugins/huaweicloud-core/skills/huawei-billing/SKILL.md +48 -48
  18. package/plugins/huaweicloud-core/skills/huawei-cbr/SKILL.md +50 -50
  19. package/plugins/huaweicloud-core/skills/huawei-cce/SKILL.md +101 -101
  20. package/plugins/huaweicloud-core/skills/huawei-cloud-eye/SKILL.md +73 -73
  21. package/plugins/huaweicloud-core/skills/huawei-cloud-find-skills/SKILL.md +1 -1
  22. package/plugins/huaweicloud-core/skills/huawei-cts/SKILL.md +55 -55
  23. package/plugins/huaweicloud-core/skills/huawei-dds-dcs/SKILL.md +70 -70
  24. package/plugins/huaweicloud-core/skills/huawei-dew/SKILL.md +97 -97
  25. package/plugins/huaweicloud-core/skills/huawei-dew/references/csms-usage.md +29 -29
  26. package/plugins/huaweicloud-core/skills/huawei-dew/references/kms-usage.md +23 -23
  27. package/plugins/huaweicloud-core/skills/huawei-ecs/SKILL.md +131 -131
  28. package/plugins/huaweicloud-core/skills/huawei-ecs/references/create-instance.md +96 -98
  29. package/plugins/huaweicloud-core/skills/huawei-ecs/references/evs.md +31 -31
  30. package/plugins/huaweicloud-core/skills/huawei-ecs/references/flavors.md +28 -28
  31. package/plugins/huaweicloud-core/skills/huawei-ecs/references/troubleshooting.md +52 -52
  32. package/plugins/huaweicloud-core/skills/huawei-functiongraph/SKILL.md +132 -132
  33. package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/apig-event-format.md +58 -58
  34. package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/create-function.md +71 -71
  35. package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/deploy-workflow.md +119 -119
  36. package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/triggers.md +142 -142
  37. package/plugins/huaweicloud-core/skills/huawei-gaussdb/SKILL.md +56 -56
  38. package/plugins/huaweicloud-core/skills/huawei-getting-started/SKILL.md +65 -65
  39. package/plugins/huaweicloud-core/skills/huawei-iam/SKILL.md +111 -111
  40. package/plugins/huaweicloud-core/skills/huawei-modelarts/SKILL.md +65 -65
  41. package/plugins/huaweicloud-core/skills/huawei-obs/SKILL.md +118 -118
  42. package/plugins/huaweicloud-core/skills/huawei-obs/references/bucket-lifecycle.md +26 -26
  43. package/plugins/huaweicloud-core/skills/huawei-obs/references/static-website.md +56 -56
  44. package/plugins/huaweicloud-core/skills/huawei-rds/SKILL.md +181 -181
  45. package/plugins/huaweicloud-core/skills/huawei-smn-dms/SKILL.md +69 -69
  46. package/plugins/huaweicloud-core/skills/huawei-vpc/SKILL.md +78 -78
  47. package/plugins/huaweicloud-core/skills/huawei-vpc/references/network.md +76 -76
  48. package/plugins/huaweicloud-core/skills/huawei-vpc/references/security-group.md +59 -59
  49. package/plugins/huaweicloud-core/skills/huawei-waf-aad/SKILL.md +63 -63
  50. package/plugins/huaweicloud-core/skills/huaweicloud-api-and-sdk/agents/openai.yaml +4 -4
  51. package/plugins/huaweicloud-core/skills/huaweicloud-capability-discovery/SKILL.md +47 -47
  52. package/plugins/huaweicloud-core/skills/huaweicloud-capability-discovery/agents/openai.yaml +4 -4
  53. package/plugins/huaweicloud-core/skills/huaweicloud-cli-and-auth/SKILL.md +127 -125
  54. package/plugins/huaweicloud-core/skills/huaweicloud-cli-and-auth/agents/openai.yaml +4 -4
  55. package/plugins/huaweicloud-core/skills/huaweicloud-core/SKILL.md +93 -93
  56. package/plugins/huaweicloud-core/skills/huaweicloud-core/agents/openai.yaml +4 -4
  57. package/plugins/huaweicloud-core/skills/huaweicloud-core/references/report-issue.md +19 -19
  58. package/plugins/huaweicloud-core/skills/huaweicloud-core/references/select.md +27 -27
  59. package/plugins/huaweicloud-core/skills/huaweicloud-safety/SKILL.md +46 -46
  60. package/plugins/huaweicloud-core/skills/huaweicloud-safety/agents/openai.yaml +4 -4
  61. package/plugins/huaweicloud-core/skills/huaweicloud-troubleshooting/SKILL.md +83 -83
  62. package/plugins/huaweicloud-core/skills/huaweicloud-troubleshooting/agents/openai.yaml +4 -4
  63. package/plugins/huaweicloud-core/src/hcloud-cli.mjs +265 -265
  64. package/plugins/huaweicloud-core/src/mcp-server.mjs +93 -93
  65. package/plugins/huaweicloud-core/src/safety-policy.mjs +289 -289
  66. package/plugins/huaweicloud-core/src/setup-cli.mjs +869 -656
  67. package/plugins/huaweicloud-core/src/tools.mjs +677 -672
package/README.md CHANGED
@@ -1,155 +1,169 @@
1
- # HuaweiCloud DevKit
2
-
3
- [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)
4
- [![CI](https://github.com/huaweicloud-mate/huaweicloud-devkit/actions/workflows/ci.yml/badge.svg)](https://github.com/huaweicloud-mate/huaweicloud-devkit/actions/workflows/ci.yml)
5
-
6
- 帮助 AI 编码助手安全、准确地使用华为云——技能引导、KooCLI 工具、安全策略一站式集成。
7
-
8
- HuaweiCloud DevKit 为 AI 编码助手提供操作华为云所需的知识、工具和安全护栏,支持 OpenCode、Codex、Claude Code、Cursor 等主流 Agent。
9
-
10
- ## 快速开始
11
-
12
- ### OpenCode
13
-
14
- ```bash
15
- npx --yes huaweicloud-devkit install
16
- ```
17
-
18
- 自动安装 27 个技能、MCP 服务器和安全策略,并更新 OpenCode 配置。安装后**重启会话**使 MCP 工具生效。
19
-
20
- ```bash
21
- npx --yes huaweicloud-devkit doctor # 自检:hcloud、MCP、技能、认证
22
- npx --yes huaweicloud-devkit status # 查看安装状态
23
- npx --yes huaweicloud-devkit update # 更新到最新版
24
- npx --yes huaweicloud-devkit uninstall # 卸载
25
- ```
26
-
27
- ### Codex
28
-
29
- ```bash
30
- npx --yes huaweicloud-devkit install --target codex
31
- ```
32
-
33
- > 需要先安装 Codex CLI。`--target all` 会在 Codex CLI 缺失时跳过 Codex。
34
-
35
- ### Claude Code
36
-
37
- 通过 **设置 → 插件 → 团队市场 → 添加市场 → 从仓库导入**,指向 `huaweicloud-mate/huaweicloud-devkit`。Claude Code 会自动索引插件。
38
-
39
- 安装插件:
40
-
41
- ```
42
- /plugin install huaweicloud-core@huaweicloud-devkit
43
- ```
44
-
45
- ### Cursor
46
-
47
- 通过 **设置 插件 → 团队市场 → 添加市场 → 从仓库导入**,指向 `huaweicloud-mate/huaweicloud-devkit`。
48
-
49
- 然后在**插件**面板中安装 **huaweicloud-core** 插件。
50
-
51
- ### 其他 Agent
52
-
53
- 对于支持 Model Context Protocol (MCP) Agent,手动配置 MCP 服务器:
54
-
55
- ```json
56
- {
57
- "mcp": {
58
- "huaweicloud": {
59
- "type": "local",
60
- "command": ["node", "<路径>/plugins/huaweicloud-core/src/mcp-server.mjs"],
61
- "enabled": true
62
- }
63
- }
64
- }
65
- ```
66
-
67
- 然后安装技能:
68
-
69
- ```bash
70
- npx --yes huaweicloud-devkit install
71
- ```
72
-
73
- > **前置条件:** 需要安装 [KooCLI](https://support.huaweicloud.com/qs-hcli/hcli_02_003.html)(`hcloud`)并完成认证。MCP 服务器需要 Node.js >= 20。如果 `hcloud` 不在 `PATH` 中,请设置 `HCLOUD_BIN` 环境变量指向完整路径。
74
-
75
- ## 包含内容
76
-
77
- ### 插件
78
-
79
- `huaweicloud-core` 插件将 MCP 服务器配置、27 个 Agent 技能和安全策略打包为一次性安装。
80
-
81
- | 插件 | 说明 |
82
- |------|------|
83
- | [huaweicloud-core](plugins/huaweicloud-core/) | 核心插件,含技能、MCP 服务器、安全策略。**从这里开始。** |
84
-
85
- ### 技能
86
-
87
- Agent 技能是经过整理的指令和参考材料包,帮助 Agent 完成特定的华为云任务。技能按需加载——Agent 只发现和检索与当前任务相关的内容。
88
-
89
- 包含 6 个元技能(路由、发现、CLI/认证、API/SDK、安全、排错)和 20 个服务技能(覆盖 ECS、OBS、VPC、IAM、RDS、GaussDB、FunctionGraph、APIG、CCE、SMN/DMS、ModelArts、Cloud Eye、CTS、DEW、Billing、CBR、WAF/AAD、DDS/DCS、Deployment、Getting Started)。
90
-
91
- 浏览 [`skills/`](plugins/huaweicloud-core/skills/) 目录查看所有可用技能。
92
-
93
- ### Rules 文件
94
-
95
- 推荐的项目级配置文件,告诉 Agent 如何高效使用华为云——例如优先使用 MCP 服务器、发现可用技能、遵循最小权限 IAM 原则。
96
-
97
- 详见 [`rules/huawei-agent-rules.md`](rules/huawei-agent-rules.md)。
98
-
99
- ### MCP 服务器
100
-
101
- 本地 MCP 服务器(`plugins/huaweicloud-core/src/mcp-server.mjs`)通过 Model Context Protocol 为 Agent 提供安全的 KooCLI 访问。
102
-
103
- - **安全优先执行** — 所有 `hcloud` 命令执行前自动分类(读/写/密钥),写操作需用户明确批准。
104
- - **输出脱敏** 凭证形态的值(AK/SK、Token、密码)自动替换为 `***REDACTED***`。
105
- - **12 个结构化工具** — 技能搜索、CLI 检查、只读命令、区域发现、错误解释等。
106
- - **零运行时依赖** — 纯 Node.js(>= 20),无需 npm install。
107
-
108
- 详见 [MCP 工具表](#mcp-工具)。
109
-
110
- ## 安全模型
111
-
112
- 三层防御体系:
113
-
114
- | 层级 | 机制 | 说明 |
115
- |------|------|------|
116
- | 技能层 | `SKILL.md` 流程文档 | 教会 Agent 正确的行为规则和安全用法 |
117
- | 钩子层 | `huaweicloud-safety.py` | PreToolUse Hook 阻断高风险工具调用(Claude Code、Cursor 可用) |
118
- | MCP 层 | `safety-policy.mjs` | Node.js 安全策略包装器,在所有 Agent 环境中强制执行 |
119
-
120
- 详见 [`docs/safety-model.md`](docs/safety-model.md)。
121
-
122
- ## MCP 工具
123
-
124
- | 类别 | 工具 | 说明 |
125
- |------|------|------|
126
- | 知识发现 | `huaweicloud_search_docs` | 跨技能文件及文档全文搜索 |
127
- | 知识发现 | `huaweicloud_retrieve_skill` | 按名称加载完整技能内容及参考文件 |
128
- | 知识发现 | `huaweicloud_list_regions` | 列出可用华为云区域 |
129
- | 知识发现 | `huaweicloud_get_regional_availability` | 检查目标区域的服务可用性 |
130
- | CLI | `huaweicloud_check_cli` | 检查 KooCLI `hcloud` 是否已安装 |
131
- | CLI | `huaweicloud_plan_cli_command` | 分类计划命令(读/写/密钥)但不执行 |
132
- | CLI | `huaweicloud_list_operations` | 列出服务的可用 KooCLI 操作 |
133
- | CLI | `huaweicloud_run_readonly_command` | 执行只读命令并脱敏输出 |
134
- | CLI | `huaweicloud_run_approved_command` | 经用户明确批准后执行写命令 |
135
- | 安全 | `huaweicloud_show_profile_redacted` | 安全查看 KooCLI 配置(凭证脱敏) |
136
- | 路由 | `huaweicloud_service_catalog` | 返回推荐的能力来源排序 |
137
- | 排错 | `huaweicloud_explain_error` | 解释错误码并建议诊断步骤 |
138
-
139
- ## 文档
140
-
141
- - [系统架构设计](docs/01-系统架构设计.md)
142
- - [核心技能设计](docs/02-核心技能设计.md)
143
- - [安全模型](docs/safety-model.md)
144
- - [KooCLI 官方文档](https://support.huaweicloud.com/qs-hcli/hcli_02_003.html)
145
-
146
- ## 发布流程
147
-
148
- 发布采用两步 workflow,全部在 GitHub Actions 中完成:
149
-
150
- 1. **Prepare Release**(手动触发,选 `patch` / `minor` / `major`):自动 bump 版本、跑质量门、推 `release/vX.Y.Z` 分支并创建 PR,CI 全绿后自动合并进 `main`。
151
- 2. **Publish Release**(PR 合并后手动触发):读取 `main` 版本,创建并推送 `vX.Y.Z` tag,生成 GitHub Release;tag 触发 `CD Production`,经 `production` 环境人工审批后发布到 npm(包名 `huaweicloud-devkit`)。
152
-
153
- ## 许可证
154
-
155
- 本项目基于 Apache-2.0 许可证发布。详见 [LICENSE](LICENSE)。
1
+ # HuaweiCloud DevKit
2
+
3
+ [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)
4
+ [![CI](https://github.com/huaweicloud-mate/huaweicloud-devkit/actions/workflows/ci.yml/badge.svg)](https://github.com/huaweicloud-mate/huaweicloud-devkit/actions/workflows/ci.yml)
5
+
6
+ 帮助 AI 编码助手安全、准确地使用华为云——技能引导、KooCLI 工具、安全策略一站式集成。
7
+
8
+ HuaweiCloud DevKit 为 AI 编码助手提供操作华为云所需的知识、工具和安全护栏,支持 OpenCode、Codex、Claude Code、Cursor、码道(CodeArts Agent)等主流 Agent。
9
+
10
+ ## 快速开始
11
+
12
+ ### OpenCode
13
+
14
+ ```bash
15
+ npx --yes huaweicloud-devkit install
16
+ ```
17
+
18
+ 自动安装 27 个技能、MCP 服务器和安全策略,并更新 OpenCode 配置。安装后**重启会话**使 MCP 工具生效。
19
+
20
+ ```bash
21
+ npx --yes huaweicloud-devkit doctor # 自检:hcloud、MCP、技能、认证
22
+ npx --yes huaweicloud-devkit status # 查看安装状态
23
+ npx --yes huaweicloud-devkit update # 更新到最新版
24
+ npx --yes huaweicloud-devkit uninstall # 卸载
25
+ ```
26
+
27
+ ### Codex
28
+
29
+ ```bash
30
+ npx --yes huaweicloud-devkit install --target codex
31
+ ```
32
+
33
+ > 需要先安装 Codex CLI。`--target all` 会在 Codex CLI 缺失时跳过 Codex。
34
+
35
+ ### Claude Code
36
+
37
+ 通过 **设置 → 插件 → 团队市场 → 添加市场 → 从仓库导入**,指向 `huaweicloud-mate/huaweicloud-devkit`。Claude Code 会自动索引插件。
38
+
39
+ 安装插件:
40
+
41
+ ```
42
+ /plugin install huaweicloud-core@huaweicloud-devkit
43
+ ```
44
+
45
+ ### CodeArts Agent(码道)
46
+
47
+ 码道没有插件市场,通过技能 + MCP 机制适配:
48
+
49
+ ```bash
50
+ npx --yes huaweicloud-devkit install --target codearts
51
+ ```
52
+
53
+ 自动安装 27 个技能到 `~/.codeartsdoer/skills/` 与项目级 `.codeartsdoer/skills/`,MCP 服务器注册到用户级与项目级 `.codeartsdoer/mcp/mcp_settings.json`。若本机已存在 KooCLI(`~/hcloud/hcloud.exe`),会自动将 `HCLOUD_BIN` 注入 MCP 配置。安装后**重启会话**使 MCP 工具生效。
54
+
55
+ ```bash
56
+ npx --yes huaweicloud-devkit install-hcloud # 安装 KooCLI(自动接受隐私协议)
57
+ npx --yes huaweicloud-devkit doctor # 自检:hcloud、MCP、技能、沙箱模式
58
+ npx --yes huaweicloud-devkit status --target codearts # 查看码道安装状态
59
+ npx --yes huaweicloud-devkit uninstall --target codearts # 卸载
60
+ ```
61
+
62
+ > **沙箱模式**:码道默认 `bash_mode: sandbox` 会阻止 KooCLI 写入配置目录(如 `~/.hcloud/root`),导致隐私协议无法持久化、KooCLI 无法运行。`install-hcloud` 会自动检测沙箱模式并给出明确指引——请在**码道外终端**安装使用 KooCLI,或在码道设置中关闭沙箱模式(设置 → 权限 → Bash 模式)后重试。
63
+ >
64
+ > **认证**:KooCLI 就绪后,还需在码道外终端执行 `hcloud configure init` 配置 AK/SK 与区域,然后即可在码道中描述你的华为云任务。
65
+
66
+ ### Cursor
67
+
68
+ 通过 **设置 → 插件 → 团队市场 → 添加市场 → 从仓库导入**,指向 `huaweicloud-mate/huaweicloud-devkit`。
69
+
70
+ 然后在**插件**面板中安装 **huaweicloud-core** 插件。
71
+
72
+ ### 其他 Agent
73
+
74
+ 对于支持 Model Context Protocol (MCP) 的 Agent,手动配置 MCP 服务器:
75
+
76
+ ```json
77
+ {
78
+ "mcp": {
79
+ "huaweicloud": {
80
+ "type": "local",
81
+ "command": ["node", "<路径>/plugins/huaweicloud-core/src/mcp-server.mjs"],
82
+ "enabled": true
83
+ }
84
+ }
85
+ }
86
+ ```
87
+
88
+ 然后安装技能:
89
+
90
+ ```bash
91
+ npx --yes huaweicloud-devkit install
92
+ ```
93
+
94
+ > **前置条件:** 需要安装 [KooCLI](https://support.huaweicloud.com/qs-hcli/hcli_02_003.html)(`hcloud`)并完成认证。MCP 服务器需要 Node.js >= 20。如果 `hcloud` 不在 `PATH` 中,请设置 `HCLOUD_BIN` 环境变量指向完整路径。
95
+
96
+ ## 包含内容
97
+
98
+ ### 插件
99
+
100
+ `huaweicloud-core` 插件将 MCP 服务器配置、27 个 Agent 技能和安全策略打包为一次性安装。
101
+
102
+ | 插件 | 说明 |
103
+ |------|------|
104
+ | [huaweicloud-core](plugins/huaweicloud-core/) | 核心插件,含技能、MCP 服务器、安全策略。**从这里开始。** |
105
+
106
+ ### 技能
107
+
108
+ Agent 技能是经过整理的指令和参考材料包,帮助 Agent 完成特定的华为云任务。技能按需加载——Agent 只发现和检索与当前任务相关的内容。
109
+
110
+ 包含 6 个元技能(路由、发现、CLI/认证、API/SDK、安全、排错)和 20 个服务技能(覆盖 ECS、OBS、VPC、IAM、RDS、GaussDB、FunctionGraph、APIG、CCE、SMN/DMS、ModelArts、Cloud Eye、CTS、DEW、Billing、CBR、WAF/AAD、DDS/DCS、Deployment、Getting Started)。
111
+
112
+ 浏览 [`skills/`](plugins/huaweicloud-core/skills/) 目录查看所有可用技能。
113
+
114
+ ### Rules 文件
115
+
116
+ 推荐的项目级配置文件,告诉 Agent 如何高效使用华为云——例如优先使用 MCP 服务器、发现可用技能、遵循最小权限 IAM 原则。
117
+
118
+ 详见 [`rules/huawei-agent-rules.md`](rules/huawei-agent-rules.md)。
119
+
120
+ ### MCP 服务器
121
+
122
+ 本地 MCP 服务器(`plugins/huaweicloud-core/src/mcp-server.mjs`)通过 Model Context Protocol 为 Agent 提供安全的 KooCLI 访问。
123
+
124
+ - **安全优先执行** 所有 `hcloud` 命令执行前自动分类(读/写/密钥),写操作需用户明确批准。
125
+ - **输出脱敏** — 凭证形态的值(AK/SK、Token、密码)自动替换为 `***REDACTED***`。
126
+ - **12 个结构化工具** 技能搜索、CLI 检查、只读命令、区域发现、错误解释等。
127
+ - **零运行时依赖** Node.js(>= 20),无需 npm install。
128
+
129
+ 详见 [MCP 工具表](#mcp-工具)。
130
+
131
+ ## 安全模型
132
+
133
+ 三层防御体系:
134
+
135
+ | 层级 | 机制 | 说明 |
136
+ |------|------|------|
137
+ | 技能层 | `SKILL.md` 流程文档 | 教会 Agent 正确的行为规则和安全用法 |
138
+ | 钩子层 | `huaweicloud-safety.py` | PreToolUse Hook 阻断高风险工具调用(Claude Code、Cursor 可用) |
139
+ | MCP 层 | `safety-policy.mjs` | Node.js 安全策略包装器,在所有 Agent 环境中强制执行 |
140
+
141
+ 详见 [`docs/safety-model.md`](docs/safety-model.md)
142
+
143
+ ## MCP 工具
144
+
145
+ | 类别 | 工具 | 说明 |
146
+ |------|------|------|
147
+ | 知识发现 | `huaweicloud_search_docs` | 跨技能文件及文档全文搜索 |
148
+ | 知识发现 | `huaweicloud_retrieve_skill` | 按名称加载完整技能内容及参考文件 |
149
+ | 知识发现 | `huaweicloud_list_regions` | 列出可用华为云区域 |
150
+ | 知识发现 | `huaweicloud_get_regional_availability` | 检查目标区域的服务可用性 |
151
+ | CLI | `huaweicloud_check_cli` | 检查 KooCLI `hcloud` 是否已安装 |
152
+ | CLI | `huaweicloud_plan_cli_command` | 分类计划命令(读/写/密钥)但不执行 |
153
+ | CLI | `huaweicloud_list_operations` | 列出服务的可用 KooCLI 操作 |
154
+ | CLI | `huaweicloud_run_readonly_command` | 执行只读命令并脱敏输出 |
155
+ | CLI | `huaweicloud_run_approved_command` | 经用户明确批准后执行写命令 |
156
+ | 安全 | `huaweicloud_show_profile_redacted` | 安全查看 KooCLI 配置(凭证脱敏) |
157
+ | 路由 | `huaweicloud_service_catalog` | 返回推荐的能力来源排序 |
158
+ | 排错 | `huaweicloud_explain_error` | 解释错误码并建议诊断步骤 |
159
+
160
+ ## 文档
161
+
162
+ - [系统架构设计](docs/01-系统架构设计.md)
163
+ - [核心技能设计](docs/02-核心技能设计.md)
164
+ - [安全模型](docs/safety-model.md)
165
+ - [KooCLI 官方文档](https://support.huaweicloud.com/qs-hcli/hcli_02_003.html)
166
+
167
+ ## 许可证
168
+
169
+ 本项目基于 Apache-2.0 许可证发布。详见 [LICENSE](LICENSE)。
package/bin/setup.cjs CHANGED
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
- 'use strict';
3
- const path = require('path');
4
- const fileUrl = require('url').pathToFileURL(path.join(__dirname, '..', 'plugins', 'huaweicloud-core', 'src', 'setup-cli.mjs')).href;
5
- import(fileUrl).catch(e => {
6
- console.error(e.message);
7
- process.exit(1);
8
- });
2
+ 'use strict';
3
+ const path = require('path');
4
+ const fileUrl = require('url').pathToFileURL(path.join(__dirname, '..', 'plugins', 'huaweicloud-core', 'src', 'setup-cli.mjs')).href;
5
+ import(fileUrl).catch(e => {
6
+ console.error(e.message);
7
+ process.exit(1);
8
+ });
@@ -1,14 +1,14 @@
1
- ---
2
- description: Self-check Huawei Cloud DevKit readiness — hcloud, MCP, skills, auth.
3
- ---
4
-
5
- Use HuaweiCloud Devkit tools and skills to perform a comprehensive readiness check:
6
-
7
- 1. Check if KooCLI `hcloud` is installed: `huaweicloud_check_cli`. If not, guide user to install.
8
- 2. Check if hcloud has active credentials: `hcloud configure list` (redacted).
9
- 3. List installed skills via `huaweicloud_search_docs` or count directories in `~/.config/opencode/skills/`.
10
- 4. Verify MCP server is reachable by calling any read-only tool.
11
- 5. Summarize: installed (OK) vs missing (action needed).
12
- 6. Do not print AK/SK, tokens, passwords, credential files, or raw profile secrets.
13
-
14
- If MCP tools are unavailable (fresh install), run `npx huaweicloud-devkit doctor` in terminal.
1
+ ---
2
+ description: Self-check Huawei Cloud DevKit readiness — hcloud, MCP, skills, auth.
3
+ ---
4
+
5
+ Use HuaweiCloud Devkit tools and skills to perform a comprehensive readiness check:
6
+
7
+ 1. Check if KooCLI `hcloud` is installed: `huaweicloud_check_cli`. If not, guide user to install.
8
+ 2. Check if hcloud has active credentials: `hcloud configure list` (redacted).
9
+ 3. List installed skills via `huaweicloud_search_docs` or count directories in `~/.config/opencode/skills/`.
10
+ 4. Verify MCP server is reachable by calling any read-only tool.
11
+ 5. Summarize: installed (OK) vs missing (action needed).
12
+ 6. Do not print AK/SK, tokens, passwords, credential files, or raw profile secrets.
13
+
14
+ If MCP tools are unavailable (fresh install), run `npx huaweicloud-devkit doctor` in terminal.
@@ -1,14 +1,14 @@
1
- {
2
- "$schema": "https://opencode.ai/config.json",
3
- "_note": "Merge this into ~/.config/opencode/opencode.jsonc. Replace the path with the absolute path to your mcp-server.mjs installation.",
4
- "mcp": {
5
- "huaweicloud": {
6
- "type": "local",
7
- "command": [
8
- "node",
9
- "<绝对路径>/plugins/huaweicloud-core/src/mcp-server.mjs"
10
- ],
11
- "enabled": true
12
- }
13
- }
14
- }
1
+ {
2
+ "$schema": "https://opencode.ai/config.json",
3
+ "_note": "Merge this into ~/.config/opencode/opencode.jsonc. Replace the path with the absolute path to your mcp-server.mjs installation.",
4
+ "mcp": {
5
+ "huaweicloud": {
6
+ "type": "local",
7
+ "command": [
8
+ "node",
9
+ "<绝对路径>/plugins/huaweicloud-core/src/mcp-server.mjs"
10
+ ],
11
+ "enabled": true
12
+ }
13
+ }
14
+ }
@@ -1,30 +1,30 @@
1
- ---
2
- name: huaweicloud-core
3
- description: OpenCode entry skill for HuaweiCloud Devkit. Use when a developer asks OpenCode to use Huawei Cloud Skills, KooCLI, APIs, SDKs, future MCP tools, or low-priority Terraform guidance.
4
- ---
5
-
6
- # Huawei Cloud Core For OpenCode
7
-
8
- Use this skill as the OpenCode entry point. Prefer the full skill set under `plugins/huaweicloud-core/skills/` when the repository is available, or install those skills into OpenCode's skill directory with `scripts/install-opencode-local.ps1`.
9
-
10
- ## Routing
11
-
12
- 1. Use Huawei Cloud Skills for scenario workflows.
13
- 2. Use KooCLI `hcloud` for local read-only inspection and reviewed commands.
14
- 3. Use official API docs for exact request and response contracts.
15
- 4. Use SDK docs when writing application integration code.
16
- 5. Use approved MCP tools when they exist.
17
- 6. Keep Terraform Provider low priority in V1; mention it for reviewed IaC only.
18
-
19
- ## Safety
20
-
21
- Never ask the user to paste credentials. Never read `.hcloud` or `.huaweicloud` files into context. Plan writes first, ask for explicit approval, then verify with read-only checks.
22
-
23
- ## KooCLI Basics
24
-
25
- - Install guide: `https://support.huaweicloud.com/qs-hcli/hcli_02_003.html`.
26
- - Verify with `hcloud version`; set `HCLOUD_BIN` if OpenCode cannot find `hcloud`.
27
- - Discover exact operations with `hcloud <Service> --help` before guessing.
28
- - Prefer `--param=value`; array indexes start at 1, for example `--server.nics.1.subnet_id=<subnet-id>`.
29
- - Respect region intent: Singapore -> `ap-southeast-3`, Hong Kong -> `ap-southeast-2`, Beijing -> `cn-north-4`. Do not scan all regions blindly.
30
- - Warn before commands containing `adminPass`, `password`, tokens, or other values that may remain in shell history.
1
+ ---
2
+ name: huaweicloud-core
3
+ description: OpenCode entry skill for HuaweiCloud Devkit. Use when a developer asks OpenCode to use Huawei Cloud Skills, KooCLI, APIs, SDKs, future MCP tools, or low-priority Terraform guidance.
4
+ ---
5
+
6
+ # Huawei Cloud Core For OpenCode
7
+
8
+ Use this skill as the OpenCode entry point. Prefer the full skill set under `plugins/huaweicloud-core/skills/` when the repository is available, or install those skills into OpenCode's skill directory with `scripts/install-opencode-local.ps1`.
9
+
10
+ ## Routing
11
+
12
+ 1. Use Huawei Cloud Skills for scenario workflows.
13
+ 2. Use KooCLI `hcloud` for local read-only inspection and reviewed commands.
14
+ 3. Use official API docs for exact request and response contracts.
15
+ 4. Use SDK docs when writing application integration code.
16
+ 5. Use approved MCP tools when they exist.
17
+ 6. Keep Terraform Provider low priority in V1; mention it for reviewed IaC only.
18
+
19
+ ## Safety
20
+
21
+ Never ask the user to paste credentials. Never read `.hcloud` or `.huaweicloud` files into context. Plan writes first, ask for explicit approval, then verify with read-only checks.
22
+
23
+ ## KooCLI Basics
24
+
25
+ - Install guide: `https://support.huaweicloud.com/qs-hcli/hcli_02_003.html`.
26
+ - Verify with `hcloud version`; set `HCLOUD_BIN` if OpenCode cannot find `hcloud`.
27
+ - Discover exact operations with `hcloud <Service> --help` before guessing.
28
+ - Prefer `--param=value`; array indexes start at 1, for example `--server.nics.1.subnet_id=<subnet-id>`.
29
+ - Respect region intent: Singapore -> `ap-southeast-3`, Hong Kong -> `ap-southeast-2`, Beijing -> `cn-north-4`. Do not scan all regions blindly.
30
+ - Warn before commands containing `adminPass`, `password`, tokens, or other values that may remain in shell history.
package/package.json CHANGED
@@ -1,43 +1,43 @@
1
- {
2
- "name": "huaweicloud-devkit",
3
- "version": "0.1.20",
4
- "description": "Agent toolkit that helps coding agents use Huawei Cloud Skills, KooCLI, APIs, SDKs, and future MCP capabilities safely and accurately.",
5
- "type": "module",
6
- "files": [
7
- "bin",
8
- ".agents",
9
- "plugins/huaweicloud-core",
10
- "integrations/opencode"
11
- ],
12
- "bin": {
13
- "huaweicloud-devkit": "./bin/setup.cjs"
14
- },
15
- "repository": {
16
- "type": "git",
17
- "url": "https://github.com/huaweicloud-mate/huaweicloud-devkit.git"
18
- },
19
- "scripts": {
20
- "test": "node --test",
21
- "lint:md": "markdownlint-cli2 \"**/*.md\" \"#node_modules\" \"#.git\" \"#test/**\" \"#docs/**\"",
22
- "lint": "npm run lint:md",
23
- "validate": "node ./scripts/validate-package.mjs",
24
- "postinstall": "node -e \"console.log('\\nHuaweiCloud DevKit installed. Run: npx huaweicloud-devkit install\\n')\""
25
- },
26
- "devDependencies": {
27
- "markdownlint-cli2": "^0.23.2"
28
- },
29
- "keywords": [
30
- "huaweicloud",
31
- "huawei-cloud",
32
- "agent",
33
- "codex",
34
- "opencode",
35
- "mcp",
36
- "koocli",
37
- "hcloud"
38
- ],
39
- "license": "Apache-2.0",
40
- "engines": {
41
- "node": ">=20"
42
- }
43
- }
1
+ {
2
+ "name": "huaweicloud-devkit",
3
+ "version": "0.1.21",
4
+ "description": "Agent toolkit that helps coding agents use Huawei Cloud Skills, KooCLI, APIs, SDKs, and future MCP capabilities safely and accurately.",
5
+ "type": "module",
6
+ "files": [
7
+ "bin",
8
+ ".agents",
9
+ "plugins/huaweicloud-core",
10
+ "integrations/opencode"
11
+ ],
12
+ "bin": {
13
+ "huaweicloud-devkit": "./bin/setup.cjs"
14
+ },
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "https://github.com/huaweicloud-mate/huaweicloud-devkit.git"
18
+ },
19
+ "scripts": {
20
+ "test": "node --test",
21
+ "lint:md": "markdownlint-cli2 \"**/*.md\" \"#node_modules\" \"#.git\" \"#test/**\" \"#docs/**\"",
22
+ "lint": "npm run lint:md",
23
+ "validate": "node ./scripts/validate-package.mjs",
24
+ "postinstall": "node -e \"console.log('\\nHuaweiCloud DevKit installed. Run: npx huaweicloud-devkit install\\n')\""
25
+ },
26
+ "devDependencies": {
27
+ "markdownlint-cli2": "^0.23.2"
28
+ },
29
+ "keywords": [
30
+ "huaweicloud",
31
+ "huawei-cloud",
32
+ "agent",
33
+ "codex",
34
+ "opencode",
35
+ "mcp",
36
+ "koocli",
37
+ "hcloud"
38
+ ],
39
+ "license": "Apache-2.0",
40
+ "engines": {
41
+ "node": ">=20"
42
+ }
43
+ }
@@ -20,7 +20,7 @@
20
20
  "mcpServers": "./.mcp.json",
21
21
  "description": "Guide coding agents to use Huawei Cloud Skills, KooCLI, APIs, SDKs, and future MCP capabilities with safer execution and less context.",
22
22
  "skills": "./skills/",
23
- "version": "0.1.20",
23
+ "version": "0.1.21",
24
24
  "author": {
25
25
  "name": "HuaweiCloud Mate",
26
26
  "url": "https://github.com/huaweicloud-mate"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "huaweicloud-core",
3
- "version": "0.1.20",
3
+ "version": "0.1.21",
4
4
  "description": "Guide coding agents to use Huawei Cloud Skills, KooCLI, APIs, SDKs, and future MCP capabilities with safer execution and less context.",
5
5
  "author": {
6
6
  "name": "HuaweiCloud Mate",
@@ -20,7 +20,7 @@
20
20
  "mcpServers": "./.mcp.json",
21
21
  "description": "Guide coding agents to use Huawei Cloud Skills, KooCLI, APIs, SDKs, and future MCP capabilities with safer execution and less context.",
22
22
  "skills": "./skills/",
23
- "version": "0.1.20",
23
+ "version": "0.1.21",
24
24
  "author": {
25
25
  "name": "HuaweiCloud Mate",
26
26
  "url": "https://github.com/huaweicloud-mate"
@@ -1,13 +1,13 @@
1
- {
2
- "mcpServers": {
3
- "huaweicloud": {
4
- "command": "node",
5
- "args": [
6
- "./src/mcp-server.mjs"
7
- ],
8
- "env": {
9
- "HUAWEICLOUD_AGENT_TOOLKIT_MODE": "local"
10
- }
11
- }
12
- }
13
- }
1
+ {
2
+ "mcpServers": {
3
+ "huaweicloud": {
4
+ "command": "node",
5
+ "args": [
6
+ "./src/mcp-server.mjs"
7
+ ],
8
+ "env": {
9
+ "HUAWEICLOUD_AGENT_TOOLKIT_MODE": "local"
10
+ }
11
+ }
12
+ }
13
+ }