@deveco-test/hmos-deveco-cli 0.3.0-TD.2 → 0.3.0-TD.2.1
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 +52 -0
- package/SKILL.md +18 -3
- package/dist/cli.js +113 -113
- package/index.zip +0 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -127,6 +127,8 @@ Commands:
|
|
|
127
127
|
run [options] Build and run the project on a connected device
|
|
128
128
|
update Update deveco-cli to the latest version
|
|
129
129
|
device Manage connected devices
|
|
130
|
+
auth Authentication commands (login, logout, status, team)
|
|
131
|
+
ui Inspect and interact with UI on a connected device
|
|
130
132
|
skills Manage HarmonyOS skills
|
|
131
133
|
log [options] Obtain device application logs
|
|
132
134
|
create [options] Scaffold a new HarmonyOS application project
|
|
@@ -273,6 +275,56 @@ devecocli create --project-path ./MyApp --app-name MyApp --bundle-name com.acme.
|
|
|
273
275
|
devecocli create --app-name MyApp
|
|
274
276
|
```
|
|
275
277
|
|
|
278
|
+
### `auth login`
|
|
279
|
+
|
|
280
|
+
登录华为开发者账号,打开浏览器完成授权。
|
|
281
|
+
|
|
282
|
+
**命令格式:**
|
|
283
|
+
|
|
284
|
+
```bash
|
|
285
|
+
devecocli auth login
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
**说明:**
|
|
289
|
+
|
|
290
|
+
- 海外账户暂不支持
|
|
291
|
+
|
|
292
|
+
### `auth logout`
|
|
293
|
+
|
|
294
|
+
登出并清除本地存储的凭据
|
|
295
|
+
|
|
296
|
+
**命令格式:**
|
|
297
|
+
|
|
298
|
+
```bash
|
|
299
|
+
devecocli auth logout
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
### `auth status`
|
|
303
|
+
|
|
304
|
+
显示当前登录的用户
|
|
305
|
+
|
|
306
|
+
**命令格式:**
|
|
307
|
+
|
|
308
|
+
```bash
|
|
309
|
+
devecocli auth status
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
### `auth team list`
|
|
313
|
+
|
|
314
|
+
列出当前用户已加入的团队
|
|
315
|
+
|
|
316
|
+
**命令格式:**
|
|
317
|
+
|
|
318
|
+
```bash
|
|
319
|
+
devecocli auth team list
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
**示例:**
|
|
323
|
+
|
|
324
|
+
```bash
|
|
325
|
+
devecocli auth team list
|
|
326
|
+
```
|
|
327
|
+
|
|
276
328
|
### `build`
|
|
277
329
|
|
|
278
330
|
编译并打包 HarmonyOS 工程或工程中的模块
|
package/SKILL.md
CHANGED
|
@@ -13,7 +13,7 @@ description: >-
|
|
|
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`, `check`, `run`, `update`, `device`, `skills`, `log`, `create`, `init`, `serve`, `docs`, `auth`.
|
|
16
|
+
Available commands: `build`, `check`, `run`, `update`, `device`, `ui`, `skills`, `log`, `create`, `init`, `serve`, `docs`, `signature`, `auth`.
|
|
17
17
|
|
|
18
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
19
|
1. Enable wireless debugging in Settings → System → Developer options → Wireless debugging
|
|
@@ -74,6 +74,18 @@ Build, install, and launch.
|
|
|
74
74
|
- **HarmonyOS native (2in1 PC)**: hdc does NOT auto-discover the local device — self-connect required. In previewer mode, `--device` is the product name (not hdc target). The CLI checks `hdc list targets` for a `127.0.0.1:<port>` entry: if found, uses it directly; if not found, warns `hdc 未自联` and fallbacks to `connectLocalDevice` (resolution: `DEVECO_HDC_PORT` env var → existing `hdc list targets` → interactive prompt → error). DevEco Studio is a system app there; local `pgrep` cannot see Studio's process due to UID isolation, so the CLI detects Studio via `hdc shell ps -ef | grep com.huawei.devecostudio` (hdcd runs as root) — requires hdc self-connect first. The CLI does NOT auto-start Studio on any platform.
|
|
75
75
|
- **Agent hint**: After a successful single-preview launch where the user specified only one device type, briefly inform the user in natural language that they can try launching multiple different device previewers at once by comma-separating product names in `--device`. Do NOT print command examples — keep it conversational. Do NOT print this hint if the user already launched multi-preview.
|
|
76
76
|
|
|
77
|
+
### `devecocli signature generate` `[Outside sandbox]`
|
|
78
|
+
Auto-generate HarmonyOS signing materials (local p12/csr + cloud cert + test profile) and write signing config to `build-profile.json5`.
|
|
79
|
+
- **Prereq**: `devecocli auth login` first; run from a project directory (with `build-profile.json5`); a connected device is required for device registration.
|
|
80
|
+
- `--product <name>`: Product name for local p12/csr file naming (default: `default`).
|
|
81
|
+
- `--team-id <id>`: Specify the team-id (default: current user's id).
|
|
82
|
+
- `--force`: Force regenerate even if existing materials are valid.
|
|
83
|
+
- Generates under `~/.ohos/config/`: `.p12` keystore, `.csr`, downloaded `.cer` certificate, `.p7b` profile.
|
|
84
|
+
- Writes `signingConfigs` + `products` entries to `build-profile.json5` with encrypted key/store passwords (AES-128-GCM).
|
|
85
|
+
- Cloud cert name: `auto_debug_<teamId>.cer`. Local files: `<product>_<project>_<hash>=.{p12,csr,cer,p7b}`.
|
|
86
|
+
- Error handling: 401→re-login, 403→no AGC permission, `205389872`→cert limit, `205389904`→not Harmony user, `205389938`→provision limit, invalid `.cer`→retry.
|
|
87
|
+
*Ex*: `devecocli signature generate --product default`
|
|
88
|
+
|
|
77
89
|
### `devecocli log`
|
|
78
90
|
Fetch hilog or crash logs. Req `--device <name|serial>` on multi-device hosts.
|
|
79
91
|
- `--crash`: Dump crash logs.
|
|
@@ -159,14 +171,17 @@ Manage HarmonyOS skills in AI agents/projects.
|
|
|
159
171
|
- **Release build**:
|
|
160
172
|
`devecocli build --product oversea --build-mode release`
|
|
161
173
|
- **First-time signing setup**:
|
|
162
|
-
`devecocli login` -> `devecocli signature generate --product default` -> `devecocli build` -> `devecocli run`
|
|
174
|
+
`devecocli auth login` -> `devecocli signature generate --product default` -> `devecocli build` -> `devecocli run`
|
|
163
175
|
|
|
164
176
|
## Troubleshooting
|
|
165
177
|
|
|
166
178
|
- **"Product / Build mode `<x>` not found"**: Check `build-profile.json5`.
|
|
167
179
|
- **"Multiple entry modules" / "No entry module"**: Pass `--modules` (build) or `--module` (run).
|
|
168
180
|
- **"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).
|
|
169
|
-
- **`error:install sign info inconsistent`**: Signing key changed. Run `devecocli run --uninstall`.
|
|
181
|
+
- **`error:install sign info inconsistent`**: Signing key changed. Run `devecocli run --uninstall` or `devecocli signature generate --force`.
|
|
182
|
+
- **`Not logged in. Run devecocli auth login first`**: Run `devecocli auth login` to authenticate.
|
|
183
|
+
- **`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`.
|
|
184
|
+
- **`Invalid AccessToken. Sign in and try again`**: Token expired. Run `devecocli auth login` again.
|
|
170
185
|
- **`skills add` agent not found**: Valid: `codebuddy`, `cursor`, `opencode`, `qoder`, `trae-cn`.
|
|
171
186
|
- **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).
|
|
172
187
|
- **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.
|