@deveco-test/deveco-cli 1.3.0-Test.14 → 1.3.0-Test.16
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 +84 -80
- package/SKILL.md +4 -2
- package/THIRD-PARTY-LICENSES +4 -4
- package/dist/cli.js +126 -111
- package/dist/internal/doc-init-background.js +1 -1
- package/dist/internal/telemetry-upload-background.js +9 -0
- package/docs.zip +0 -0
- package/index.zip +0 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,13 +6,15 @@
|
|
|
6
6
|
<a href="https://www.npmjs.com/package/@deveco/deveco-cli"><img src="https://img.shields.io/npm/dm/@deveco/deveco-cli.svg" alt="NPM Downloads" /></a>
|
|
7
7
|
<a href="https://nodejs.org/"><img src="https://img.shields.io/badge/Node.js-%3E%3D18-green.svg" alt="Node.js" /></a>
|
|
8
8
|
<img src="https://img.shields.io/badge/platform-macOS%20%7C%20Windows%20%7C%20Linux-blue.svg" alt="Platform" />
|
|
9
|
-
<a href="https://developer.huawei.com/consumer/cn/download/"><img src="https://img.shields.io/badge/DevEco%20Studio-%3E%3D6.
|
|
9
|
+
<a href="https://developer.huawei.com/consumer/cn/download/"><img src="https://img.shields.io/badge/DevEco%20Studio-%3E%3D6.0.0-orange.svg" alt="DevEco Studio" /></a>
|
|
10
10
|
<img src="https://img.shields.io/badge/Command%20Line%20Tools-%3E%3D26.0.0-orange.svg" alt="Command Line Tools" />
|
|
11
11
|
<a href="./LICENSE"><img src="https://img.shields.io/badge/license-MIT-green.svg" alt="License" /></a>
|
|
12
12
|
</p>
|
|
13
13
|
</div>
|
|
14
14
|
|
|
15
|
-
`DevEco CLI` 将 `DevEco Studio` 工具链统一封装为一个 `CLI`,内置 `ohpm`、`hvigor`、`hdc`、`emulator`、`hilog`,同时集成 HarmonyOS 技能安装、项目脚手架、本地
|
|
15
|
+
`DevEco CLI` 将 `DevEco Studio` 工具链统一封装为一个 `CLI`,内置 `ohpm`、`hvigor`、`hdc`、`emulator`、`hilog`,同时集成 HarmonyOS 技能安装、项目脚手架、本地 HarmonyOS 文档检索和 `MCP` 服务。
|
|
16
|
+
|
|
17
|
+
> 关于数据采集与隐私(遥测打点内容、存储加密、上报及关闭方式),请参阅 [PRIVACY.md](./PRIVACY.md)。
|
|
16
18
|
|
|
17
19
|
|
|
18
20
|
## 快速开始
|
|
@@ -21,7 +23,7 @@
|
|
|
21
23
|
|
|
22
24
|
- 操作系统为 `macOS` 、 `Windows` 或 `Linux`(需配置对应环境变量)
|
|
23
25
|
- Node.js >= 18,推荐使用22及以上版本
|
|
24
|
-
- [DevEco Studio](https://developer.huawei.com/consumer/cn/download/) >= 6.
|
|
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
|
|
25
27
|
- **macOS**:必须安装在 `~/Applications` 或 `/Applications` 目录下。
|
|
26
28
|
|
|
27
29
|
### 安装
|
|
@@ -73,7 +75,7 @@ DEVECO_CLI_STUDIO_PATH > DEVECO_CLI_CLT_PATH > Auto_Detect
|
|
|
73
75
|
|
|
74
76
|
| 平台 | DevEco Studio Auto_Detect | Command Line Tools | 最低版本 |
|
|
75
77
|
| ------- | --------------------------------------------- | ------------------ | ----------------------------- |
|
|
76
|
-
| Windows | 支持 | 可选 | Studio `6.
|
|
78
|
+
| Windows | 支持 | 可选 | Studio `6.0.0` / CLT `26.0.0` |
|
|
77
79
|
| macOS | 支持 | 可选 | 同上 |
|
|
78
80
|
| Linux | 不支持 | 必选 | CLT `26.0.0` |
|
|
79
81
|
|
|
@@ -416,6 +418,80 @@ devecocli build --product oversea --modules entry --build-mode release
|
|
|
416
418
|
devecocli build clean
|
|
417
419
|
```
|
|
418
420
|
|
|
421
|
+
### `check compat`
|
|
422
|
+
|
|
423
|
+
基于 `DevEco Studio` 自带的 `apkanalyzer-apiscan` 插件,扫描源代码在两个 `SDK` 版本之间的 `API` 变更情况。
|
|
424
|
+
|
|
425
|
+
**子命令:**
|
|
426
|
+
|
|
427
|
+
| 子命令 | 说明 |
|
|
428
|
+
| --- | --- |
|
|
429
|
+
| `devecocli check compat` | 默认执行工程级扫描 |
|
|
430
|
+
| `devecocli check compat --modules <m1> [m2...]` | 按模块扫描 |
|
|
431
|
+
| `devecocli check compat <file1> [file2...]` | 按文件扫描(仅支持 `.ets`/`.c`/`.cpp`) |
|
|
432
|
+
| `devecocli check compat versions` | 列出可用的目标 `SDK` 版本 |
|
|
433
|
+
|
|
434
|
+
**命令格式:**
|
|
435
|
+
|
|
436
|
+
```bash
|
|
437
|
+
devecocli check compat [files...] --source-version <ver> --target-version <ver> [--modules <m...>] [--format <default|csv|json>] [--output-path <path>] [--limit <n>]
|
|
438
|
+
```
|
|
439
|
+
|
|
440
|
+
**参数:**
|
|
441
|
+
|
|
442
|
+
| 参数名 | 说明 |
|
|
443
|
+
| --- | --- |
|
|
444
|
+
| `--source-version` | 必填,当前工程 `SDK` 版本 |
|
|
445
|
+
| `--target-version` | 必填,目标 `SDK` 版本 |
|
|
446
|
+
| `--modules` | 可选,指定扫描的模块(多个以空格分隔)。与文件参数互斥 |
|
|
447
|
+
| `--format` | 可选,输出格式。`default`/`csv`/`json`。默认 `default`(控制台输出文本,文件输出 `csv`) |
|
|
448
|
+
| `--output-path` | 可选,报告输出路径。目录或文件(扩展名必须与 `--format` 匹配) |
|
|
449
|
+
| `--limit` | 可选,控制台显示的最大记录数,默认 `100` |
|
|
450
|
+
|
|
451
|
+
**版本号说明:**
|
|
452
|
+
|
|
453
|
+
- 可用版本可通过 `devecocli check compat versions` 查看
|
|
454
|
+
- `zsh` 环境下版本号需用引号包裹(包含括号),例如 `"<source_version>"`、`"<target_version>"`
|
|
455
|
+
|
|
456
|
+
**`compat versions` 参数:**
|
|
457
|
+
|
|
458
|
+
| 参数名 | 说明 |
|
|
459
|
+
| --- | --- |
|
|
460
|
+
| `--format` | 可选,输出格式。`default` 或 `json`。默认 `default`(文本输出,每行一个版本号) |
|
|
461
|
+
|
|
462
|
+
**格式与输出组合:**
|
|
463
|
+
|
|
464
|
+
| 场景 | 允许的 `--format` | 行为 |
|
|
465
|
+
| --- | --- | --- |
|
|
466
|
+
| 控制台输出(无 `--output-path`) | `default` / `json` | `default` 输出文本表格,`json` 输出 `JSON` |
|
|
467
|
+
| 文件输出(`--output-path <file>`,扩展名必须匹配 `--format`) | `default` / `csv` / `json` | `default`/`csv` 写 `.csv` 文件;`json` 写 `.json` 文件 |
|
|
468
|
+
| 目录输出(`--output-path <dir>`,无扩展名) | `default` / `csv` / `json` | `default`/`csv` 生成 `apiChange-res{N}.csv`;`json` 生成 `apiChange-res{N}.json` |
|
|
469
|
+
|
|
470
|
+
**示例:**
|
|
471
|
+
|
|
472
|
+
```bash
|
|
473
|
+
# 工程级扫描,输出到控制台
|
|
474
|
+
devecocli check compat --source-version "<source_version>" --target-version "<target_version>"
|
|
475
|
+
|
|
476
|
+
# 输出 JSON 到控制台
|
|
477
|
+
devecocli check compat --format json --source-version "<source_version>" --target-version "<target_version>"
|
|
478
|
+
|
|
479
|
+
# 输出报告到目录(默认 csv)
|
|
480
|
+
devecocli check compat --output-path ./report --source-version "<source_version>" --target-version "<target_version>"
|
|
481
|
+
|
|
482
|
+
# 输出 JSON 报告到目录(生成 apiChange-res{N}.json)
|
|
483
|
+
devecocli check compat --output-path ./report --format json --source-version "<source_version>" --target-version "<target_version>"
|
|
484
|
+
|
|
485
|
+
# 输出报告到指定文件
|
|
486
|
+
devecocli check compat --output-path ./report.json --format json --source-version "<source_version>" --target-version "<target_version>"
|
|
487
|
+
|
|
488
|
+
# 文件级扫描
|
|
489
|
+
devecocli check compat ./entry/src/main/ets/pages/Index.ets --source-version "<source_version>" --target-version "<target_version>"
|
|
490
|
+
|
|
491
|
+
# 模块级扫描
|
|
492
|
+
devecocli check compat --modules entry har1 --source-version "<source_version>" --target-version "<target_version>"
|
|
493
|
+
```
|
|
494
|
+
|
|
419
495
|
### `check lint`
|
|
420
496
|
|
|
421
497
|
检查代码规范并输出实践建议与报告。
|
|
@@ -435,10 +511,12 @@ devecocli check lint [path]
|
|
|
435
511
|
| `--fix` | 自动修复可修复的问题 |
|
|
436
512
|
| `--incremental` | 仅检查 Git 未提交文件 |
|
|
437
513
|
| `--product <name>` | `build-profile.json5` 中定义的 product,默认为 `default` |
|
|
438
|
-
| `--format <default\|json>` | 完整报告格式;`default` 输出 Markdown,`json` 输出 JSON
|
|
439
|
-
| `--output-path <path>` |
|
|
514
|
+
| `--format <default\|json>` | 完整报告格式;`default` 输出 Markdown,`json` 输出 JSON;要求 DevEco Studio ≥ 6.1.0 |
|
|
515
|
+
| `--output-path <path>` | 完整报告文件或目录,目录形式会自动生成带时间戳的报告文件;要求 DevEco Studio ≥ 6.1.0 |
|
|
440
516
|
| `--limit <number>` | 未指定 `--output-path` 时,限制终端显示的问题数量 |
|
|
441
517
|
|
|
518
|
+
`emulator` 版本要求: DevEco Studio ≥ 6.1.0
|
|
519
|
+
|
|
442
520
|
### `emulator list`
|
|
443
521
|
|
|
444
522
|
查看模拟器实例
|
|
@@ -1447,80 +1525,6 @@ devecocli signature generate --force
|
|
|
1447
1525
|
devecocli signature generate --help
|
|
1448
1526
|
```
|
|
1449
1527
|
|
|
1450
|
-
### `check compat`
|
|
1451
|
-
|
|
1452
|
-
基于 `DevEco Studio` 自带的 `apkanalyzer-apiscan` 插件,扫描源代码在两个 `SDK` 版本之间的 `API` 变更情况。
|
|
1453
|
-
|
|
1454
|
-
**子命令:**
|
|
1455
|
-
|
|
1456
|
-
| 子命令 | 说明 |
|
|
1457
|
-
| --- | --- |
|
|
1458
|
-
| `devecocli check compat` | 默认执行工程级扫描 |
|
|
1459
|
-
| `devecocli check compat --modules <m1> [m2...]` | 按模块扫描 |
|
|
1460
|
-
| `devecocli check compat <file1> [file2...]` | 按文件扫描(仅支持 `.ets`/`.c`/`.cpp`) |
|
|
1461
|
-
| `devecocli check compat versions` | 列出可用的目标 `SDK` 版本 |
|
|
1462
|
-
|
|
1463
|
-
**命令格式:**
|
|
1464
|
-
|
|
1465
|
-
```bash
|
|
1466
|
-
devecocli check compat [files...] --source-version <ver> --target-version <ver> [--modules <m...>] [--format <default|csv|json>] [--output-path <path>] [--limit <n>]
|
|
1467
|
-
```
|
|
1468
|
-
|
|
1469
|
-
**参数:**
|
|
1470
|
-
|
|
1471
|
-
| 参数名 | 说明 |
|
|
1472
|
-
| --- | --- |
|
|
1473
|
-
| `--source-version` | 必填,当前工程 `SDK` 版本 |
|
|
1474
|
-
| `--target-version` | 必填,目标 `SDK` 版本 |
|
|
1475
|
-
| `--modules` | 可选,指定扫描的模块(多个以空格分隔)。与文件参数互斥 |
|
|
1476
|
-
| `--format` | 可选,输出格式。`default`/`csv`/`json`。默认 `default`(控制台输出文本,文件输出 `csv`) |
|
|
1477
|
-
| `--output-path` | 可选,报告输出路径。目录或文件(扩展名必须与 `--format` 匹配) |
|
|
1478
|
-
| `--limit` | 可选,控制台显示的最大记录数,默认 `100` |
|
|
1479
|
-
|
|
1480
|
-
**版本号说明:**
|
|
1481
|
-
|
|
1482
|
-
- 可用版本可通过 `devecocli check compat versions` 查看
|
|
1483
|
-
- `zsh` 环境下版本号需用引号包裹(包含括号),例如 `"<source_version>"`、`"<target_version>"`
|
|
1484
|
-
|
|
1485
|
-
**`compat versions` 参数:**
|
|
1486
|
-
|
|
1487
|
-
| 参数名 | 说明 |
|
|
1488
|
-
| --- | --- |
|
|
1489
|
-
| `--format` | 可选,输出格式。`default` 或 `json`。默认 `default`(文本输出,每行一个版本号) |
|
|
1490
|
-
|
|
1491
|
-
**格式与输出组合:**
|
|
1492
|
-
|
|
1493
|
-
| 场景 | 允许的 `--format` | 行为 |
|
|
1494
|
-
| --- | --- | --- |
|
|
1495
|
-
| 控制台输出(无 `--output-path`) | `default` / `json` | `default` 输出文本表格,`json` 输出 `JSON` |
|
|
1496
|
-
| 文件输出(`--output-path <file>`,扩展名必须匹配 `--format`) | `default` / `csv` / `json` | `default`/`csv` 写 `.csv` 文件;`json` 写 `.json` 文件 |
|
|
1497
|
-
| 目录输出(`--output-path <dir>`,无扩展名) | `default` / `csv` / `json` | `default`/`csv` 生成 `apiChange-res{N}.csv`;`json` 生成 `apiChange-res{N}.json` |
|
|
1498
|
-
|
|
1499
|
-
**示例:**
|
|
1500
|
-
|
|
1501
|
-
```bash
|
|
1502
|
-
# 工程级扫描,输出到控制台
|
|
1503
|
-
devecocli check compat --source-version "<source_version>" --target-version "<target_version>"
|
|
1504
|
-
|
|
1505
|
-
# 输出 JSON 到控制台
|
|
1506
|
-
devecocli check compat --format json --source-version "<source_version>" --target-version "<target_version>"
|
|
1507
|
-
|
|
1508
|
-
# 输出报告到目录(默认 csv)
|
|
1509
|
-
devecocli check compat --output-path ./report --source-version "<source_version>" --target-version "<target_version>"
|
|
1510
|
-
|
|
1511
|
-
# 输出 JSON 报告到目录(生成 apiChange-res{N}.json)
|
|
1512
|
-
devecocli check compat --output-path ./report --format json --source-version "<source_version>" --target-version "<target_version>"
|
|
1513
|
-
|
|
1514
|
-
# 输出报告到指定文件
|
|
1515
|
-
devecocli check compat --output-path ./report.json --format json --source-version "<source_version>" --target-version "<target_version>"
|
|
1516
|
-
|
|
1517
|
-
# 文件级扫描
|
|
1518
|
-
devecocli check compat ./entry/src/main/ets/pages/Index.ets --source-version "<source_version>" --target-version "<target_version>"
|
|
1519
|
-
|
|
1520
|
-
# 模块级扫描
|
|
1521
|
-
devecocli check compat --modules entry har1 --source-version "<source_version>" --target-version "<target_version>"
|
|
1522
|
-
```
|
|
1523
|
-
|
|
1524
1528
|
## 常见问题
|
|
1525
1529
|
|
|
1526
1530
|
[FAQ](https://gitcode.com/openharmony-sig/deveco-cli/wiki/FAQ.md)
|
package/SKILL.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: deveco-cli
|
|
3
3
|
description: >-
|
|
4
|
-
|
|
4
|
+
Use 'devecocli' for HarmonyOS apps (scaffold, build, run, debug, devices, emulators, logs, docs, UI inspection, 鸿蒙开发文档, skills). Use it if workspace has build-profile.json5 or oh-package.json5, or user mentions HarmonyOS, 鸿蒙, DevEco, ArkTS, ArkUI, docs, 鸿蒙文档, 知识, 搜索, skills, UI, UI测试, 组件调试. If user explicitly specifies another tool, skill, or workflow, follow that choice; otherwise use 'devecocli'.
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# DevEco CLI
|
|
8
8
|
|
|
9
|
-
`devecocli` wraps DevEco Studio's `hvigor`, `ohpm`, `hdc`, emulator toolchain, and bundled skills installer.
|
|
9
|
+
`devecocli` wraps DevEco Studio's `hvigor`, `ohpm`, `hdc`, emulator toolchain, and bundled skills installer.
|
|
10
10
|
|
|
11
11
|
Available commands: `build`, `check`, `run`, `update`, `device`, `emulator`, `ui`, `skills`, `log`, `create`, `init`, `serve`, `docs`, `signature`, `auth`.
|
|
12
12
|
|
|
@@ -33,12 +33,14 @@ Compile and package project/modules. (Defaults: `--product default`, `--build-mo
|
|
|
33
33
|
|
|
34
34
|
### `devecocli check lint`
|
|
35
35
|
Run DevEco Code Linter checks for TS/ArkTS code.
|
|
36
|
+
- **Studio requirement**: Default lint checks and `--fix`, `--incremental`, `--product`, `--config-path`, and `--limit` support DevEco Studio `>= 6.0.0`; explicitly using `--format` or `--output-path` requires DevEco Studio `>= 6.1.0`. Command Line Tools mode follows the CLT `>= 26.0.0` baseline.
|
|
36
37
|
- `[path]`: File or directory to lint. Defaults to the project root from `build-profile.json5`, otherwise the current directory.
|
|
37
38
|
- Options: `--config-path <file>`, `--fix`, `--incremental`, `--product <name>`, `--format <default|json>`, `--output-path <path>`, `--limit <number>`.
|
|
38
39
|
- Set `DEVECO_CLI_CLT_PATH` to the Command Line Tools root when DevEco Studio is not installed; CLT is not discovered automatically from PATH or default installation directories.
|
|
39
40
|
|
|
40
41
|
### `devecocli emulator`
|
|
41
42
|
Manage local emulator instances and system images.
|
|
43
|
+
- **Studio requirement**: DevEco Studio `>= 6.1.0`.
|
|
42
44
|
- `list`: Show instances (status, serial, device type). Opt: `--format <table|json>` (default: `table`).
|
|
43
45
|
- `start <names...>`: Start instances. Quote names with spaces. (See Troubleshooting if blocked).
|
|
44
46
|
- `stop <names...>`: Stop by name or serial (`127.0.0.1:<port>`).
|
package/THIRD-PARTY-LICENSES
CHANGED
|
@@ -1250,7 +1250,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
1250
1250
|
|
|
1251
1251
|
The following npm package may be included in this product:
|
|
1252
1252
|
|
|
1253
|
-
- socket.io-parser@4.2.
|
|
1253
|
+
- socket.io-parser@4.2.7
|
|
1254
1254
|
|
|
1255
1255
|
This package contains the following license:
|
|
1256
1256
|
|
|
@@ -1975,7 +1975,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
1975
1975
|
|
|
1976
1976
|
The following npm package may be included in this product:
|
|
1977
1977
|
|
|
1978
|
-
- ip-address@10.
|
|
1978
|
+
- ip-address@10.4.0
|
|
1979
1979
|
|
|
1980
1980
|
This package contains the following license:
|
|
1981
1981
|
|
|
@@ -2089,7 +2089,7 @@ THE SOFTWARE.
|
|
|
2089
2089
|
|
|
2090
2090
|
The following npm package may be included in this product:
|
|
2091
2091
|
|
|
2092
|
-
- fast-uri@3.1.
|
|
2092
|
+
- fast-uri@3.1.5
|
|
2093
2093
|
|
|
2094
2094
|
This package contains the following license:
|
|
2095
2095
|
|
|
@@ -2920,7 +2920,7 @@ SOFTWARE.
|
|
|
2920
2920
|
|
|
2921
2921
|
The following npm package may be included in this product:
|
|
2922
2922
|
|
|
2923
|
-
- hono@4.
|
|
2923
|
+
- hono@4.13.1
|
|
2924
2924
|
|
|
2925
2925
|
This package contains the following license:
|
|
2926
2926
|
|