huaweicloud-devkit 1.0.2-dev.9 → 1.0.2-next.10

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 (99) hide show
  1. package/.agents/plugins/marketplace.json +20 -20
  2. package/LICENSE +201 -201
  3. package/README.md +178 -138
  4. package/README.zh-CN.md +176 -138
  5. package/bin/setup.cjs +10 -8
  6. package/integrations/opencode/commands/huaweicloud-doctor.md +14 -14
  7. package/integrations/opencode/opencode.json +11 -14
  8. package/integrations/opencode/skills/huaweicloud-core/SKILL.md +32 -32
  9. package/package.json +60 -44
  10. package/plugins/huaweicloud-core/.claude-plugin/plugin.json +31 -44
  11. package/plugins/huaweicloud-core/.codex-plugin/plugin.json +30 -43
  12. package/plugins/huaweicloud-core/.cursor-plugin/plugin.json +31 -44
  13. package/plugins/huaweicloud-core/.mcp.json +13 -15
  14. package/plugins/huaweicloud-core/.workbuddy-plugin/plugin.json +31 -44
  15. package/plugins/huaweicloud-core/hooks/hooks.json +26 -26
  16. package/plugins/huaweicloud-core/hooks/huaweicloud-safety.py +136 -136
  17. package/plugins/huaweicloud-core/safety/policy.json +76 -100
  18. package/plugins/huaweicloud-core/safety/rules/cloud-risk-rules.json +227 -199
  19. package/plugins/huaweicloud-core/skills/huawei-apig/SKILL.md +164 -164
  20. package/plugins/huaweicloud-core/skills/huawei-billing/SKILL.md +48 -48
  21. package/plugins/huaweicloud-core/skills/huawei-cbr/SKILL.md +50 -50
  22. package/plugins/huaweicloud-core/skills/huawei-cce/SKILL.md +103 -101
  23. package/plugins/huaweicloud-core/skills/huawei-cloud-eye/SKILL.md +90 -90
  24. package/plugins/huaweicloud-core/skills/huawei-cloud-find-skills/SKILL.md +191 -190
  25. package/plugins/huaweicloud-core/skills/huawei-cloud-find-skills/scripts/search-skills.mjs +171 -124
  26. package/plugins/huaweicloud-core/skills/huawei-cts/SKILL.md +55 -55
  27. package/plugins/huaweicloud-core/skills/huawei-dds-dcs/SKILL.md +70 -70
  28. package/plugins/huaweicloud-core/skills/huawei-deployment/SKILL.md +57 -56
  29. package/plugins/huaweicloud-core/skills/huawei-dew/SKILL.md +106 -97
  30. package/plugins/huaweicloud-core/skills/huawei-dew/references/csms-usage.md +36 -29
  31. package/plugins/huaweicloud-core/skills/huawei-dew/references/kms-usage.md +29 -23
  32. package/plugins/huaweicloud-core/skills/huawei-ecs/SKILL.md +188 -185
  33. package/plugins/huaweicloud-core/skills/huawei-ecs/references/create-instance.md +144 -133
  34. package/plugins/huaweicloud-core/skills/huawei-ecs/references/evs.md +31 -31
  35. package/plugins/huaweicloud-core/skills/huawei-ecs/references/flavors.md +57 -55
  36. package/plugins/huaweicloud-core/skills/huawei-ecs/references/troubleshooting.md +52 -52
  37. package/plugins/huaweicloud-core/skills/huawei-functiongraph/SKILL.md +132 -131
  38. package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/apig-event-format.md +60 -58
  39. package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/create-function.md +72 -71
  40. package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/deploy-workflow.md +119 -119
  41. package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/triggers.md +142 -142
  42. package/plugins/huaweicloud-core/skills/huawei-gaussdb/SKILL.md +56 -56
  43. package/plugins/huaweicloud-core/skills/huawei-getting-started/SKILL.md +69 -65
  44. package/plugins/huaweicloud-core/skills/huawei-iam/SKILL.md +111 -111
  45. package/plugins/huaweicloud-core/skills/huawei-iam/references/policy-examples.md +148 -122
  46. package/plugins/huaweicloud-core/skills/huawei-iam/references/quick-ref.md +56 -56
  47. package/plugins/huaweicloud-core/skills/huawei-modelarts/SKILL.md +65 -65
  48. package/plugins/huaweicloud-core/skills/huawei-obs/SKILL.md +134 -127
  49. package/plugins/huaweicloud-core/skills/huawei-obs/references/bucket-create.md +49 -49
  50. package/plugins/huaweicloud-core/skills/huawei-obs/references/bucket-lifecycle.md +31 -26
  51. package/plugins/huaweicloud-core/skills/huawei-obs/references/common-pitfalls.md +101 -100
  52. package/plugins/huaweicloud-core/skills/huawei-obs/references/single-file-share.md +40 -40
  53. package/plugins/huaweicloud-core/skills/huawei-obs/references/static-website.md +56 -56
  54. package/plugins/huaweicloud-core/skills/huawei-rds/SKILL.md +229 -224
  55. package/plugins/huaweicloud-core/skills/huawei-sandbox/SKILL.md +173 -134
  56. package/plugins/huaweicloud-core/skills/huawei-smn-dms/SKILL.md +69 -69
  57. package/plugins/huaweicloud-core/skills/huawei-vpc/SKILL.md +84 -84
  58. package/plugins/huaweicloud-core/skills/huawei-vpc/references/network.md +77 -76
  59. package/plugins/huaweicloud-core/skills/huawei-vpc/references/security-group.md +60 -59
  60. package/plugins/huaweicloud-core/skills/huawei-vpc/references/subnet.md +50 -50
  61. package/plugins/huaweicloud-core/skills/huawei-waf-aad/SKILL.md +63 -63
  62. package/plugins/huaweicloud-core/skills/huaweicloud-api-and-sdk/SKILL.md +56 -56
  63. package/plugins/huaweicloud-core/skills/huaweicloud-api-and-sdk/agents/openai.yaml +4 -4
  64. package/plugins/huaweicloud-core/skills/huaweicloud-capability-discovery/SKILL.md +56 -47
  65. package/plugins/huaweicloud-core/skills/huaweicloud-capability-discovery/agents/openai.yaml +4 -4
  66. package/plugins/huaweicloud-core/skills/huaweicloud-cli-and-auth/SKILL.md +138 -128
  67. package/plugins/huaweicloud-core/skills/huaweicloud-cli-and-auth/agents/openai.yaml +4 -4
  68. package/plugins/huaweicloud-core/skills/huaweicloud-core/SKILL.md +111 -96
  69. package/plugins/huaweicloud-core/skills/huaweicloud-core/agents/openai.yaml +4 -4
  70. package/plugins/huaweicloud-core/skills/huaweicloud-core/references/report-issue.md +20 -20
  71. package/plugins/huaweicloud-core/skills/huaweicloud-core/references/select.md +30 -28
  72. package/plugins/huaweicloud-core/skills/huaweicloud-safety/SKILL.md +59 -60
  73. package/plugins/huaweicloud-core/skills/huaweicloud-safety/agents/openai.yaml +4 -4
  74. package/plugins/huaweicloud-core/skills/huaweicloud-troubleshooting/SKILL.md +83 -83
  75. package/plugins/huaweicloud-core/skills/huaweicloud-troubleshooting/agents/openai.yaml +4 -4
  76. package/plugins/huaweicloud-core/src/auth/agent-registration.mjs +54 -1
  77. package/plugins/huaweicloud-core/src/auth/credentials.mjs +103 -95
  78. package/plugins/huaweicloud-core/src/auth/service.mjs +63 -63
  79. package/plugins/huaweicloud-core/src/data/icons-manifest.v1.json +3517 -0
  80. package/plugins/huaweicloud-core/src/hcloud-cli.mjs +283 -265
  81. package/plugins/huaweicloud-core/src/icon-library.mjs +171 -0
  82. package/plugins/huaweicloud-core/src/mcp-server.mjs +130 -129
  83. package/plugins/huaweicloud-core/src/proxy/proxy-agent.mjs +68 -0
  84. package/plugins/huaweicloud-core/src/proxy/proxy-config.mjs +94 -0
  85. package/plugins/huaweicloud-core/src/risk-rule-engine.mjs +140 -137
  86. package/plugins/huaweicloud-core/src/safety-policy.mjs +356 -302
  87. package/plugins/huaweicloud-core/src/sandbox/hdkitservice-api.mjs +86 -87
  88. package/plugins/huaweicloud-core/src/sandbox/hwlink-api.mjs +150 -153
  89. package/plugins/huaweicloud-core/src/sandbox/session-manager.mjs +196 -105
  90. package/plugins/huaweicloud-core/src/search-market.mjs +208 -169
  91. package/plugins/huaweicloud-core/src/setup-cli.mjs +2622 -1594
  92. package/plugins/huaweicloud-core/src/tools.mjs +463 -111
  93. package/plugins/huaweicloud-core/src/ws-exec/hwlink-exec-client.js +447 -427
  94. package/plugins/huaweicloud-core/src/ws-exec/hwlink-fair-queue.js +128 -132
  95. package/plugins/huaweicloud-core/src/ws-exec/hwlink-multiplexer.js +215 -227
  96. package/plugins/huaweicloud-core/src/ws-exec/hwlink-packet.js +189 -202
  97. package/plugins/huaweicloud-core/src/ws-exec/hwlink-terminal-channel.js +164 -158
  98. package/plugins/huaweicloud-core/src/ws-exec/index.js +19 -19
  99. package/plugins/huaweicloud-core/src/ws-exec/ws-exec-client.js +338 -338
package/README.md CHANGED
@@ -1,138 +1,178 @@
1
- # HuaweiCloud DevKit
2
-
3
- [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)
4
- [![CI](https://github.com/huaweicloud/HuaweiCloud-Devkit/actions/workflows/ci.yml/badge.svg)](https://github.com/huaweicloud/HuaweiCloud-Devkit/actions/workflows/ci.yml)
5
-
6
- **[中文](README.zh-CN.md) | English**
7
-
8
- Help AI coding agents use Huawei Cloud safely and accurately — a single integration that gives agents cloud knowledge, CLI tooling, and safety guardrails.
9
-
10
- Supports OpenCode, Codex, CodeArts Agent, and WorkBuddy.
11
-
12
- ## Prerequisites
13
-
14
- - Node.js >= 22
15
-
16
- ## Quick Start
17
-
18
- ### OpenCode
19
-
20
- ```bash
21
- npx --yes huaweicloud-devkit install
22
- ```
23
-
24
- Installs the DevKit into OpenCode automatically. **Restart the session** after installation.
25
-
26
- ```bash
27
- npx --yes huaweicloud-devkit doctor # self-check
28
- npx --yes huaweicloud-devkit status # show status
29
- npx --yes huaweicloud-devkit update # update
30
- npx --yes huaweicloud-devkit uninstall # uninstall
31
- ```
32
-
33
- ### Codex
34
-
35
- ```bash
36
- npx --yes huaweicloud-devkit install --target codex
37
- ```
38
-
39
- > The Codex CLI must be installed first.
40
-
41
- ```bash
42
- npx --yes huaweicloud-devkit doctor # self-check
43
- npx --yes huaweicloud-devkit status --target codex
44
- npx --yes huaweicloud-devkit update --target codex # update
45
- npx --yes huaweicloud-devkit uninstall --target codex
46
- ```
47
-
48
- > **Codex Desktop** (Windows): use `--target codex-desktop` with the same commands.
49
-
50
- ### CodeArts Agent
51
-
52
- ```bash
53
- npx --yes huaweicloud-devkit install --target codearts
54
- ```
55
-
56
- **Restart the session** after installation.
57
-
58
- ```bash
59
- npx --yes huaweicloud-devkit install-hcloud # install KooCLI
60
- npx --yes huaweicloud-devkit doctor # self-check
61
- npx --yes huaweicloud-devkit status --target codearts
62
- npx --yes huaweicloud-devkit update --target codearts
63
- npx --yes huaweicloud-devkit uninstall --target codearts
64
- ```
65
-
66
- > **Sandbox mode**: CodeArts defaults to sandbox mode which blocks KooCLI. `install-hcloud` detects this and shows how to resolve it — install KooCLI outside the sandbox terminal, or disable sandbox mode in CodeArts settings (Settings → Permissions → Bash mode).
67
- >
68
- > **Authentication**: Run `npx huaweicloud-devkit auth init` to configure unified AK/SK credentials for KooCLI, OBS, and sandbox APIs.
69
-
70
- ### WorkBuddy
71
-
72
- ```bash
73
- npx --yes huaweicloud-devkit install --target workbuddy
74
- ```
75
-
76
- **Restart the session** after installation.
77
-
78
- ```bash
79
- npx --yes huaweicloud-devkit doctor
80
- npx --yes huaweicloud-devkit status --target workbuddy
81
- npx --yes huaweicloud-devkit update --target workbuddy # update
82
- npx --yes huaweicloud-devkit uninstall --target workbuddy
83
- ```
84
-
85
- > **Updating**: `update` is incremental per agent — it refreshes only the installed files and leaves your config untouched. Use `update --target all` to update every installed agent at once.
86
-
87
- ### Other Agents
88
-
89
- For agents that support the Model Context Protocol (MCP):
90
-
91
- ```json
92
- {
93
- "mcp": {
94
- "huaweicloud-devkit": {
95
- "type": "local",
96
- "command": ["node", "<path>/plugins/huaweicloud-core/src/mcp-server.mjs"],
97
- "enabled": true
98
- }
99
- }
100
- }
101
- ```
102
-
103
- Then install:
104
-
105
- ```bash
106
- npx --yes huaweicloud-devkit install
107
- ```
108
-
109
- > **Prerequisite:** Node.js >= 22. Run `npx huaweicloud-devkit auth init` for unified credentials.
110
-
111
- ## What It Does
112
-
113
- - **Guided cloud operations** — agents get step-by-step guidance for 20+ Huawei Cloud services (ECS, OBS, VPC, RDS, GaussDB, FunctionGraph, APIG, CCE, and more)
114
- - **Safety-first execution** all write operations require explicit user approval; credentials and secrets are automatically redacted from output
115
- - **Pre-execution risk checks** — public exposure, credential leaks, and destructive operations are caught before they run
116
- - **Regional awareness** — auto-discovers available regions and checks service availability before creating resources
117
-
118
- ## Supported Services
119
-
120
- ECS, OBS, VPC, IAM, RDS, GaussDB, FunctionGraph, APIG, CCE, SMN/DMS, ModelArts, Cloud Eye, CTS, DEW, Billing, CBR, WAF/AAD, DDS/DCS, Deployment, and Getting Started guides.
121
-
122
- ## Documentation
123
-
124
- - [Architecture](docs/architecture.md)
125
- - [Safety Model](docs/safety-model.md)
126
- - [Hook Rule Model](docs/hook-rule-model.md)
127
- - [Changelog](docs/CHANGELOG.md)
128
- - [KooCLI official docs](https://support.huaweicloud.com/qs-hcli/hcli_02_003.html)
129
-
130
- ## Contributors
131
-
132
- <a href="https://github.com/huaweicloud/huaweicloud-devkit/graphs/contributors">
133
- <img src="https://contrib.rocks/image?repo=huaweicloud/huaweicloud-devkit" />
134
- </a>
135
-
136
- ## License
137
-
138
- This project is licensed under the Apache-2.0 License. See [LICENSE](LICENSE).
1
+ # HuaweiCloud DevKit
2
+
3
+ [![Discussions](https://img.shields.io/badge/Discussions-Join%20the%20discussion-blue)](https://github.com/huaweicloud/huaweicloud-devkit/discussions)
4
+ [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)
5
+ [![CI](https://github.com/huaweicloud/huaweicloud-devkit/actions/workflows/ci.yml/badge.svg)](https://github.com/huaweicloud/huaweicloud-devkit/actions/workflows/ci.yml)
6
+
7
+ **[中文](README.zh-CN.md) | English**
8
+
9
+ Help AI coding agents use Huawei Cloud safely and accurately — a single integration that gives agents cloud knowledge, CLI tooling, and safety guardrails.
10
+
11
+ Supports OpenCode, Codex, CodeArts Agent, WorkBuddy, DeepSeek Harness (DSH), and OfficeAce.
12
+
13
+ ## Prerequisites
14
+
15
+ - Node.js >= 20
16
+
17
+ ## Quick Start
18
+
19
+ ### OpenCode
20
+
21
+ ```bash
22
+ npx --yes huaweicloud-devkit install
23
+ ```
24
+
25
+ Installs the DevKit into OpenCode automatically. **Restart the session** after installation.
26
+
27
+ ```bash
28
+ npx --yes huaweicloud-devkit doctor # self-check
29
+ npx --yes huaweicloud-devkit status # show status
30
+ npx --yes huaweicloud-devkit update # update
31
+ npx --yes huaweicloud-devkit uninstall # uninstall
32
+ ```
33
+
34
+ ### Codex
35
+
36
+ ```bash
37
+ npx --yes huaweicloud-devkit install --target codex
38
+ ```
39
+
40
+ > The Codex CLI must be installed first.
41
+
42
+ ```bash
43
+ npx --yes huaweicloud-devkit doctor # self-check
44
+ npx --yes huaweicloud-devkit status --target codex
45
+ npx --yes huaweicloud-devkit update --target codex # update
46
+ npx --yes huaweicloud-devkit uninstall --target codex
47
+ ```
48
+
49
+ > **Codex Desktop** (Windows): use `--target codex-desktop` with the same commands.
50
+
51
+ ### CodeArts Agent
52
+
53
+ ```bash
54
+ npx --yes huaweicloud-devkit install --target codearts
55
+ ```
56
+
57
+ **Restart the session** after installation.
58
+
59
+ ```bash
60
+ npx --yes huaweicloud-devkit install-hcloud # install KooCLI
61
+ npx --yes huaweicloud-devkit doctor # self-check
62
+ npx --yes huaweicloud-devkit status --target codearts
63
+ npx --yes huaweicloud-devkit update --target codearts
64
+ npx --yes huaweicloud-devkit uninstall --target codearts
65
+ ```
66
+
67
+ > **Sandbox mode**: CodeArts defaults to sandbox mode which blocks KooCLI. `install-hcloud` detects this and shows how to resolve it — install KooCLI outside the sandbox terminal, or disable sandbox mode in CodeArts settings (Settings → Permissions → Bash mode).
68
+ >
69
+ > **Authentication**: Run `npx huaweicloud-devkit auth init` to configure unified AK/SK credentials for KooCLI, OBS, and sandbox APIs.
70
+
71
+ ### WorkBuddy
72
+
73
+ ```bash
74
+ npx --yes huaweicloud-devkit install --target workbuddy
75
+ ```
76
+
77
+ **Restart the session** after installation.
78
+
79
+ ```bash
80
+ npx --yes huaweicloud-devkit doctor
81
+ npx --yes huaweicloud-devkit status --target workbuddy
82
+ npx --yes huaweicloud-devkit update --target workbuddy # update
83
+ npx --yes huaweicloud-devkit uninstall --target workbuddy
84
+ ```
85
+
86
+ > **Updating**: `update` is incremental per agent — it refreshes only the installed files and leaves your config untouched. Use `update --target all` to update every installed agent at once.
87
+
88
+ ### DeepSeek Harness (DSH)
89
+
90
+ ```bash
91
+ npx --yes huaweicloud-devkit install --target dsh
92
+ ```
93
+
94
+ The installer copies Skills to `$DSH_HOME/skills`, installs the MCP server and
95
+ safety policy under `$DSH_HOME/huaweicloud-plugins`, and maintains
96
+ `$DSH_HOME/profiles/web/cordis.patch.yml`. **Restart the DSH session** after
97
+ installation.
98
+
99
+ ```bash
100
+ npx --yes huaweicloud-devkit doctor
101
+ npx --yes huaweicloud-devkit status --target dsh
102
+ npx --yes huaweicloud-devkit update --target dsh
103
+ npx --yes huaweicloud-devkit uninstall --target dsh
104
+ ```
105
+
106
+ > DSH V1 reuses the existing MCP server through
107
+ > `@deepseek-ai/dsh-mcp-client`. If the installer reports that the DSH MCP
108
+ > client is not detected, run:
109
+ > `npx @deepseek-ai/dsh plugin --profile web add @deepseek-ai/dsh-mcp-client`.
110
+
111
+ ### OfficeAce
112
+
113
+ ```bash
114
+ npx --yes huaweicloud-devkit install --target officeace
115
+ ```
116
+
117
+ **Restart OfficeAce** after installation.
118
+
119
+ ```bash
120
+ npx --yes huaweicloud-devkit doctor
121
+ npx --yes huaweicloud-devkit status --target officeace
122
+ npx --yes huaweicloud-devkit update --target officeace
123
+ npx --yes huaweicloud-devkit uninstall --target officeace
124
+ ```
125
+
126
+ ### Other Agents
127
+
128
+ For agents that support the Model Context Protocol (MCP):
129
+
130
+ ```json
131
+ {
132
+ "mcp": {
133
+ "huaweicloud-devkit": {
134
+ "type": "local",
135
+ "command": ["node", "<path>/plugins/huaweicloud-core/src/mcp-server.mjs"],
136
+ "enabled": true
137
+ }
138
+ }
139
+ }
140
+ ```
141
+
142
+ Then install:
143
+
144
+ ```bash
145
+ npx --yes huaweicloud-devkit install
146
+ ```
147
+
148
+ > **Prerequisite:** Node.js >= 20. Run `npx huaweicloud-devkit auth init` for unified credentials.
149
+
150
+ ## What It Does
151
+
152
+ - **Guided cloud operations** — agents get step-by-step guidance for 20+ Huawei Cloud services (ECS, OBS, VPC, RDS, GaussDB, FunctionGraph, APIG, CCE, and more)
153
+ - **Safety-first execution** — all write operations require explicit user approval; credentials and secrets are automatically redacted from output
154
+ - **Pre-execution risk checks** — public exposure, credential leaks, and destructive operations are caught before they run
155
+ - **Regional awareness** — auto-discovers available regions and checks service availability before creating resources
156
+
157
+ ## Supported Services
158
+
159
+ ECS, OBS, VPC, IAM, RDS, GaussDB, FunctionGraph, APIG, CCE, SMN/DMS, ModelArts, Cloud Eye, CTS, DEW, Billing, CBR, WAF/AAD, DDS/DCS, Deployment, and Getting Started guides.
160
+
161
+ ## Documentation
162
+
163
+ - [Architecture](docs/architecture.md)
164
+ - [Safety Model](docs/safety-model.md)
165
+ - [Hook Rule Model](docs/hook-rule-model.md)
166
+ - [DeepSeek Harness Integration](docs/dsh-integration.md)
167
+ - [Changelog](docs/CHANGELOG.md)
168
+ - [KooCLI official docs](https://support.huaweicloud.com/qs-hcli/hcli_02_003.html)
169
+
170
+ ## Contributors
171
+
172
+ <a href="https://github.com/huaweicloud/huaweicloud-devkit/graphs/contributors">
173
+ <img src="https://contrib.rocks/image?repo=huaweicloud/huaweicloud-devkit" />
174
+ </a>
175
+
176
+ ## License
177
+
178
+ This project is licensed under the Apache-2.0 License. See [LICENSE](LICENSE).
package/README.zh-CN.md CHANGED
@@ -1,138 +1,176 @@
1
- # HuaweiCloud DevKit
2
-
3
- [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)
4
- [![CI](https://github.com/huaweicloud/HuaweiCloud-Devkit/actions/workflows/ci.yml/badge.svg)](https://github.com/huaweicloud/HuaweiCloud-Devkit/actions/workflows/ci.yml)
5
-
6
- **中文 | [English](README.md)**
7
-
8
- 帮助 AI 编码助手安全、准确地使用华为云——一站式集成云知识、CLI 工具和安全护栏。
9
-
10
- 支持 OpenCode、Codex、码道(CodeArts Agent)、WorkBuddy。
11
-
12
- ## 前置条件
13
-
14
- - Node.js >= 22
15
-
16
- ## 快速开始
17
-
18
- ### OpenCode
19
-
20
- ```bash
21
- npx --yes huaweicloud-devkit install
22
- ```
23
-
24
- 自动安装 DevKit。安装后**重启会话**。
25
-
26
- ```bash
27
- npx --yes huaweicloud-devkit doctor # 自检
28
- npx --yes huaweicloud-devkit status # 查看状态
29
- npx --yes huaweicloud-devkit update # 更新
30
- npx --yes huaweicloud-devkit uninstall # 卸载
31
- ```
32
-
33
- ### Codex
34
-
35
- ```bash
36
- npx --yes huaweicloud-devkit install --target codex
37
- ```
38
-
39
- > 需要先安装 Codex CLI。
40
-
41
- ```bash
42
- npx --yes huaweicloud-devkit doctor # 自检
43
- npx --yes huaweicloud-devkit status --target codex
44
- npx --yes huaweicloud-devkit update --target codex # 更新
45
- npx --yes huaweicloud-devkit uninstall --target codex
46
- ```
47
-
48
- > **Codex Desktop**(Windows):将 `--target codex` 换成 `--target codex-desktop`,命令相同。
49
-
50
- ### CodeArts Agent(码道)
51
-
52
- ```bash
53
- npx --yes huaweicloud-devkit install --target codearts
54
- ```
55
-
56
- 安装后**重启会话**。
57
-
58
- ```bash
59
- npx --yes huaweicloud-devkit install-hcloud # 安装 KooCLI
60
- npx --yes huaweicloud-devkit doctor # 自检
61
- npx --yes huaweicloud-devkit status --target codearts
62
- npx --yes huaweicloud-devkit update --target codearts
63
- npx --yes huaweicloud-devkit uninstall --target codearts
64
- ```
65
-
66
- > **沙箱模式**:码道默认沙箱模式会阻止 KooCLI 运行。`install-hcloud` 自动检测并给出指引——请在码道外终端安装使用 KooCLI,或在码道设置中关闭沙箱模式(设置 → 权限 → Bash 模式)。
67
- >
68
- > **认证**:执行 `npx huaweicloud-devkit auth init`,统一配置 KooCLI、OBS 和沙箱接口所需的 AK/SK。
69
-
70
- ### WorkBuddy
71
-
72
- ```bash
73
- npx --yes huaweicloud-devkit install --target workbuddy
74
- ```
75
-
76
- 安装后**重启会话**。
77
-
78
- ```bash
79
- npx --yes huaweicloud-devkit doctor
80
- npx --yes huaweicloud-devkit status --target workbuddy
81
- npx --yes huaweicloud-devkit update --target workbuddy # 更新
82
- npx --yes huaweicloud-devkit uninstall --target workbuddy
83
- ```
84
-
85
- > **更新机制**:`update` 按 agent 增量更新,只刷新必要文件、不动你的配置文件。`update --target all` 可一次更新所有已安装的 agent。
86
-
87
- ### 其他 Agent
88
-
89
- 支持 MCP 协议的 Agent,手动配置:
90
-
91
- ```json
92
- {
93
- "mcp": {
94
- "huaweicloud-devkit": {
95
- "type": "local",
96
- "command": ["node", "<路径>/plugins/huaweicloud-core/src/mcp-server.mjs"],
97
- "enabled": true
98
- }
99
- }
100
- }
101
- ```
102
-
103
- 然后安装:
104
-
105
- ```bash
106
- npx --yes huaweicloud-devkit install
107
- ```
108
-
109
- > **前置条件:** Node.js >= 22。执行 `npx huaweicloud-devkit auth init` 完成统一认证。
110
-
111
- ## 功能特性
112
-
113
- - **引导式云操作** — Agent 获得 20+ 华为云服务的分步操作指引(ECS、OBS、VPC、RDS、GaussDB、FunctionGraph、APIG、CCE 等)
114
- - **安全优先执行** — 所有写操作需用户明确批准;凭证和密钥自动脱敏
115
- - **执行前风险检查** — 公网暴露、凭证泄露、破坏性操作在执行前即被拦截
116
- - **区域感知** — 自动发现可用区域,创建资源前检查服务可用性
117
-
118
- ## 支持的服务
119
-
120
- ECS、OBS、VPC、IAM、RDS、GaussDB、FunctionGraph、APIG、CCE、SMN/DMS、ModelArts、Cloud Eye、CTS、DEW、Billing、CBR、WAF/AAD、DDS/DCS、Deployment,以及入门指南。
121
-
122
- ## 文档
123
-
124
- - [架构](docs/architecture.md)
125
- - [安全模型](docs/safety-model.md)
126
- - [Hook 规则模型](docs/hook-rule-model.md)
127
- - [变更记录](docs/CHANGELOG.md)
128
- - [KooCLI 官方文档](https://support.huaweicloud.com/qs-hcli/hcli_02_003.html)
129
-
130
- ## 贡献者
131
-
132
- <a href="https://github.com/huaweicloud/huaweicloud-devkit/graphs/contributors">
133
- <img src="https://contrib.rocks/image?repo=huaweicloud/huaweicloud-devkit" />
134
- </a>
135
-
136
- ## 许可证
137
-
138
- 本项目基于 Apache-2.0 许可证发布。详见 [LICENSE](LICENSE)。
1
+ # HuaweiCloud DevKit
2
+
3
+ [![参与讨论](https://img.shields.io/badge/参与讨论-Join%20the%20discussion-blue)](https://github.com/huaweicloud/huaweicloud-devkit/discussions)
4
+ [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)
5
+ [![CI](https://github.com/huaweicloud/huaweicloud-devkit/actions/workflows/ci.yml/badge.svg)](https://github.com/huaweicloud/huaweicloud-devkit/actions/workflows/ci.yml)
6
+
7
+ **中文 | [English](README.md)**
8
+
9
+ 帮助 AI 编码助手安全、准确地使用华为云——一站式集成云知识、CLI 工具和安全护栏。
10
+
11
+ 支持 OpenCode、Codex、码道(CodeArts Agent)、WorkBuddy、DeepSeek Harness(DSH)、OfficeAce。
12
+
13
+ ## 前置条件
14
+
15
+ - Node.js >= 20
16
+
17
+ ## 快速开始
18
+
19
+ ### OpenCode
20
+
21
+ ```bash
22
+ npx --yes huaweicloud-devkit install
23
+ ```
24
+
25
+ 自动安装 DevKit。安装后**重启会话**。
26
+
27
+ ```bash
28
+ npx --yes huaweicloud-devkit doctor # 自检
29
+ npx --yes huaweicloud-devkit status # 查看状态
30
+ npx --yes huaweicloud-devkit update # 更新
31
+ npx --yes huaweicloud-devkit uninstall # 卸载
32
+ ```
33
+
34
+ ### Codex
35
+
36
+ ```bash
37
+ npx --yes huaweicloud-devkit install --target codex
38
+ ```
39
+
40
+ > 需要先安装 Codex CLI。
41
+
42
+ ```bash
43
+ npx --yes huaweicloud-devkit doctor # 自检
44
+ npx --yes huaweicloud-devkit status --target codex
45
+ npx --yes huaweicloud-devkit update --target codex # 更新
46
+ npx --yes huaweicloud-devkit uninstall --target codex
47
+ ```
48
+
49
+ > **Codex Desktop**(Windows):将 `--target codex` 换成 `--target codex-desktop`,命令相同。
50
+
51
+ ### CodeArts Agent(码道)
52
+
53
+ ```bash
54
+ npx --yes huaweicloud-devkit install --target codearts
55
+ ```
56
+
57
+ 安装后**重启会话**。
58
+
59
+ ```bash
60
+ npx --yes huaweicloud-devkit install-hcloud # 安装 KooCLI
61
+ npx --yes huaweicloud-devkit doctor # 自检
62
+ npx --yes huaweicloud-devkit status --target codearts
63
+ npx --yes huaweicloud-devkit update --target codearts
64
+ npx --yes huaweicloud-devkit uninstall --target codearts
65
+ ```
66
+
67
+ > **沙箱模式**:码道默认沙箱模式会阻止 KooCLI 运行。`install-hcloud` 自动检测并给出指引——请在码道外终端安装使用 KooCLI,或在码道设置中关闭沙箱模式(设置 → 权限 → Bash 模式)。
68
+ >
69
+ > **认证**:执行 `npx huaweicloud-devkit auth init`,统一配置 KooCLI、OBS 和沙箱接口所需的 AK/SK。
70
+
71
+ ### WorkBuddy
72
+
73
+ ```bash
74
+ npx --yes huaweicloud-devkit install --target workbuddy
75
+ ```
76
+
77
+ 安装后**重启会话**。
78
+
79
+ ```bash
80
+ npx --yes huaweicloud-devkit doctor
81
+ npx --yes huaweicloud-devkit status --target workbuddy
82
+ npx --yes huaweicloud-devkit update --target workbuddy # 更新
83
+ npx --yes huaweicloud-devkit uninstall --target workbuddy
84
+ ```
85
+
86
+ > **更新机制**:`update` 按 agent 增量更新,只刷新必要文件、不动你的配置文件。`update --target all` 可一次更新所有已安装的 agent。
87
+
88
+ ### DeepSeek Harness(DSH)
89
+
90
+ ```bash
91
+ npx --yes huaweicloud-devkit install --target dsh
92
+ ```
93
+
94
+ 安装器会把 Skills 写入 `$DSH_HOME/skills`,把 MCP Server 和安全策略写入
95
+ `$DSH_HOME/huaweicloud-plugins`,并自动维护
96
+ `$DSH_HOME/profiles/web/cordis.patch.yml`。安装后**重启 DSH 会话**。
97
+
98
+ ```bash
99
+ npx --yes huaweicloud-devkit doctor
100
+ npx --yes huaweicloud-devkit status --target dsh
101
+ npx --yes huaweicloud-devkit update --target dsh
102
+ npx --yes huaweicloud-devkit uninstall --target dsh
103
+ ```
104
+
105
+ > DSH V1 通过 `@deepseek-ai/dsh-mcp-client` 复用现有 MCP Server。
106
+ > 如果安装器提示 DSH MCP 客户端未检测到,请按提示执行
107
+ > `npx @deepseek-ai/dsh plugin --profile web add @deepseek-ai/dsh-mcp-client`。
108
+
109
+ ### OfficeAce
110
+
111
+ ```bash
112
+ npx --yes huaweicloud-devkit install --target officeace
113
+ ```
114
+
115
+ 安装后**重启 OfficeAce**。
116
+
117
+ ```bash
118
+ npx --yes huaweicloud-devkit doctor
119
+ npx --yes huaweicloud-devkit status --target officeace
120
+ npx --yes huaweicloud-devkit update --target officeace
121
+ npx --yes huaweicloud-devkit uninstall --target officeace
122
+ ```
123
+
124
+ ### 其他 Agent
125
+
126
+ 支持 MCP 协议的 Agent,手动配置:
127
+
128
+ ```json
129
+ {
130
+ "mcp": {
131
+ "huaweicloud-devkit": {
132
+ "type": "local",
133
+ "command": ["node", "<路径>/plugins/huaweicloud-core/src/mcp-server.mjs"],
134
+ "enabled": true
135
+ }
136
+ }
137
+ }
138
+ ```
139
+
140
+ 然后安装:
141
+
142
+ ```bash
143
+ npx --yes huaweicloud-devkit install
144
+ ```
145
+
146
+ > **前置条件:** Node.js >= 20。执行 `npx huaweicloud-devkit auth init` 完成统一认证。
147
+
148
+ ## 功能特性
149
+
150
+ - **引导式云操作** — Agent 获得 20+ 华为云服务的分步操作指引(ECS、OBS、VPC、RDS、GaussDB、FunctionGraph、APIG、CCE 等)
151
+ - **安全优先执行** — 所有写操作需用户明确批准;凭证和密钥自动脱敏
152
+ - **执行前风险检查** — 公网暴露、凭证泄露、破坏性操作在执行前即被拦截
153
+ - **区域感知** — 自动发现可用区域,创建资源前检查服务可用性
154
+
155
+ ## 支持的服务
156
+
157
+ ECS、OBS、VPC、IAM、RDS、GaussDB、FunctionGraph、APIG、CCE、SMN/DMS、ModelArts、Cloud Eye、CTS、DEW、Billing、CBR、WAF/AAD、DDS/DCS、Deployment,以及入门指南。
158
+
159
+ ## 文档
160
+
161
+ - [架构](docs/architecture.md)
162
+ - [安全模型](docs/safety-model.md)
163
+ - [Hook 规则模型](docs/hook-rule-model.md)
164
+ - [DeepSeek Harness 集成](docs/dsh-integration.md)
165
+ - [变更记录](docs/CHANGELOG.md)
166
+ - [KooCLI 官方文档](https://support.huaweicloud.com/qs-hcli/hcli_02_003.html)
167
+
168
+ ## 贡献者
169
+
170
+ <a href="https://github.com/huaweicloud/huaweicloud-devkit/graphs/contributors">
171
+ <img src="https://contrib.rocks/image?repo=huaweicloud/huaweicloud-devkit" />
172
+ </a>
173
+
174
+ ## 许可证
175
+
176
+ 本项目基于 Apache-2.0 许可证发布。详见 [LICENSE](LICENSE)。
package/bin/setup.cjs CHANGED
@@ -1,8 +1,10 @@
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
- });
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+ const path = require('node:path');
4
+ const fileUrl = require('node:url').pathToFileURL(
5
+ path.join(__dirname, '..', 'plugins', 'huaweicloud-core', 'src', 'setup-cli.mjs'),
6
+ ).href;
7
+ import(fileUrl).catch((e) => {
8
+ console.error(e.message);
9
+ process.exit(1);
10
+ });