@deveco-test/deveco-cli-common 1.3.11-Test.6 → 1.3.12-Test.2
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 +155 -25
- package/THIRD-PARTY-LICENSES +32 -3
- package/dist/cli.js +231 -214
- package/dist/internal/telemetry-upload-background.js +10 -10
- package/package.json +4 -2
- package/skills/deveco-cli/SKILL.md +56 -8
- package/skills/index.json +2 -2
- package/templates/application/template.json +8 -0
- package/templates/native-cpp/AppScope/app.json5 +10 -0
- package/templates/native-cpp/AppScope/resources/base/element/string.json +8 -0
- package/templates/native-cpp/AppScope/resources/base/media/layered_image.json +7 -0
- package/templates/native-cpp/build-profile.json5 +43 -0
- package/templates/native-cpp/code-linter.json5 +32 -0
- package/templates/native-cpp/entry/build-profile.json5 +48 -0
- package/templates/native-cpp/entry/gitignore.txt +6 -0
- package/templates/native-cpp/entry/hvigorfile.ts +6 -0
- package/templates/native-cpp/entry/obfuscation-rules.txt +20 -0
- package/templates/native-cpp/entry/oh-package.json5 +11 -0
- package/templates/native-cpp/entry/src/main/cpp/CMakeLists.txt +15 -0
- package/templates/native-cpp/entry/src/main/cpp/napi_init.cpp +67 -0
- package/templates/native-cpp/entry/src/main/cpp/types/libentry/Index.d.ts +16 -0
- package/templates/native-cpp/entry/src/main/cpp/types/libentry/oh-package.json5 +6 -0
- package/templates/native-cpp/entry/src/main/ets/entryability/EntryAbility.ets +63 -0
- package/templates/native-cpp/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +31 -0
- package/templates/native-cpp/entry/src/main/ets/pages/Index.ets +26 -0
- package/templates/native-cpp/entry/src/main/module.json5 +50 -0
- package/templates/native-cpp/entry/src/main/resources/base/element/color.json +8 -0
- package/templates/native-cpp/entry/src/main/resources/base/element/float.json +8 -0
- package/templates/native-cpp/entry/src/main/resources/base/element/string.json +16 -0
- package/templates/native-cpp/entry/src/main/resources/base/media/layered_image.json +7 -0
- package/templates/native-cpp/entry/src/main/resources/base/profile/backup_config.json +3 -0
- package/templates/native-cpp/entry/src/main/resources/base/profile/main_pages.json +5 -0
- package/templates/native-cpp/entry/src/main/resources/dark/element/color.json +8 -0
- package/templates/native-cpp/gitignore.txt +13 -0
- package/templates/native-cpp/hvigor/hvigor-config.json5 +23 -0
- package/templates/native-cpp/hvigorfile.ts +6 -0
- package/templates/native-cpp/oh-package.json5 +10 -0
- package/templates/native-cpp/template.json +8 -0
package/README.md
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
</p>
|
|
13
13
|
</div>
|
|
14
14
|
|
|
15
|
-
`DevEco CLI` 将 `DevEco Studio` 工具链统一封装为一个 `CLI
|
|
15
|
+
`DevEco CLI` 将 `DevEco Studio` 工具链统一封装为一个 `CLI`,统一调用由 `DevEco Studio` / `Command Line Tools` 提供的 `ohpm`、`hvigor`、`hdc`、`emulator`、`hilog` 工具,同时集成 HarmonyOS 技能安装、项目脚手架、本地 HarmonyOS 文档检索、`ArkTS` 调试和 `MCP` 服务。工具链(`DevEco Studio` 或 `Command Line Tools`)需单独安装。
|
|
16
16
|
|
|
17
17
|
> 关于数据采集与隐私(遥测打点内容、存储加密、上报及关闭方式),请参阅 [PRIVACY.md](./PRIVACY.md)。
|
|
18
18
|
|
|
@@ -21,10 +21,11 @@
|
|
|
21
21
|
|
|
22
22
|
### 前置要求
|
|
23
23
|
|
|
24
|
-
- 操作系统为 `macOS
|
|
25
|
-
-
|
|
24
|
+
- 操作系统为 `macOS`、`Windows` 或 `Linux`(需配置对应环境变量)
|
|
25
|
+
- 安装 `Node.js` 22 及以上版本
|
|
26
26
|
- [DevEco Studio](https://developer.huawei.com/consumer/cn/download/) >= 6.0.0 或 [Command Line Tools](https://developer.huawei.com/consumer/cn/download/) >= 26.0.0
|
|
27
|
-
- **macOS
|
|
27
|
+
- **macOS**:自动发现会搜索 `~/Applications` 和 `/Applications`,其他安装位置可通过 `DEVECO_CLI_STUDIO_PATH` 指定。
|
|
28
|
+
- **使用 Command Line Tools 构建或签名时**:还需提供可用的 JDK/JBR,并配置 `JAVA_HOME` 或加入 `PATH`。
|
|
28
29
|
|
|
29
30
|
### 安装
|
|
30
31
|
|
|
@@ -65,10 +66,10 @@ devecocli docs read guides/harmonyos-guides/指南/系统/网络/网络
|
|
|
65
66
|
| `DEVECO_CLI_STUDIO_PATH` | 显式指定 DevEco Studio 安装根,优先级最高 |
|
|
66
67
|
| `DEVECO_CLI_CLT_PATH` | 显式指定 Command Line Tools 安装根 |
|
|
67
68
|
|
|
68
|
-
|
|
69
|
+
完整优先级链(`DEVECO_HOME`、`DEVECO_PATH` 为兼容旧版本的变量,仍优先于自动发现):
|
|
69
70
|
|
|
70
71
|
```text
|
|
71
|
-
DEVECO_CLI_STUDIO_PATH > DEVECO_CLI_CLT_PATH > Auto_Detect
|
|
72
|
+
DEVECO_CLI_STUDIO_PATH > DEVECO_CLI_CLT_PATH > DEVECO_HOME > DEVECO_PATH > Auto_Detect
|
|
72
73
|
```
|
|
73
74
|
|
|
74
75
|
### 平台与版本约束
|
|
@@ -95,8 +96,6 @@ devecocli device list
|
|
|
95
96
|
|
|
96
97
|
`devecocli` 支持中国大陆(CN)、香港(HK)和澳门(MO)三个区域。其他地区的在线能力(登录、签名、协议查询、镜像下载、知识库下载等)不可用,纯本地命令(`create`/`build`/`device` 等)不受影响。
|
|
97
98
|
|
|
98
|
-
港澳地区(HK/MO)下,Skills 市场云端命令(`skills list`/`find`/`add`)不可用;已安装 skills 为本地文件,不受影响。
|
|
99
|
-
|
|
100
99
|
## AI Agent 集成
|
|
101
100
|
|
|
102
101
|
### Agent 插件
|
|
@@ -131,7 +130,7 @@ devecocli init --agent atomcode
|
|
|
131
130
|
如果 `Agent` 不在 `--agent` 参数取值范围内,可使用 `--path` 参数进行添加,参考如下命令:
|
|
132
131
|
|
|
133
132
|
```bash
|
|
134
|
-
devecocli init --path D
|
|
133
|
+
devecocli init --path D:/work/ARKTS/NewData
|
|
135
134
|
```
|
|
136
135
|
|
|
137
136
|
进入 `Agent` 后可以直接描述任务,例如:
|
|
@@ -157,6 +156,7 @@ devecocli init --path D:\work\ARKTS\NewData
|
|
|
157
156
|
| `devecocli emulator list` | 查看本地模拟器实例 |
|
|
158
157
|
| `devecocli ui layout` | 导出设备屏幕上的 UI 节点树(布局、坐标、节点 ID) |
|
|
159
158
|
| `devecocli ui window list` | 查看设备窗口列表(为 `ui layout` / `ui click` 等提供窗口 ID) |
|
|
159
|
+
| `devecocli ui display list` | 查看设备显示器列表,输出显示器 ID 与分辨率(为 `ui screenshot --display` 等提供 display ID) |
|
|
160
160
|
| `devecocli ui screenshot` | 对真机或模拟器执行 UI 截图 |
|
|
161
161
|
| `devecocli ui click` | 点击指定坐标、节点 ID 或 Selector 定位的元素 |
|
|
162
162
|
| `devecocli ui swipe` | 自定义滑动(坐标模式或 `--start`/`--end` 元素模式) |
|
|
@@ -177,7 +177,7 @@ devecocli init --path D:\work\ARKTS\NewData
|
|
|
177
177
|
|
|
178
178
|
### `help`
|
|
179
179
|
|
|
180
|
-
|
|
180
|
+
查看版本、帮助信息以及子命令(下为节选)
|
|
181
181
|
|
|
182
182
|
**命令格式:**
|
|
183
183
|
|
|
@@ -186,7 +186,7 @@ devecocli help
|
|
|
186
186
|
```
|
|
187
187
|
|
|
188
188
|
```text
|
|
189
|
-
#
|
|
189
|
+
# 返回结果(节选)
|
|
190
190
|
Usage: devecocli [options] [command]
|
|
191
191
|
|
|
192
192
|
HarmonyOS application development command line tool
|
|
@@ -204,6 +204,7 @@ Commands:
|
|
|
204
204
|
auth Authentication commands (login, logout, status, team)
|
|
205
205
|
ui Inspect and interact with UI on a connected device
|
|
206
206
|
skills Manage HarmonyOS skills
|
|
207
|
+
plugin Manage whitelisted AI agent plugins
|
|
207
208
|
log [options] Obtain device application logs
|
|
208
209
|
verify [options] Run UI verification on a connected device
|
|
209
210
|
create [options] Scaffold a new HarmonyOS application project
|
|
@@ -212,6 +213,8 @@ Commands:
|
|
|
212
213
|
docs [options] Search and read HarmonyOS documentation from local docs directory
|
|
213
214
|
check Run DevEco project checks
|
|
214
215
|
signature Generate application signature
|
|
216
|
+
design2arkts [options] Resolve designs, manage Skills and export/import ArkUI pages
|
|
217
|
+
testing Run DevEco Testing CLI commands (arguments passed through as-is)
|
|
215
218
|
help [command] display help for command
|
|
216
219
|
```
|
|
217
220
|
|
|
@@ -252,23 +255,23 @@ devecocli init --agent <agents> --project <path> --path <path> --skill --mcp --w
|
|
|
252
255
|
devecocli init -f # 安装或更新全部内置 Skill
|
|
253
256
|
devecocli init --skill
|
|
254
257
|
devecocli init --agent agentname # agentname需替换为实际的智能体名称
|
|
255
|
-
devecocli init --path D
|
|
258
|
+
devecocli init --path D:/work/ARKTS/NewData -f
|
|
256
259
|
|
|
257
260
|
# 配置MCP
|
|
258
261
|
devecocli init --mcp
|
|
259
262
|
devecocli init --mcp --agent agentname # agentname需替换为实际的智能体名称
|
|
260
|
-
devecocli init --mcp --project D
|
|
263
|
+
devecocli init --mcp --project D:/work/ARKTS/NewData -f
|
|
261
264
|
devecocli init --mcp --with-homegraph
|
|
262
265
|
```
|
|
263
266
|
|
|
264
267
|
> MCP 配置支持 `opencode`、`pi`、`trae-cn`、`cursor`、`codebuddy`、`claude-code` 和 `codex`。
|
|
265
268
|
|
|
266
|
-
### Skill
|
|
269
|
+
### `init` 支持的 Skill 安装目标
|
|
267
270
|
|
|
268
|
-
支持以下
|
|
271
|
+
支持以下 51 个智能体。使用 `--agent` 指定名称,多个名称用英文逗号分隔。
|
|
269
272
|
|
|
270
273
|
`amp`、`antigravity`、`antigravity-cli`、`astrbot`、`atomcode`、`augment`、`bob`、`claude-code`、`cline`、`codearts-agent`、
|
|
271
|
-
`codebuddy`、`codex`、`continue`、`crush`、`cursor`、`deepagents`、`
|
|
274
|
+
`codebuddy`、`codex`、`continue`、`crush`、`cursor`、`deepagents`、`devin`、`droid`、`dsh`、
|
|
272
275
|
`gemini-cli`、`github-copilot`、`goose`、`grok`、`hermes-agent`、`iflow-cli`、`junie`、`kilo`、`kimi-code-cli`、`kiro-cli`、
|
|
273
276
|
`kode`、`lingma`、`minimax-code`、`mistral-vibe`、`neovate`、`ona`、`openclaw`、`opencode`、`openhands`、`pi`、
|
|
274
277
|
`qoder`、`qoder-cn`、`qwen-code`、`reasonix`、`replit`、`trae`、`trae-cn`、`universal`、`warp`、`windsurf`、
|
|
@@ -350,12 +353,12 @@ devecocli docs catalog --format json
|
|
|
350
353
|
|
|
351
354
|
### `create`
|
|
352
355
|
|
|
353
|
-
创建 HarmonyOS
|
|
356
|
+
创建 HarmonyOS 应用工程。内置 `empty-ability` 模板(默认)与 `native-cpp`(Native C++/NAPI)模板,可通过 `devecocli create list` 查看全部可用模板。
|
|
354
357
|
|
|
355
358
|
**命令格式:**
|
|
356
359
|
|
|
357
360
|
```bash
|
|
358
|
-
devecocli create --app-name <name> --project-path <path> --bundle-name <bundle> --api-level <level> --device-types <types...>
|
|
361
|
+
devecocli create --app-name <name> --project-path <path> --bundle-name <bundle> --api-level <level> --device-types <types...> --template <name>
|
|
359
362
|
```
|
|
360
363
|
|
|
361
364
|
**参数:**
|
|
@@ -365,8 +368,9 @@ devecocli create --app-name <name> --project-path <path> --bundle-name <bundle>
|
|
|
365
368
|
| --app-name | 必选,应用名称 |
|
|
366
369
|
| --project-path | 可选,工程路径,默认为:`./<appname>` |
|
|
367
370
|
| --bundle-name | 可选,包名,默认为:`com.example.<appname>` ,`appname` 自动转为小写 |
|
|
368
|
-
| --api-level | 可选,API级别,最小值为17
|
|
371
|
+
| --api-level | 可选,API级别,最小值为17;缺省时从安装的 `Deveco Studio` 的 `HarmonyOS` `SDK` 中自动获取,不可用时回退为 23 |
|
|
369
372
|
| --device-types | 可选,设备类型,可指定多个,写入 `module.json5` 的 `deviceTypes`,默认为 `phone`。支持 `phone`、`tablet`、`2in1`、`car`、`wearable`、`tv`;取值不在列表内时报错并列出全部合法值 |
|
|
373
|
+
| --template | 可选,工程模板逻辑名,默认为 `empty-ability`;`native-cpp` 生成含 C++/NAPI 源码(`entry/src/main/cpp/`)的工程。模板名不存在时报错并列出可用模板 |
|
|
370
374
|
|
|
371
375
|
**示例:**
|
|
372
376
|
|
|
@@ -376,8 +380,25 @@ devecocli create --project-path ./MyApp --app-name MyApp --bundle-name com.acme.
|
|
|
376
380
|
devecocli create --app-name MyApp
|
|
377
381
|
devecocli create --app-name MyApp --device-types tablet
|
|
378
382
|
devecocli create --app-name MyApp --device-types phone wearable
|
|
383
|
+
devecocli create --template native-cpp --app-name Shop
|
|
379
384
|
```
|
|
380
385
|
|
|
386
|
+
**子命令 `create list`:**
|
|
387
|
+
|
|
388
|
+
列出可用的工程模板。
|
|
389
|
+
|
|
390
|
+
```bash
|
|
391
|
+
devecocli create list
|
|
392
|
+
devecocli create list --format default
|
|
393
|
+
devecocli create list --format json
|
|
394
|
+
```
|
|
395
|
+
|
|
396
|
+
**参数:**
|
|
397
|
+
|
|
398
|
+
| 参数名 | 说明 |
|
|
399
|
+
| -------- | --------------------------------------------------------------------------------------------------------- |
|
|
400
|
+
| --format | 可选,`default` 输出 `Name`/`Description` 文本表格;`json` 输出可解析的 JSON 数组(字段:`name`、`bundleType`、`displayName`、`description`、`deviceTypes`) |
|
|
401
|
+
|
|
381
402
|
### `auth login`
|
|
382
403
|
|
|
383
404
|
登录华为开发者账号,打开浏览器完成授权。交互式终端会先等待按 Enter 再拉起浏览器;传入 `--no-prompt` 可跳过确认直接拉起浏览器(供 Agent / 非交互终端使用;stdin 不是 TTY 时自动跳过)。Agent 执行登录或安装时,沿用会话中已有的相应授权,仅在缺少授权时询问。登录已获授权时直接运行 `devecocli auth login --no-prompt`,不再要求用户手动执行命令;用户仍需在浏览器完成认证。
|
|
@@ -2060,6 +2081,40 @@ devecocli ui window list --all
|
|
|
2060
2081
|
- 聚焦窗口在 `default` 格式下高亮显示。
|
|
2061
2082
|
- 缺省时仅列出应用窗口;加 `--all` 可查看系统窗口,用于排查多窗口场景。
|
|
2062
2083
|
|
|
2084
|
+
### `ui display list`
|
|
2085
|
+
|
|
2086
|
+
查看设备上的显示器列表,输出显示器 ID、宽度和高度(单位 px)。为 `ui screenshot --display` 等命令提供 display ID,也用于确认多屏(投屏/扩展)场景下的各显示器分辨率。
|
|
2087
|
+
|
|
2088
|
+
**命令格式:**
|
|
2089
|
+
|
|
2090
|
+
```bash
|
|
2091
|
+
devecocli ui display list --device <name|serial> --format <fmt> --all
|
|
2092
|
+
```
|
|
2093
|
+
|
|
2094
|
+
**参数:**
|
|
2095
|
+
|
|
2096
|
+
| 参数名 | 说明 |
|
|
2097
|
+
| --- | --- |
|
|
2098
|
+
| --device \<name\|serial> | 目标设备,多设备时必填 |
|
|
2099
|
+
| --format | 输出格式,`default` 或 `json`,默认 `default` |
|
|
2100
|
+
| --all | 显示扩展信息:所属物理屏 ID、刷新率、虚拟像素比(VPR)、旋转角度 |
|
|
2101
|
+
|
|
2102
|
+
**示例:**
|
|
2103
|
+
|
|
2104
|
+
```bash
|
|
2105
|
+
devecocli ui display list
|
|
2106
|
+
devecocli ui display list --device Phone
|
|
2107
|
+
devecocli ui display list --format json
|
|
2108
|
+
devecocli ui display list --all
|
|
2109
|
+
```
|
|
2110
|
+
|
|
2111
|
+
**说明:**
|
|
2112
|
+
|
|
2113
|
+
- 数据来自 `hidumper -s DisplayManagerService -a -a`。
|
|
2114
|
+
- 缺省输出三列:Id、Width、Height;加 `--all` 追加 ScreenId、RefreshRate、Vpr、Rotation 列。
|
|
2115
|
+
- 扩展信息优先取 display 段内的 Client Screen Infos,段内未包含时回退到所属物理屏(Screen)会话;Rotation 为屏幕已应用的旋转角度(0/90/180/270,顺时针,与旋转后的宽高配套),不是设备传感器的原始姿态。
|
|
2116
|
+
- 扩展字段设备未上报时,表格显示 `-`,`--format json --all` 输出 `null`。
|
|
2117
|
+
|
|
2063
2118
|
### `run`
|
|
2064
2119
|
|
|
2065
2120
|
构建应用后,将应用安装到真机设备或模拟器上,并启动执行
|
|
@@ -2108,6 +2163,79 @@ devecocli run --module entry --hotreload-apply changes.txt
|
|
|
2108
2163
|
- 无可启动的 `Ability`,或使用 `--hotreload` / `--hotreload-apply` 时,跳过冒烟检查。
|
|
2109
2164
|
- 冒烟检查取证前默认等待 `3000` 毫秒(供应用完成冷启动),可通过环境变量 `DEVECO_CLI_SMOKE_WAIT_MS`(毫秒)调整:设为 `0` 立即取证;冷启动较慢的设备可适当调大以避免误报。
|
|
2110
2165
|
|
|
2166
|
+
### `debug`
|
|
2167
|
+
|
|
2168
|
+
ArkTS 调试器(断点、日志断点、变量读写、事件流),经 `hdc fport` + CDP 直连设备,无需 IDE。
|
|
2169
|
+
|
|
2170
|
+
**命令格式:**
|
|
2171
|
+
|
|
2172
|
+
```bash
|
|
2173
|
+
devecocli debug start [-b <bundle>] [--module <name>] [--ability <name>] [--product <p>] [--device <name|serial>] [--stop-at-entry] [--skip-build] [--logpath <file>] [--json]
|
|
2174
|
+
devecocli debug attach -b <bundle> [--pid <n>] [--module <name>] [--device <name|serial>] [--logpath <file>] [--json]
|
|
2175
|
+
devecocli debug status [--json]
|
|
2176
|
+
devecocli debug stop [--session <sN>] [--json]
|
|
2177
|
+
devecocli debug bp add --path <file> --line <n> [--column <c>] [--condition <expr>] [--hit-count <N|=N|>=N|<=N|%N>] [--log <expr>] [--level <debug|info|warn|error>] [--disabled] [--session <sN>] [--json]
|
|
2178
|
+
devecocli debug bp remove (--id <bpId> | --path <file> [--line <n>] | --all [--kind <breakpoint|logpoint|all>]) [--json]
|
|
2179
|
+
devecocli debug bp list [--kind <breakpoint|logpoint|all>] [--session <sN>] [--json]
|
|
2180
|
+
devecocli debug bp enable | disable (--id <bpId> | --path <file> --line <n> | --all) [--json]
|
|
2181
|
+
devecocli debug resume [--thread <main|workerThread_<tid>|instanceId|all>] [--session <sN>] [--json]
|
|
2182
|
+
devecocli debug pause [--thread <id|name>] [--session <sN>] [--json]
|
|
2183
|
+
devecocli debug step [--into | --over | --out] [--thread <id|name>] [--session <sN>] [--json]
|
|
2184
|
+
devecocli debug stack [--frame <N>] [--max <N>] [--thread <id|name>] [--session <sN>] [--json]
|
|
2185
|
+
devecocli debug vars [--name <varPath>] [--frame <N>] [--thread <id|name>] [--session <sN>] [--json]
|
|
2186
|
+
devecocli debug eval <expr> [--frame <N>] [--thread <id|name>] [--session <sN>] [--json]
|
|
2187
|
+
devecocli debug set --name <var> --value <expr> [--frame <N>] [--thread <id|name>] [--session <sN>] [--json]
|
|
2188
|
+
devecocli debug events [--follow] [--filter <type[:level][,type[:level]]>] [--session <sN>] [--json]
|
|
2189
|
+
```
|
|
2190
|
+
|
|
2191
|
+
**参数:**
|
|
2192
|
+
|
|
2193
|
+
| 参数 | 说明 |
|
|
2194
|
+
| ------------------------- | ----------------------------------------------------- |
|
|
2195
|
+
| `-b, --bundle <bundle>` | `start` 缺省从工程推导,`attach` 必填 |
|
|
2196
|
+
| `--device <name\|serial>` | 设备名或序列号;多设备时必填,缺失报错并列出设备 |
|
|
2197
|
+
| `--stop-at-entry` | 等待入口暂停,`resume` 依次放行。等待超时返回 `TIMEOUT`,调试连接断开时返回 `CDP_ERROR`。 |
|
|
2198
|
+
| `--skip-build` | 跳过编译,直接安装上次 debug 产物 |
|
|
2199
|
+
| `--logpath <file>` | 事件 NDJSON 追加落盘,CLI 退出后仍持续写入 |
|
|
2200
|
+
| `--session <sN>` | 会话 id;单会话可省略,多会话未指定报 `MULTI_SESSION` |
|
|
2201
|
+
| `--thread <id\|name>` | 主线程 / Worker / TaskPool 线程目标 |
|
|
2202
|
+
| `--json` | 单行紧凑 JSON 输出(`events --follow` 为 NDJSON 流) |
|
|
2203
|
+
|
|
2204
|
+
**子命令:**
|
|
2205
|
+
|
|
2206
|
+
| 子命令 | 说明 |
|
|
2207
|
+
| ------------------------------------- | ---------------------------------------------------------------------------------------- |
|
|
2208
|
+
| `start` | 构建 → 安装 → 拉起应用并建立调试会话 |
|
|
2209
|
+
| `attach` | 直挂已运行的应用(`--pid` 或自动解析),不重新构建 |
|
|
2210
|
+
| `status` | 查看守护进程、会话、线程与暂停位置 |
|
|
2211
|
+
| `stop` | 结束会话并清理端口转发;应用进程继续运行 |
|
|
2212
|
+
| `bp add` | 按源码位置下断点;`--log` 不中断日志断点、`--condition` 条件放行、`--hit-count` 计数触发 |
|
|
2213
|
+
| `bp remove / list / enable / disable` | 删除(`--id`/`--path`/`--all`)、列表、停用与恢复断点 |
|
|
2214
|
+
| `resume / pause / step` | 放行全部线程、暂停、单步(into / over / out) |
|
|
2215
|
+
| `stack / vars / eval / set` | 暂停态查看调用栈、变量、求值与写回 |
|
|
2216
|
+
| `events` | 事件流;`--follow` 实时输出,`--filter` 按类型与级别过滤 |
|
|
2217
|
+
|
|
2218
|
+
**示例:**
|
|
2219
|
+
|
|
2220
|
+
```bash
|
|
2221
|
+
devecocli debug start --stop-at-entry --json # 构建+安装+入口暂停(AI 须走 Start-Process 封装,见说明)
|
|
2222
|
+
devecocli debug resume # 放行启动停靠
|
|
2223
|
+
devecocli debug bp add --path entry/src/main/ets/pages/Index.ets --line 30
|
|
2224
|
+
devecocli debug bp add --path entry/src/main/ets/pages/Index.ets --line 25 --log count --hit-count ">=3" # 不中断日志断点
|
|
2225
|
+
devecocli debug events --follow --filter logpoint # 背景作业方式运行,见说明
|
|
2226
|
+
devecocli debug stack --json # 命中后查看调用栈
|
|
2227
|
+
devecocli debug vars --frame 0 --json # 查看当前帧变量
|
|
2228
|
+
devecocli debug resume # 放行继续
|
|
2229
|
+
devecocli debug stop --json # 结束会话(应用进程继续运行)
|
|
2230
|
+
```
|
|
2231
|
+
|
|
2232
|
+
**说明:**
|
|
2233
|
+
|
|
2234
|
+
- 所有命令经单个全局后台守护进程中转(首条调试命令自动拉起,30 分钟无活动且无会话自动退出);同一 bundle 同时只允许一个会话,与 IDE 调试互斥。
|
|
2235
|
+
- **AI/自动化代理禁止直接执行会拉起守护进程的调试命令**(守护进程继承控制台句柄会使外层 shell 永不返回),须用 `Start-Process` 文件重定向封装并轮询输出;`events --follow` 为持续流,同样只能背景作业运行。详见 `SKILL.md`。
|
|
2236
|
+
- 真机 VM 限制:`Debugger.evaluateOnCallFrame` 仅解析简单标识符;点路径表达式(`this.message`)由守护进程经属性链补齐,`@State` 变量自动解包,运算/调用/下标仍返回 `undefined`。详见 `SKILL.md`。
|
|
2237
|
+
- 失败统一 `{"ok":false,"error":{"code","message"}}` 且退出码 1;RPC 明细记录在守护进程目录 `daemon.log`,原始 CDP 帧可经 `DEBUG_FRAME_LOG=<file>` 环境变量开启落盘。
|
|
2238
|
+
|
|
2111
2239
|
### `log`
|
|
2112
2240
|
|
|
2113
2241
|
查看`hilog`普通日志或崩溃日志,或对本地故障日志/采样栈文件做结构化分析
|
|
@@ -2470,9 +2598,9 @@ devecocli skills remove --skill skillname --agent agentname # skillname需替
|
|
|
2470
2598
|
|
|
2471
2599
|
管理白名单内的 AI 智能体插件。插件以 npm 包形式分发,版本取白名单 `npmPackage` 坐标上可选 `@tag` 后缀指定的 dist-tag(如 `@scope/pkg@cli` 用 `cli` 标签;未写后缀默认 `latest`),CLI 负责白名单校验、包下载与完整性校验、契约加载和生命周期编排;安装、卸载、更新的具体行为完全由各插件的 `install` / `uninstall` / `update` hook 定义。
|
|
2472
2600
|
|
|
2473
|
-
**CLI 不保存任何安装状态**:`<数据目录>/plugins/store/<插件名>/<版本>/`
|
|
2601
|
+
**CLI 不保存任何安装状态**:`<数据目录>/plugins/store/<插件名>/<版本>/` 中的包缓存是唯一状态。install/update 每次都会重新执行 hook(幂等性由插件保证);`plugin uninstall` 不会删除包缓存(`<数据目录>/plugins/store/<插件名>/`)与插件私有数据(`<数据目录>/plugins/data/<插件名>/`),需要清理时请手动删除。
|
|
2474
2602
|
|
|
2475
|
-
- `plugin list [-l|--long]
|
|
2603
|
+
- `plugin list [-l|--long]`:按白名单顺序列出插件名称(每行一个,与 `skills list` 一致);`--long` 追加插件描述。
|
|
2476
2604
|
- `plugin install <name> [--agent <a,b…>] [--project <path>] [-f|--force]`:下载最新包后,对"检测到的智能体 ∩ 插件支持的智能体"逐个执行 `install` hook;`--force` 先用本地最高旧版本执行 `uninstall` hook。目标全部失败时回滚删除本次新建的版本目录。显式 `--agent` + `--project` 时与 `init --project --agent` 一致——缺失的目标 skills 目录(含 `.<agent>` 根目录)会在 hook 前自动创建。
|
|
2477
2605
|
- `plugin update <name> [--agent <a,b…>] [--project <path>]`:拉取最新版本并执行 `update` hook(携带 `from`/`to`,`from` 为下载前快照的最高版本;`from === to` 表示无本地版本或最新版已缓存,按修复/补装处理,不要求本地已有版本);显式 `--agent` + `--project` 时与 install 一致,缺失的目标 skills 目录(含 `.<agent>` 根目录)会在 hook 前自动创建。
|
|
2478
2606
|
- `plugin uninstall <name> [--agent <a,b…>] [--project <path>]`:以本地最高可加载版本执行 `uninstall` hook。
|
|
@@ -2496,7 +2624,7 @@ devecocli plugin uninstall <name> --agent <agents> --project <path>
|
|
|
2496
2624
|
| --agent | 可选,智能体名称,多个以英文逗号分隔;缺省时对检测到的全部智能体中受支持者执行 |
|
|
2497
2625
|
| --project | 可选,工程根目录,切换到项目作用域;相对路径按当前目录解析 |
|
|
2498
2626
|
| --force | 可选(仅 install),先执行旧版本的 uninstall hook 再安装 |
|
|
2499
|
-
| --long | 可选(仅 list
|
|
2627
|
+
| --long | 可选(仅 list),追加显示插件描述,默认每行一个插件名 |
|
|
2500
2628
|
|
|
2501
2629
|
**示例:**
|
|
2502
2630
|
|
|
@@ -2527,7 +2655,7 @@ devecocli plugin install example-plugin --agent opencode --project ./my-app
|
|
|
2527
2655
|
"DEVECO_CLI_CPP_ENABLED": "true", // 可选,是否启用C++ LSP服务,默认为true,设为false可关闭
|
|
2528
2656
|
"DEVECO_CLI_CPP_COMPILE_COMMANDS": "{workspace}/compile_commands.json" // 可选,自定义compile_commands.json路径,指定后跳过compileNative同步,直接复用该编译数据库。{workspace}占位符替换为工程根,多工程可共用同一份配置;文件缺失/非法时回退默认同步流程
|
|
2529
2657
|
},
|
|
2530
|
-
"
|
|
2658
|
+
"enabled": true
|
|
2531
2659
|
}
|
|
2532
2660
|
}
|
|
2533
2661
|
}
|
|
@@ -2720,13 +2848,15 @@ devecocli signature generate --help
|
|
|
2720
2848
|
|
|
2721
2849
|
```bash
|
|
2722
2850
|
npm install
|
|
2723
|
-
npm run dev
|
|
2724
|
-
npm start -- <command>
|
|
2851
|
+
npm run dev -w packages/cli
|
|
2852
|
+
npm start -w packages/cli -- <command>
|
|
2725
2853
|
npm run lint
|
|
2726
2854
|
npm run format
|
|
2727
2855
|
npm run build
|
|
2728
2856
|
```
|
|
2729
2857
|
|
|
2858
|
+
- `dev` / `start` 脚本仅定义在 `packages/cli`,从仓库根目录运行时需加 `-w packages/cli`。
|
|
2859
|
+
- 首次运行依赖内置 Skill 的源码命令前,先执行 `npm run build` 生成内置 Skill。
|
|
2730
2860
|
- 架构与目录说明见 [`AGENTS.md`](./AGENTS.md)
|
|
2731
2861
|
- 如需参与维护,建议先阅读 `AGENTS.md` 中的约定与架构说明
|
|
2732
2862
|
|
package/THIRD-PARTY-LICENSES
CHANGED
|
@@ -1,10 +1,39 @@
|
|
|
1
1
|
This file was generated with the generate-license-file npm package!
|
|
2
2
|
https://www.npmjs.com/package/generate-license-file
|
|
3
3
|
|
|
4
|
+
The following npm package may be included in this product:
|
|
5
|
+
|
|
6
|
+
- ws@8.21.1
|
|
7
|
+
|
|
8
|
+
This package contains the following license:
|
|
9
|
+
|
|
10
|
+
Copyright (c) 2011 Einar Otto Stangvik <einaros@gmail.com>
|
|
11
|
+
Copyright (c) 2013 Arnout Kazemier and contributors
|
|
12
|
+
Copyright (c) 2016 Luigi Pinca and contributors
|
|
13
|
+
|
|
14
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
15
|
+
this software and associated documentation files (the "Software"), to deal in
|
|
16
|
+
the Software without restriction, including without limitation the rights to
|
|
17
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
18
|
+
the Software, and to permit persons to whom the Software is furnished to do so,
|
|
19
|
+
subject to the following conditions:
|
|
20
|
+
|
|
21
|
+
The above copyright notice and this permission notice shall be included in all
|
|
22
|
+
copies or substantial portions of the Software.
|
|
23
|
+
|
|
24
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
25
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
26
|
+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
27
|
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
28
|
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
29
|
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
30
|
+
|
|
31
|
+
-----------
|
|
32
|
+
|
|
4
33
|
The following npm packages may be included in this product:
|
|
5
34
|
|
|
6
|
-
- @deveco-test/deveco-cli-knowledgebase@1.3.
|
|
7
|
-
- @deveco-test/deveco-cli@1.3.
|
|
35
|
+
- @deveco-test/deveco-cli-knowledgebase@1.3.12-Test.2
|
|
36
|
+
- @deveco-test/deveco-cli@1.3.12-Test.2
|
|
8
37
|
|
|
9
38
|
These packages each contain the following license:
|
|
10
39
|
|
|
@@ -44,7 +73,7 @@ SOFTWARE.
|
|
|
44
73
|
|
|
45
74
|
The following npm package may be included in this product:
|
|
46
75
|
|
|
47
|
-
- @deveco-test/deveco-cli-common@1.3.
|
|
76
|
+
- @deveco-test/deveco-cli-common@1.3.12-Test.2
|
|
48
77
|
|
|
49
78
|
This package contains the following license:
|
|
50
79
|
|