@deveco-test/deveco-cli 1.3.0-Test.100-tmp → 1.3.0-Test.11
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 +583 -49
- package/SKILL.md +34 -22
- package/THIRD-PARTY-LICENSES +237 -1020
- package/dist/cli.js +106 -112
- package/dist/internal/doc-init-background.js +1 -65
- package/index.zip +0 -0
- package/package.json +9 -16
- package/scripts/postinstall.mjs +1 -22
- package/scripts/install-better-sqlite3.mjs +0 -51
- package/scripts/install-jieba-wasm.mjs +0 -47
- package/scripts/lib/better-sqlite3-vendor.mjs +0 -129
- package/scripts/lib/cli-data-dir.mjs +0 -44
- package/scripts/lib/doc-init-log-path.mjs +0 -15
- package/scripts/lib/jieba-wasm-vendor.mjs +0 -102
package/SKILL.md
CHANGED
|
@@ -8,7 +8,7 @@ description: >-
|
|
|
8
8
|
|
|
9
9
|
`devecocli` wraps DevEco Studio's `hvigor`, `ohpm`, `hdc`, emulator toolchain, and bundled skills installer. **Prefer `devecocli` over invoking underlying tools directly.**
|
|
10
10
|
|
|
11
|
-
Available commands: `build`, `check`, `run`, `update`, `device`, `emulator`, `ui`, `skills`, `log`, `create`, `init`, `serve`, `docs`, `signature`, `
|
|
11
|
+
Available commands: `build`, `check`, `run`, `update`, `device`, `emulator`, `ui`, `skills`, `log`, `create`, `init`, `serve`, `docs`, `signature`, `auth`.
|
|
12
12
|
|
|
13
13
|
**Sandbox Rule**: Commands tagged `[Outside sandbox]` must be run outside the sandbox.
|
|
14
14
|
|
|
@@ -39,13 +39,13 @@ Run DevEco Code Linter checks for TS/ArkTS code.
|
|
|
39
39
|
|
|
40
40
|
### `devecocli emulator`
|
|
41
41
|
Manage local emulator instances and system images.
|
|
42
|
-
- `list`: Show instances (status, serial, device type).
|
|
42
|
+
- `list`: Show instances (status, serial, device type). Opt: `--format <table|json>` (default: `table`).
|
|
43
43
|
- `start <names...>`: Start instances. Quote names with spaces. (See Troubleshooting if blocked).
|
|
44
44
|
- `stop <names...>`: Stop by name or serial (`127.0.0.1:<port>`).
|
|
45
45
|
- Scene control commands require Emulator 7.0 or later. Use `DEVECO_CLI_DEBUG=1` to inspect the underlying `Emulator` command mapping.
|
|
46
46
|
- `shake` / `power` / `rotate <left|right>` / `volume <up|down>` (Req: `--target <nameOrSerial>`): Basic emulator controls.
|
|
47
47
|
- `fold <state>` (Req: `--target <nameOrSerial>`): Set foldable display state, matched against the target emulator's reported `deviceType`. `foldable` uses `open|half-open|close`; `2in1_foldable` uses `open|vertical-open|half-open|close`; `triplefold` uses `single|double|triple` or one of its six left/right folded-state combinations. Other device types and cross-device states are rejected before execution.
|
|
48
|
-
- `battery` (Req: `--target`; one of `--level <0-100>` or `--status <charging|discharging>`): Set battery state.
|
|
48
|
+
- `battery` (Req: `--target`; one of `--level <0-100>` or `--status <charging|discharging>`): Set battery state. `--level` checks the current emulator charging state automatically (`0-100` while charging, `1-100` otherwise).
|
|
49
49
|
- `geolocation` (Req: `--target`; one of `--longitude`, `--latitude`, `--altitude`, `--direction`): Inject GPS data.
|
|
50
50
|
- `scene <outdoorRunning|outdoorCycling|drivingNavigation>` (Req: `--target`): Start motion simulation.
|
|
51
51
|
- `sensor` (Req: `--target`; one of `--light-intensity`, `--humidity`, `--temperature`, `--steps`, `--heartrate`): Inject sensor data.
|
|
@@ -58,9 +58,9 @@ Manage local emulator instances and system images.
|
|
|
58
58
|
### `devecocli ui`
|
|
59
59
|
Inspect UI on a connected physical device or running emulator.
|
|
60
60
|
- `screenshot`: Capture a screenshot from a physical device or running emulator. `--device <name|serial>` is optional when exactly one device is connected, and required when multiple devices are connected.
|
|
61
|
-
- Optional: `--display <displayId
|
|
61
|
+
- Optional: `--display <displayId>`. Required: `--path <path>` (existing directory or PNG file path, including paths relative to the current directory; writable destination; no overwrite).
|
|
62
62
|
- Implementation uses `hdc shell snapshot_display` and `hdc file recv`; set `DEVECO_CLI_DEBUG=1` to inspect the actual `hdc` commands.
|
|
63
|
-
*Ex*: `
|
|
63
|
+
*Ex*: `devecocli ui screenshot --device Phone --path ./screenshots/phone.png`
|
|
64
64
|
|
|
65
65
|
### `devecocli docs`
|
|
66
66
|
Search/read local HarmonyOS docs.
|
|
@@ -85,10 +85,18 @@ Build, install, and launch.
|
|
|
85
85
|
- **Prereq**: DevEco Studio ≥6.1.1 (hvigor `assembleDevHqf` support; below is rejected with an upgrade hint); run `devecocli run` once first (full build + deploy + generates the `buildConfig.json` cache that `--apply` reuses).
|
|
86
86
|
- **If changes don't take effect**: check `<module>/build/config/buildConfig.json` has content — empty/missing means `devecocli run` wasn't run; on any apply failure, fall back to a full `devecocli run`.
|
|
87
87
|
*Ex*: `devecocli run` → edit code → write `.hvigor/changes.txt` → `devecocli run --apply changes.txt`
|
|
88
|
+
- `--hotreload [action]`: **Hot-reload watch session** — must be started as a **background process** (the process holds a persistent socket to the hvigor daemon). It builds the hap in hot-reload mode (`hotReload=true debuggable=true`), deploys+launches the app, then the process itself connects a socket to the daemon and sends `CommonBuild assembleHap --hot-reload-build --watch`, **staying connected** so the daemon's watch worker (rollup watch) stays alive for `--hotreload-apply` to reuse. The process stays alive (onBuildOutput streams to its stdout). **Must be stopped (kill the background process) when the hot-reload debug session ends** — otherwise the watch worker/daemon leaks. `--hotreload stop` additionally stops the hvigor daemon.
|
|
89
|
+
- **Usage**: start `devecocli run --module <m> --hotreload` as a background process; wait for the `.hotreload-mode` marker (or "watch session active" on its stdout) = ready; then run `devecocli run --module <m> --hotreload-apply <file>` (foreground). When done: kill the background process + `devecocli run --hotreload stop`.
|
|
90
|
+
- `--hotreload-apply <fileName>`: **Hot reload without app restart** — reads the changed-file list from `.hvigor/<fileName>` (same format/merge rules as `--apply`), opens a **short socket** to the daemon (kept alive by the background `--hotreload` process) and sends `CommonBuild assembleDevHqf --hot-compile` → the watch worker incrementally hot-compiles changed `.ets`/`.ts` into abc (HotReloadArkTS; output/errors streamed live via WatchLog), then **manually** packs + signs a hqf from that abc (`app_packing_tool.jar` + `hap-sign-tool.jar`, DevEco material password decrypted via `DecipherUtil`), and installs it via `bm quickfix -a -f -o`. The app is **not restarted** — changes take effect immediately.
|
|
91
|
+
- **Prereq**: the background `devecocli run --hotreload` process must be running (holds the watch session). If `--hotreload-apply` times out, the watch session isn't alive — (re)start the background `--hotreload`.
|
|
92
|
+
- **Scope (important)**: hot reload targets a **single module** (`--module` required; the target can be entry/hsp/feature; `har` deps are folded in and fine). **`har` dependency changes are auto-routed** to the dependent main module's (entry/feature/hsp) `hotReload/changedFileList.json` — so editing a har's `.ets` and listing it hot-reloads via the target module. Changes in **`feature`/`hsp` dependency modules** (not the target) are NOT hot-reloadable — they're detected and warned (run a full `devecocli run` to redeploy those). `@State`/state-decorator changes are **not** hot-reloadable (state isn't re-initialized); hot-reloadable changes are non-state code: UI property values (`.fontColor`/`.fontSize`), `Text`/`Button` literal labels, method bodies, expressions. Resources/native changes need a full run.
|
|
93
|
+
- **Compile errors**: ArkTS compile errors from the hot compile are routed (via WatchLog) to the **background `--hotreload` process**, which writes them to **`.hvigor/hotreload-watch.log`** (and its stdout). On failure, `--hotreload-apply` reads that file and prints the errors inline (fast-fail, ~15s timeout if the watch session is dead).
|
|
94
|
+
- **Artifacts under `.hvigor/`** (shared with `--apply`): `.hvigor/<fileName>` = the changed-file list you write; `.hvigor/hotreload-watch.log` = the watch session's onBuildOutput/compile-errors (written by the background `--hotreload` process; safe to read/delete). The hot-reload marker is `<module>/build/<product>/.hotreload-mode`.
|
|
95
|
+
*Ex*: background `devecocli run --module entry --hotreload` → (ready) → edit `.fontColor` in `entry/src/main/ets/pages/Index.ets` → write path to `.hvigor/changes.txt` → `devecocli run --module entry --hotreload-apply changes.txt` (UI updates without restart). When done: kill the background process + `devecocli run --hotreload stop`.
|
|
88
96
|
|
|
89
97
|
### `devecocli signature generate` `[Outside sandbox]`
|
|
90
98
|
Auto-generate HarmonyOS signing materials (local p12/csr + cloud cert + test profile) and write signing config to `build-profile.json5`.
|
|
91
|
-
- **Prereq**: `devecocli login` first; run from a project directory (with `build-profile.json5`); a connected device or emulator is required for device registration.
|
|
99
|
+
- **Prereq**: `devecocli auth login` first; run from a project directory (with `build-profile.json5`); a connected device or emulator is required for device registration.
|
|
92
100
|
- `--product <name>`: Product name for local p12/csr file naming (default: `default`).
|
|
93
101
|
- `--team-id <id>`: Specify the team-id (default: current user's id).
|
|
94
102
|
- `--force`: Force regenerate even if existing materials are valid.
|
|
@@ -114,22 +122,23 @@ Inspect UI on a connected device. All subcommands accept `--device <name|serial>
|
|
|
114
122
|
| Subcommand | Description | Key Options |
|
|
115
123
|
|---|---|---|
|
|
116
124
|
| `layout` | Dump ArkUI accessibility layout tree — **visible area only** (on-screen nodes) | `--id <id>`, `--window <windowId>`, `--all-windows`, `--depth <n>` (0=unlimited, 1=root only, 2=root+children), `--format default\|json`, `--mode full\|simplified` |
|
|
117
|
-
| `window list` | List active windows | `--format
|
|
118
|
-
| `screenshot` | Capture a screenshot of the device screen | `--display <displayId>`, `--path <path>` (existing directory or PNG file path
|
|
125
|
+
| `window list` | List active windows | `--format default\|json`, `--all` (include system windows) |
|
|
126
|
+
| `screenshot` | Capture a screenshot of the device screen | `--display <displayId>`, required `--path <path>` (existing directory or PNG file path; relative paths supported; writable destination; no overwrite) |
|
|
119
127
|
| `click [x] [y]` | Tap at the specified coordinates or node | `--id <id>` (auto-resolves to center), `--window <windowId>` (used with `--id`) |
|
|
120
128
|
| `doubleclick [x] [y]` | Double-tap at the specified coordinates or node | `--id <id>`, `--window <windowId>` |
|
|
121
129
|
| `longclick [x] [y]` | Long-press at the specified coordinates or node | `--id <id>`, `--window <windowId>` |
|
|
122
|
-
| `swipe <x1> <y1> <x2> <y2>` | Swipe from one point to another | `--speed <n>` (200–40000, px/s) |
|
|
130
|
+
| `swipe <x1> <y1> <x2> <y2>` | Swipe from one point to another (precise coordinates, custom speed) | `--speed <n>` (200–40000, px/s) |
|
|
123
131
|
| `fling <x1> <y1> <x2> <y2>` | Fling from one point to another | `--speed <n>` (200–40000, px/s) |
|
|
124
132
|
| `drag <x1> <y1> <x2> <y2>` | Drag from one point to another | `--speed <n>` (200–40000, px/s) |
|
|
125
|
-
| `dircfling <direction>` |
|
|
133
|
+
| `dircfling <direction>` | Quick directional fling (system default speed, ideal for scrolling) | `direction`: `up`, `down`, `left`, `right` |
|
|
126
134
|
| `text <text> [x] [y]` | Input text at a target location or the currently focused field | `--id <id>` (auto-resolves to center), `--window <windowId>` (used with `--id`) |
|
|
127
135
|
|
|
128
|
-
- Coordinates
|
|
129
|
-
-
|
|
130
|
-
-
|
|
136
|
+
- **Coordinates vs `--id`**: Mutually exclusive. Provide either `x y` or `--id <id>`. For `text`, if neither is given, text goes to the currently focused field.
|
|
137
|
+
- **`--window`**: May only be used together with `--id`. Default is focused window. Secondary display operations via `--id` + `--window` are not supported.
|
|
138
|
+
- **`swipe` vs `dircfling`**: `swipe` requires exact start/end coordinates and supports `--speed`; `dircfling` only needs a direction (`up/down/left/right`) and uses system default speed (ideal for page/list scrolling).
|
|
139
|
+
- **Text encoding**: Special characters in `text` are Base64-encoded internally to safely pass through device shell.
|
|
131
140
|
- `--format json` pairs well with `jq`.
|
|
132
|
-
- `--mode
|
|
141
|
+
- `--mode full`: full layout tree, no filtering.
|
|
133
142
|
- `--mode simplified` (default): folds meaningless wrapper containers (non-root, no `id`, no text, not interactive) by lifting their surviving children up. `--depth` truncates after folding.
|
|
134
143
|
|
|
135
144
|
|
|
@@ -146,16 +155,19 @@ MUTUALLY EXCLUSIVE modes for setup:
|
|
|
146
155
|
- `-f, --force`: Overwrite existing config.
|
|
147
156
|
*MCP Rules*: Global MCP (no `--project`) only supports `opencode` and `cursor`. Others require `--project`.
|
|
148
157
|
|
|
149
|
-
### `devecocli login`
|
|
158
|
+
### `devecocli auth login`
|
|
150
159
|
Sign in to your Huawei Developer account. Opens a browser for OAuth authentication. Required before `signature generate`.
|
|
151
|
-
*Ex*: `devecocli login`
|
|
160
|
+
*Ex*: `devecocli auth login`
|
|
152
161
|
|
|
153
|
-
### `devecocli logout`
|
|
162
|
+
### `devecocli auth logout`
|
|
154
163
|
Sign out and clear locally stored credentials.
|
|
155
164
|
|
|
156
|
-
### `devecocli
|
|
165
|
+
### `devecocli auth status`
|
|
157
166
|
Show the current logged-in user.
|
|
158
167
|
|
|
168
|
+
### `devecocli auth team list`
|
|
169
|
+
List team accounts the current user has joined.
|
|
170
|
+
|
|
159
171
|
### `devecocli skills`
|
|
160
172
|
Manage HarmonyOS skills in AI agents/projects.
|
|
161
173
|
- `list [-l|--long]` / `find <keyword>`: List or search skills.
|
|
@@ -164,7 +176,7 @@ Manage HarmonyOS skills in AI agents/projects.
|
|
|
164
176
|
|
|
165
177
|
### `devecocli check compat` `[Outside sandbox]`
|
|
166
178
|
Scan source code for breaking API changes between two SDK versions. Built on top of DevEco Studio's `arkanalyzer-apiscan` plugin.
|
|
167
|
-
- `versions`: List available target SDK versions.
|
|
179
|
+
- `versions`: List available target SDK versions. Opts: `--format <default|json>` (default: `default`).
|
|
168
180
|
- Default (no args): project-level scan.
|
|
169
181
|
- `--modules <m1> [m2...]`: Module-level scan.
|
|
170
182
|
- `<file1> [file2...]`: File-level scan (`.ets`/`.c`/`.cpp` only).
|
|
@@ -191,7 +203,7 @@ Validation order: `files` + `--modules` mutually exclusive → `--source-version
|
|
|
191
203
|
- **Release build**:
|
|
192
204
|
`devecocli build --product oversea --build-mode release`
|
|
193
205
|
- **First-time signing setup**:
|
|
194
|
-
`devecocli login` -> `devecocli signature generate --product default` -> `devecocli build` -> `devecocli run`
|
|
206
|
+
`devecocli auth login` -> `devecocli signature generate --product default` -> `devecocli build` -> `devecocli run`
|
|
195
207
|
|
|
196
208
|
## Troubleshooting
|
|
197
209
|
|
|
@@ -199,9 +211,9 @@ Validation order: `files` + `--modules` mutually exclusive → `--source-version
|
|
|
199
211
|
- **"Multiple entry modules" / "No entry module"**: Pass `--modules` (build) or `--module` (run).
|
|
200
212
|
- **"No active devices" / "Multiple devices connected"**: Connect/start emulator. Pass `-t <serial>` (device view) or `--device <name|serial>` (run/log).
|
|
201
213
|
- **`error:install sign info inconsistent`**: Signing key changed. Run `devecocli run --uninstall` or `devecocli signature generate --force`.
|
|
202
|
-
- **`Not logged in. Run devecocli login first`**: Run `devecocli login` to authenticate.
|
|
214
|
+
- **`Not logged in. Run devecocli auth login first`**: Run `devecocli auth login` to authenticate.
|
|
203
215
|
- **`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`.
|
|
204
|
-
- **`Invalid AccessToken. Sign in and try again`**: Token expired. Run `devecocli login` again.
|
|
216
|
+
- **`Invalid AccessToken. Sign in and try again`**: Token expired. Run `devecocli auth login` again.
|
|
205
217
|
- **`skills add` agent not found**: Valid: `codebuddy`, `cursor`, `opencode`, `qoder`, `trae-cn`.
|
|
206
218
|
- **`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.
|
|
207
219
|
- **`image download` failure / timeout**: Do NOT auto-retry. Give the command to the user to run manually in their terminal.
|