@deveco-test/hmos-deveco-cli 0.2.0 → 0.2.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/SKILL.md +12 -22
- package/dist/cli.js +72 -69
- package/dist/internal/doc-init-background.js +4 -4
- package/docs.zip +0 -0
- package/index.zip +0 -0
- package/package.json +1 -1
package/SKILL.md
CHANGED
|
@@ -1,19 +1,24 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: deveco-cli
|
|
3
3
|
description: >-
|
|
4
|
-
**MUST** use 'devecocli' for HarmonyOS apps (scaffold, build, run, debug, devices,
|
|
4
|
+
**MUST** use 'devecocli' for HarmonyOS apps (scaffold, build, run, debug, devices, logs, docs, 鸿蒙开发文档, skills, multi-preview). **REQUIRED** and **MANDATORY** if workspace has build-profile.json5 or oh-package.json5, or user mentions HarmonyOS, 鸿蒙, DevEco, ArkTS, ArkUI, docs, 鸿蒙文档, 知识, 搜索, skills, or preview/预览/预览器/多预览器/多设备预览器.
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# DevEco CLI
|
|
8
8
|
|
|
9
|
-
`devecocli` wraps DevEco Studio's `hvigor`, `ohpm`, `hdc`,
|
|
9
|
+
`devecocli` wraps DevEco Studio's `hvigor`, `ohpm`, `hdc`, and HarmonyOS-skills installer. **Prefer `devecocli` over invoking underlying tools directly.**
|
|
10
10
|
|
|
11
11
|
**Do NOT use these legacy commands** — use the `devecocli` equivalent instead:
|
|
12
12
|
- ❌ `deveco preview` / `hvigorw preview` → ✅ `devecocli run --device <product-name>` (launches DevEco Studio previewer; product name in `--device` triggers previewer mode)
|
|
13
13
|
- ❌ `hvigorw` directly → ✅ `devecocli build`
|
|
14
14
|
- ❌ `hdc` directly (when a `devecocli` wrapper exists) → ✅ `devecocli device` / `devecocli log` / `devecocli run`
|
|
15
15
|
|
|
16
|
-
Available commands: `build`, `run`, `update`, `device`, `
|
|
16
|
+
Available commands: `build`, `run`, `update`, `device`, `skills`, `log`, `create`, `init`, `serve`, `docs`.
|
|
17
|
+
|
|
18
|
+
**Platform awareness**: On HarmonyOS native PC (2in1), **emulator commands are NOT available** and must never be suggested. The `emulator` command does not exist on this platform. When `device list` shows no devices, instead of suggesting emulator startup, tell the user to:
|
|
19
|
+
1. Enable wireless debugging in Settings → System → Developer options → Wireless debugging
|
|
20
|
+
2. Note the port number
|
|
21
|
+
3. Run `hdc tconn 127.0.0.1:<port>`
|
|
17
22
|
|
|
18
23
|
**Sandbox Rule**: Commands tagged `[Outside sandbox]` must be run outside the sandbox.
|
|
19
24
|
|
|
@@ -36,17 +41,6 @@ Compile and package project/modules. (Defaults: `--product default`, `--build-mo
|
|
|
36
41
|
| Whole product bundle (.app) | `devecocli build --product <name>` |
|
|
37
42
|
| Clean build outputs | `devecocli build clean` |
|
|
38
43
|
|
|
39
|
-
### `devecocli emulator`
|
|
40
|
-
Manage local emulator instances and system images.
|
|
41
|
-
- `list`: Show instances (status, serial, device type).
|
|
42
|
-
- `start <names...>`: Start instances. Quote names with spaces. (See Troubleshooting if blocked).
|
|
43
|
-
- `stop <names...>`: Stop by name or serial (`127.0.0.1:<port>`).
|
|
44
|
-
- `create <name>` (Req: `--device-type`, `--os-version`): Create instance. Optional: `--force`.
|
|
45
|
-
- `delete <name>`: Delete instance.
|
|
46
|
-
- `image list`: List downloaded images. Opts: `--device-type <type>`, `--all`, `--format <table|json>`.
|
|
47
|
-
- `image download` / `image remove` (Req: `--device-type`, `--os-version`): Download/remove image. (Takes 30+ min, set long timeout).
|
|
48
|
-
*Device types*: `phone`, `foldable`, `widefold`, `triplefold`, `tablet`, `2in1`, `2in1 foldable`, `wearable`, `tv`.
|
|
49
|
-
|
|
50
44
|
### `devecocli docs`
|
|
51
45
|
Search/read local HarmonyOS docs.
|
|
52
46
|
- `search <keywords...>`: Match any keyword. Opts: `--catalog <name>`, `--format <default|json>`, `--limit <n>`.
|
|
@@ -54,7 +48,7 @@ Search/read local HarmonyOS docs.
|
|
|
54
48
|
- `catalog`: List available catalogs.
|
|
55
49
|
|
|
56
50
|
### `devecocli device`
|
|
57
|
-
- `list`: Show active real devices
|
|
51
|
+
- `list`: Show active real devices.
|
|
58
52
|
- `view`: Detailed info. Req `-t <name|serial>` on multi-device hosts.
|
|
59
53
|
|
|
60
54
|
### `devecocli run` `[Outside sandbox]`
|
|
@@ -105,8 +99,8 @@ Manage HarmonyOS skills in AI agents/projects.
|
|
|
105
99
|
|
|
106
100
|
## Recipes
|
|
107
101
|
|
|
108
|
-
- **Fresh checkout to
|
|
109
|
-
`devecocli build` -> `devecocli
|
|
102
|
+
- **Fresh checkout to real device**:
|
|
103
|
+
`devecocli build` -> `devecocli device list` -> `devecocli run --device <serial>`
|
|
110
104
|
- **Launch previewer for current project** (instead of `deveco preview`):
|
|
111
105
|
- Single previewer (specific device type): `devecocli run --module entry --device "Pura 90 Pro"`
|
|
112
106
|
- Multi-preview by device types: `devecocli run --module entry --device "Pura 90 Pro,Mate XT"`
|
|
@@ -121,12 +115,8 @@ Manage HarmonyOS skills in AI agents/projects.
|
|
|
121
115
|
|
|
122
116
|
- **"Product / Build mode `<x>` not found"**: Check `build-profile.json5`.
|
|
123
117
|
- **"Multiple entry modules" / "No entry module"**: Pass `--modules` (build) or `--module` (run).
|
|
124
|
-
- **"No active devices" / "Multiple devices connected"**: Connect
|
|
118
|
+
- **"No active devices" / "Multiple devices connected"**: Connect a real device (or self-connect via wireless debugging on HarmonyOS native PC). Pass `-t <serial>` (device view) or `--device <name|serial>` (run/log).
|
|
125
119
|
- **`error:install sign info inconsistent`**: Signing key changed. Run `devecocli run --uninstall`.
|
|
126
120
|
- **`skills add` agent not found**: Valid: `codebuddy`, `cursor`, `opencode`, `qoder`, `trae-cn`.
|
|
127
|
-
- **`emulator start` / `image download` blocked on agreement**: User MUST run `devecocli emulator license accept` in interactive TTY. Agents cannot do this. Do not retry until accepted.
|
|
128
|
-
- **`image download` failure / timeout**: Do NOT auto-retry. Give the command to the user to run manually in their terminal.
|
|
129
|
-
- **`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.
|
|
130
|
-
- **`image list` duplicate OS rows**: `phone`/`foldable`/`widefold`/`triplefold` share the same image. Download/remove ONCE per OS version.
|
|
131
121
|
- **HarmonyOS native (2in1 PC) — `hdc list targets` shows `[Empty]`**: hdc on HarmonyOS does NOT auto-discover the local device. Open "Settings → System → Developer options → Wireless debugging", note the port, then `hdc tconn 127.0.0.1:<port>`. For normal run: pass `--device 127.0.0.1:<port>`. For previewer mode: set `DEVECO_HDC_PORT=<port>` env var (previewer mode uses `--device` for product name, not hdc target).
|
|
132
122
|
- **Previewer mode — "DevEco Studio is not running"**: The previewer's rendering depends on the DevEco Studio desktop process. If the CLI returns this error, do NOT retry. Use natural language to tell the user: "预览器需要 DevEco Studio 处于运行状态,请先手动启动 DevEco Studio,启动后再重试此命令。" On HarmonyOS PC, also remind the user that process detection may be limited by UID isolation (currentUser cannot see Studio's process), but if the CLI reports this error it means detection genuinely failed.
|