@deveco-test/deveco-cli 1.3.3-Test.1 → 1.3.3-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 CHANGED
@@ -137,6 +137,7 @@ devecocli init --path D:\work\ARKTS\NewData
137
137
  | `devecocli create` | 创建新的 HarmonyOS 项目 |
138
138
  | `devecocli build` | 构建项目并产出 `.hap` / `.hsp` / `.har` / `.app` |
139
139
  | `devecocli check lint` | 检查代码规范并输出实践建议与报告 |
140
+ | `devecocli check arkts` | 对 `.ets` 源文件执行 ArkTS 静态检查 |
140
141
  | `devecocli run` | 安装并运行应用 |
141
142
  | `devecocli device list` | 查看当前连接设备 |
142
143
  | `devecocli emulator list` | 查看本地模拟器实例 |
@@ -172,7 +173,7 @@ Usage: devecocli [options] [command]
172
173
  HarmonyOS application development command line tool
173
174
 
174
175
  Options:
175
- -V, --version output the version number
176
+ -V, -v, --version output the version number
176
177
  -h, --help display help for command
177
178
 
178
179
  Commands:
@@ -208,7 +209,7 @@ devecocli init --agent <agents> --project <path> --path <path> --skill --mcp --f
208
209
 
209
210
  | 参数名 | 说明 |
210
211
  | ----------- | ----------------------------------------------------------------------------------------- |
211
- | --agent | 可选,智能体名称,多个智能体名称以英文逗号分隔。支持 `trae-cn`、`opencode`、`pi`、`cursor`、`codebuddy`、`qoder`、`claude-code`、`codex`。缺省时配置到所有已检测到的智能体中 |
212
+ | --agent | 可选,智能体名称,多个智能体名称以英文逗号分隔。缺省时配置到所有已检测到的智能体中 |
212
213
  | --project | 可选,指定工程路径,将`deveco-cli` `Skill` 或 `MCP` 服务安装到该工程项目中 |
213
214
  | --path | 可选,指定 `deveco-cli` `Skill` 的配置路径。不可与 `--project` 、`--agent` 、 `--mcp` 同时使用 |
214
215
  | --skill | 可选,安装 `deveco-cli` `Skill`。不可与 `--mcp` 同时使用。`--mcp` 与 `--skill` 都缺省时,执行 `--skill` |
@@ -521,6 +522,37 @@ devecocli check lint [path]
521
522
 
522
523
  `emulator` 版本要求: DevEco Studio ≥ 6.1.0
523
524
 
525
+ ### `check arkts`
526
+
527
+ 对 `.ets` 源文件执行 ArkTS 静态检查,基于 DevEco Studio 的 `etsStandaloneChecker`。
528
+
529
+ **命令格式:**
530
+
531
+ ```bash
532
+ devecocli check arkts [files...] [--fix] [--project <path>]
533
+ ```
534
+
535
+ **参数:**
536
+
537
+ | 参数名 | 说明 |
538
+ | --- | --- |
539
+ | `[files...]` | 可选,待检查的 `.ets` 文件列表;默认检查项目内所有 `.ets` 文件 |
540
+ | `--fix` | 自动修复高置信度错误(如缺失的 `export` 关键字) |
541
+ | `--project <path>` | 项目根目录;默认从当前目录自动检测 `build-profile.json5` |
542
+
543
+ **示例:**
544
+
545
+ ```bash
546
+ # 检查整个项目
547
+ devecocli check arkts
548
+
549
+ # 检查指定文件并自动修复
550
+ devecocli check arkts --fix entry/src/main/ets/pages/Index.ets
551
+
552
+ # 指定项目路径
553
+ devecocli check arkts --project /path/to/project
554
+ ```
555
+
524
556
  ### `emulator list`
525
557
 
526
558
  查看模拟器实例
@@ -1249,6 +1281,12 @@ devecocli run --hotreload stop
1249
1281
  devecocli run --hotreload-apply changes.txt
1250
1282
  ```
1251
1283
 
1284
+ **说明:**
1285
+
1286
+ - 应用启动成功后(含 `--apply` 增量部署重启后),默认自动执行**冒烟检查**:确认应用进程仍存活,并对屏幕截图做纯色空白检测(pHash)。通过时输出 `Smoke: PASS`;进程已退出时输出 `Smoke: FAIL_CRASH`(附带 `crash_log:` 崩溃日志路径),检测到空白屏时输出 `Smoke: FAIL_BLANK`(附带 `screenshot:` 截图路径),检查失败时命令以非零码退出。证据仅在失败时落盘于工程 `.hvigor/smoke/` 下的本次运行独立目录:失败的截图与崩溃日志自检查结束起**保留 24 小时**(期间任何后续 run 都不会删除),之后由下一次 run 自动清理;`PASS` 的截图在判定后连同目录一并删除。进行中的并发检查互不影响,`.hvigor/` 不会随 run 次数堆积。
1287
+ - 无可启动的 `Ability`,或使用 `--hotreload` / `--hotreload-apply` 时,跳过冒烟检查。
1288
+ - 冒烟检查取证前默认等待 `1000` 毫秒(供应用完成冷启动),可通过环境变量 `DEVECO_CLI_SMOKE_WAIT_MS`(毫秒)调整:设为 `0` 立即取证;冷启动较慢的设备可适当调大以避免误报。
1289
+
1252
1290
  ### `log`
1253
1291
 
1254
1292
  查看`hilog`普通日志或崩溃日志
package/SKILL.md CHANGED
@@ -38,6 +38,14 @@ Run DevEco Code Linter checks for TS/ArkTS code.
38
38
  - Options: `--config-path <file>`, `--fix`, `--incremental`, `--product <name>`, `--format <default|json>`, `--output-path <path>`, `--limit <number>`.
39
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.
40
40
 
41
+ ### `devecocli check arkts`
42
+ Run this command once after a round of edits, right before the build. Catches most ArkTS errors faster than a full build. Do not run it per edit.
43
+ - `[files...]`: Specific `.ets` files to check. Defaults to all `.ets` files in the project.
44
+ - `--fix`: Auto-fix high-confidence errors (e.g., missing `export` keywords) before reporting.
45
+ - `--project <path>`: Project root directory. Defaults to auto-detection from cwd via `build-profile.json5`.
46
+
47
+ *Ex*: `devecocli check arkts --fix entry/src/main/ets/pages/Index.ets`
48
+
41
49
  ### `devecocli emulator`
42
50
  Manage local emulator instances and system images.
43
51
  - **Studio requirement**: DevEco Studio `>= 6.1.0`.
@@ -77,7 +85,7 @@ Search/read local HarmonyOS docs.
77
85
  - `sqlite3`: Run `sqlite3` on a device. Opt: `--device <name|serial>` (optional when exactly one device is connected, required when multiple). `db-path` is the on-device SQLite file; all further args are forwarded to the device `sqlite3` as-is (e.g. `-json`, `-readonly`, SQL strings, dot-commands). Maps to `hdc -t <serial> shell sqlite3 <db-path> [args...]`.
78
86
 
79
87
  ### `devecocli run` `[Outside sandbox]`
80
- Build, install, and launch.
88
+ Build, install, and launch. After a successful ability launch (and after a successful `--apply`), runs a **default smoke check**. Success prints `Smoke: PASS`; failures print `Smoke: FAIL_CRASH` or `Smoke: FAIL_BLANK` (crash log path via `crash_log:`, blank screenshot via `screenshot:`) and exit non-zero. Smoke is skipped when there is no ability to launch, and for `--hotreload` / `--hotreload-apply`.
81
89
  - `--module <module>`: Target module (auto-selected if only one runnable).
82
90
  - `--device <name|serial>`: Target device (Req if multiple connected).
83
91
  - `--product <product>` / `--build-mode <mode>`: Defaults: `default` / `debug`.
@@ -218,7 +226,7 @@ Validation order: `files` + `--modules` mutually exclusive → `--source-version
218
226
  - **`Not logged in. Run devecocli auth login first`**: Run `devecocli auth login` to authenticate.
219
227
  - **`Provision number exceeds limit`**: Test provision quota is full. Delete old test provisions in DevEco Studio (Signing Configs) or AGC console, then retry `devecocli signature generate`.
220
228
  - **`Invalid AccessToken. Sign in and try again`**: Token expired. Run `devecocli auth login` again.
221
- - **`skills add` agent not found**: Valid: `atomcode`, `codebuddy`, `claude-code`, `codex`, `cursor`, `deveco`, `opencode`, `pi`, `qoder`, `trae-cn`.
229
+ - **`skills add` agent not found**: Valid: `atomcode`, `codebuddy`, `claude-code`, `codex`, `cursor`, `dsh`, `deveco`, `opencode`, `pi`, `qoder`, `trae-cn`.
222
230
  - **`emulator start` / `image download` blocked on agreement**: User MUST accept agreements. Interactive: `devecocli emulator license` (requires TTY). Non-interactive (CI/scripts): `devecocli emulator license accept`. Agents cannot run the interactive form; suggest the user run it, or use `license accept` if a non-TTY flow is acceptable. Do not retry until accepted.
223
231
  - **`image download` failure / timeout**: Do NOT auto-retry. Give the command to the user to run manually in their terminal.
224
232
  - **`emulator create` timeout**: Treat as user-action step. Ask user to open DevEco Studio -> Device Manager. Check `emulator list` after user confirms. Do NOT auto-retry or edit SDK files.