@kvell007/embed-labs-cli 0.1.0-alpha.50 → 0.1.0-alpha.52
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 +32 -16
- package/dist/index.js +63 -23
- package/dist/index.js.map +1 -1
- package/dist/install-progress.js +2 -1
- package/dist/install-progress.js.map +1 -1
- package/dist/local-toolchain.d.ts +15 -0
- package/dist/local-toolchain.js +114 -26
- package/dist/local-toolchain.js.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -22,8 +22,8 @@ names.
|
|
|
22
22
|
- Auth token login, logout, and status commands.
|
|
23
23
|
- Account registration, API key issue/list, token usage metering, and billing
|
|
24
24
|
statement preview commands.
|
|
25
|
-
-
|
|
26
|
-
|
|
25
|
+
- Board knowledge/method discovery through Cloud API, plus local-first
|
|
26
|
+
toolchain installation, validation, compile, and hardware handoff.
|
|
27
27
|
- Debug tool, device, serial, SSH, and flash commands routed through the local
|
|
28
28
|
bridge.
|
|
29
29
|
- Project, task, artifact, and cloud status commands routed through the cloud
|
|
@@ -117,18 +117,23 @@ message `工具完整性校验失败,请在当前电脑重新执行 embedlabs
|
|
|
117
117
|
For the current public API plus local TaishanPi verification path, see
|
|
118
118
|
`docs/runbooks/PUBLIC_CLI_USER_VERIFICATION.md`.
|
|
119
119
|
|
|
120
|
-
For
|
|
120
|
+
For board knowledge and local toolchain work:
|
|
121
121
|
|
|
122
122
|
```bash
|
|
123
|
-
embed
|
|
124
|
-
embed
|
|
125
|
-
embed
|
|
126
|
-
embed
|
|
127
|
-
embed
|
|
128
|
-
embed
|
|
129
|
-
embed
|
|
123
|
+
embed board registry list
|
|
124
|
+
embed board methods taishanpi-1m-rk3566
|
|
125
|
+
embed board knowledge search taishanpi-1m-rk3566 --query "UART pinout"
|
|
126
|
+
embed local toolchain list
|
|
127
|
+
embed local toolchain latest --board taishanpi-1m-rk3566
|
|
128
|
+
embed local toolchain validate --board taishanpi-1m-rk3566 --mode minimal
|
|
129
|
+
embed local compile taishanpi --source ./main.c --output ./.embed-labs/build/main
|
|
130
130
|
```
|
|
131
131
|
|
|
132
|
+
Server-side user workspaces and server Docker builds are disabled in the
|
|
133
|
+
local-first product mode. The server remains responsible for accounts, API
|
|
134
|
+
keys, model routing, billing, plugin releases, SDK/download metadata, and small
|
|
135
|
+
image/DTB/logo package generation.
|
|
136
|
+
|
|
132
137
|
For local hardware access:
|
|
133
138
|
|
|
134
139
|
```bash
|
|
@@ -199,14 +204,25 @@ embed billing snapshot create --account <account_id> [--from <iso>] [--to <iso>]
|
|
|
199
204
|
embed billing snapshot list --account <account_id> [--json]
|
|
200
205
|
embed billing snapshot show <billing_snapshot_id> [--json]
|
|
201
206
|
|
|
207
|
+
embed board registry list [--json]
|
|
208
|
+
embed board methods <template_id> [--json]
|
|
209
|
+
embed board knowledge <template_id> [--json]
|
|
210
|
+
embed board knowledge search <template_id> --query <text> [--json]
|
|
202
211
|
embed build template list [--json]
|
|
203
212
|
embed build template show <template_id> [--json]
|
|
204
|
-
embed
|
|
205
|
-
embed
|
|
206
|
-
embed
|
|
207
|
-
embed
|
|
208
|
-
embed
|
|
209
|
-
embed
|
|
213
|
+
embed local toolchain list [--board <board_id>] [--json]
|
|
214
|
+
embed local toolchain installed [--board <board_id>] [--json]
|
|
215
|
+
embed local toolchain latest [--board <board_id>] [--json]
|
|
216
|
+
embed local toolchain current [--json]
|
|
217
|
+
embed local toolchain install [--board <board_id>] [--mode minimal|runtime|compile|qt|firmware|full|images] [--json]
|
|
218
|
+
embed local toolchain validate [--board <board_id>] [--mode minimal|runtime|compile|qt|firmware|full|images] [--json]
|
|
219
|
+
embed local compile taishanpi --source <main.c|main.cpp> --output <artifact> [--json]
|
|
220
|
+
embed local build qt-smoke --build-dir <build_dir> [--source <qt-cmake-dir>] [--target-name <executable>] [--json]
|
|
221
|
+
|
|
222
|
+
The `qt-smoke` subcommand name is kept for compatibility. When `--source` and
|
|
223
|
+
`--target-name` are supplied, it builds the supplied TaishanPi Qt/CMake
|
|
224
|
+
application, including official board-pack examples such as
|
|
225
|
+
`board-packs/taishanpi/examples/modbus-loop-demo/taishanpi`.
|
|
210
226
|
|
|
211
227
|
embed bridge start [--host 127.0.0.1] [--port 18083]
|
|
212
228
|
embed bridge status [--json]
|
package/dist/index.js
CHANGED
|
@@ -8,7 +8,7 @@ import { arch, hostname, homedir, platform, tmpdir } from "node:os";
|
|
|
8
8
|
import { basename, delimiter, dirname, join, resolve } from "node:path";
|
|
9
9
|
import { fileURLToPath } from "node:url";
|
|
10
10
|
import { composeBootLogoPackage } from "./image-compose.js";
|
|
11
|
-
import { buildTaishanPiQtSmoke, compileTaishanPiSingleFile, currentLocalToolchain, installLocalToolchain, latestLocalToolchain, listLocalToolchainEnvironments, validateLocalToolchain } from "./local-toolchain.js";
|
|
11
|
+
import { buildTaishanPiQtSmoke, compileTaishanPiSingleFile, currentLocalToolchain, installLocalToolchain, latestLocalToolchain, listLocalToolchainEnvironments, uninstallLocalToolchain, validateLocalToolchain } from "./local-toolchain.js";
|
|
12
12
|
import { fail, ok } from "@embed-labs/protocol";
|
|
13
13
|
const require = createRequire(import.meta.url);
|
|
14
14
|
const CLI_MODULE_DIR = dirname(fileURLToPath(import.meta.url));
|
|
@@ -102,9 +102,10 @@ const LOCAL_TOOLCHAIN_INSTALLED_USAGE = "Usage: embed local toolchain installed
|
|
|
102
102
|
const LOCAL_TOOLCHAIN_LATEST_USAGE = "Usage: embed local toolchain latest [--board taishanpi-1m-rk3566|pico2w-rp2350-monitor|coloreasypico2-rp2350-monitor] [--channel stable] [--metadata-root <path>] [--json]";
|
|
103
103
|
const LOCAL_TOOLCHAIN_CURRENT_USAGE = "Usage: embed local toolchain current [--install-root <path>] [--json]";
|
|
104
104
|
const LOCAL_TOOLCHAIN_INSTALL_USAGE = "Usage: embed local toolchain install [--board taishanpi-1m-rk3566|pico2w-rp2350-monitor|coloreasypico2-rp2350-monitor] [--channel stable] [--metadata-root <path>] [--source-url <tar.gz-url>|--source-release-root <path>] [--install-root <path>] [--mode minimal|runtime|compile|qt|firmware|full|images] [--force] [--json]\nDefault source: the production download channel at download.embedboard.com.";
|
|
105
|
+
const LOCAL_TOOLCHAIN_UNINSTALL_USAGE = "Usage: embed local toolchain uninstall --board taishanpi-1m-rk3566|pico2w-rp2350-monitor|coloreasypico2-rp2350-monitor [--install-root <path>] [--json]";
|
|
105
106
|
const LOCAL_TOOLCHAIN_VALIDATE_USAGE = "Usage: embed local toolchain validate [--board taishanpi-1m-rk3566|pico2w-rp2350-monitor|coloreasypico2-rp2350-monitor] [--release-root <path>] [--mode minimal|runtime|compile|qt|firmware|full|images] [--json]";
|
|
106
107
|
const LOCAL_COMPILE_TAISHANPI_USAGE = "Usage: embed local compile taishanpi --source <main.c|main.cpp> --output <artifact> [--release-root <path>] [--account <account_id>] [--json]";
|
|
107
|
-
const LOCAL_BUILD_QT_SMOKE_USAGE = "Usage: embed local build qt-smoke --build-dir <dir> [--source <qt-
|
|
108
|
+
const LOCAL_BUILD_QT_SMOKE_USAGE = "Usage: embed local build qt-smoke --build-dir <dir> [--source <qt-cmake-dir>] [--target-name <executable>] [--release-root <path>] [--account <account_id>] [--json]";
|
|
108
109
|
const AUTH_DEVICE_STATUS_USAGE = "Usage: embed auth device status [--json]";
|
|
109
110
|
const AUTH_DEVICE_LIST_USAGE = "Usage: embed auth device list [--json]";
|
|
110
111
|
const AUTH_DEVICE_REVOKE_USAGE = "Usage: embed auth device revoke <device_id> [--json]";
|
|
@@ -620,6 +621,13 @@ async function main(argv) {
|
|
|
620
621
|
}
|
|
621
622
|
return output(parsed, ok(await installLocalToolchain(request)), renderLocalToolchainInstall);
|
|
622
623
|
}
|
|
624
|
+
if (action === "toolchain" && (parsed.command[2] === "uninstall" || parsed.command[2] === "remove")) {
|
|
625
|
+
const request = localToolchainUninstallRequest(parsed);
|
|
626
|
+
if (typeof request === "string") {
|
|
627
|
+
return output(parsed, fail("invalid_args", request), undefined, 2);
|
|
628
|
+
}
|
|
629
|
+
return output(parsed, ok(await uninstallLocalToolchain(request)), renderLocalToolchainUninstall);
|
|
630
|
+
}
|
|
623
631
|
if (action === "toolchain" && parsed.command[2] === "validate") {
|
|
624
632
|
const request = localToolchainValidateRequest(parsed);
|
|
625
633
|
if (typeof request === "string") {
|
|
@@ -647,6 +655,7 @@ async function main(argv) {
|
|
|
647
655
|
LOCAL_TOOLCHAIN_LATEST_USAGE,
|
|
648
656
|
LOCAL_TOOLCHAIN_CURRENT_USAGE,
|
|
649
657
|
LOCAL_TOOLCHAIN_INSTALL_USAGE,
|
|
658
|
+
LOCAL_TOOLCHAIN_UNINSTALL_USAGE,
|
|
650
659
|
LOCAL_TOOLCHAIN_VALIDATE_USAGE,
|
|
651
660
|
LOCAL_COMPILE_TAISHANPI_USAGE,
|
|
652
661
|
LOCAL_BUILD_QT_SMOKE_USAGE
|
|
@@ -5759,6 +5768,26 @@ function localToolchainInstallRequest(parsed) {
|
|
|
5759
5768
|
force: booleanFlag(parsed, "force")
|
|
5760
5769
|
};
|
|
5761
5770
|
}
|
|
5771
|
+
function localToolchainUninstallRequest(parsed) {
|
|
5772
|
+
const unknownFlag = firstUnknownFlag(parsed, ["json", "board", "board-id", "install-root"]);
|
|
5773
|
+
if (unknownFlag) {
|
|
5774
|
+
return `Unknown flag --${unknownFlag}. ${LOCAL_TOOLCHAIN_UNINSTALL_USAGE}`;
|
|
5775
|
+
}
|
|
5776
|
+
const extra = parsed.command.slice(3);
|
|
5777
|
+
if (extra.length > 0) {
|
|
5778
|
+
return `Unexpected argument: ${extra[0]}. ${LOCAL_TOOLCHAIN_UNINSTALL_USAGE}`;
|
|
5779
|
+
}
|
|
5780
|
+
const board = optionalTrimmedStringAliasFlag(parsed, ["board", "board-id"], "board or board-id");
|
|
5781
|
+
if (board.error)
|
|
5782
|
+
return board.error;
|
|
5783
|
+
if (!board.value) {
|
|
5784
|
+
return LOCAL_TOOLCHAIN_UNINSTALL_USAGE;
|
|
5785
|
+
}
|
|
5786
|
+
const installRoot = optionalTrimmedStringFlag(parsed, "install-root");
|
|
5787
|
+
if (installRoot.error)
|
|
5788
|
+
return installRoot.error;
|
|
5789
|
+
return { boardId: board.value, installRoot: installRoot.value };
|
|
5790
|
+
}
|
|
5762
5791
|
function localToolchainValidateRequest(parsed) {
|
|
5763
5792
|
const unknownFlag = firstUnknownFlag(parsed, ["json", "board", "board-id", "release-root", "mode"]);
|
|
5764
5793
|
if (unknownFlag) {
|
|
@@ -7227,6 +7256,26 @@ function renderLocalToolchainInstall(result) {
|
|
|
7227
7256
|
}
|
|
7228
7257
|
return lines.join("\n");
|
|
7229
7258
|
}
|
|
7259
|
+
function renderLocalToolchainUninstall(result) {
|
|
7260
|
+
const lines = [
|
|
7261
|
+
result.removed ? "Local toolchain uninstalled." : "Local toolchain was not installed.",
|
|
7262
|
+
`board=${result.board_id}`,
|
|
7263
|
+
`install_root=${result.install_root}`,
|
|
7264
|
+
`registry=${result.registry_path}`,
|
|
7265
|
+
`removed_registry_entry=${result.removed_registry_entry}`,
|
|
7266
|
+
`observed_at=${result.observed_at}`
|
|
7267
|
+
];
|
|
7268
|
+
if (result.removed_paths.length > 0) {
|
|
7269
|
+
lines.push("removed_paths:");
|
|
7270
|
+
for (const removedPath of result.removed_paths) {
|
|
7271
|
+
lines.push(` ${removedPath}`);
|
|
7272
|
+
}
|
|
7273
|
+
}
|
|
7274
|
+
if (result.remaining_installed_boards.length > 0) {
|
|
7275
|
+
lines.push(`remaining_installed_boards=${result.remaining_installed_boards.join(",")}`);
|
|
7276
|
+
}
|
|
7277
|
+
return lines.join("\n");
|
|
7278
|
+
}
|
|
7230
7279
|
function renderLocalToolchainValidation(result) {
|
|
7231
7280
|
const lines = [
|
|
7232
7281
|
result.ok ? "Local toolchain ready." : "Local toolchain not ready.",
|
|
@@ -8024,34 +8073,24 @@ Main workflow:
|
|
|
8024
8073
|
embed local toolchain installed
|
|
8025
8074
|
embed local toolchain latest
|
|
8026
8075
|
embed local toolchain install
|
|
8076
|
+
embed local toolchain uninstall --board pico2w-rp2350-monitor
|
|
8027
8077
|
embed local toolchain validate
|
|
8028
8078
|
embed local compile taishanpi --source ./main.c --output ./.embed-labs/build/main
|
|
8029
8079
|
embed local build qt-smoke --build-dir ./.embed-labs/build/qt-smoke
|
|
8030
|
-
|
|
8080
|
+
embed local build qt-smoke --source ./taishanpi-app --target-name app --build-dir ./.embed-labs/build/app
|
|
8081
|
+
6. Query board knowledge and method metadata:
|
|
8031
8082
|
embed board registry list
|
|
8032
8083
|
embed board methods taishanpi-1m-rk3566
|
|
8033
8084
|
embed board knowledge taishanpi-1m-rk3566
|
|
8034
8085
|
embed board knowledge search taishanpi-1m-rk3566 --query "UART pinout"
|
|
8035
8086
|
embed build template list
|
|
8036
8087
|
embed build template show <template_id>
|
|
8037
|
-
7.
|
|
8038
|
-
embed build workspace provision --account <account_id> --project <project_id> --template <template_id>
|
|
8039
|
-
embed build resource lease create --workspace <workspace_id> --execution-mode cloud_worker
|
|
8040
|
-
embed build workspace source put <workspace_id> --file ./main.c:src/main.c
|
|
8041
|
-
embed build workspace source list <workspace_id>
|
|
8042
|
-
embed build workspace source get <workspace_id> --path src/main.c --output ./main.c
|
|
8043
|
-
embed build workspace source search <workspace_id> --query init --glob "**/*.c"
|
|
8044
|
-
embed build workspace source patch <workspace_id> --patch ./fix.patch
|
|
8045
|
-
embed build workspace release <workspace_id> --dry-run
|
|
8046
|
-
8. Generate application source on the server and follow artifacts:
|
|
8047
|
-
embed build application generate --workspace <workspace_id> --prompt "Create a minimal Linux app" --provider bai --model gpt-5.2
|
|
8048
|
-
embed build application compile --workspace <workspace_id> --source app/generated.c --execution-mode docker_worker
|
|
8049
|
-
embed build image generate --workspace <workspace_id> --prompt "Generate a minimal TaishanPi image"
|
|
8088
|
+
7. Generate small image packages and compose locally:
|
|
8050
8089
|
embed build image boot-logo --logo ./logo.png --board taishanpi --variant 1M-RK3566 --output ./boot-logo-package.json
|
|
8051
8090
|
embed image boot-logo compose --package ./boot-logo-package.json --base-image ./boot.img --output ./boot-logo.img
|
|
8052
8091
|
embed cloud task artifacts <task_id>
|
|
8053
8092
|
embed artifact download <artifact_id> --output ./artifact.bin
|
|
8054
|
-
|
|
8093
|
+
8. Check credits or create a recharge QR:
|
|
8055
8094
|
embed billing balance --account <account_id>
|
|
8056
8095
|
embed billing tokens --account <account_id>
|
|
8057
8096
|
embed billing ledger --account <account_id>
|
|
@@ -8065,7 +8104,7 @@ Local hardware:
|
|
|
8065
8104
|
embed agent run --prompt "部署泰山派应用" --host 198.19.77.2 --artifact ./artifact.bin --remote-path /userdata/embed-labs/apps/app --approve --run
|
|
8066
8105
|
embed agent run --prompt "部署生成的泰山派应用" --host 198.19.77.2 --artifact-task <task_id> --remote-path /userdata/embed-labs/apps/app --approve --run
|
|
8067
8106
|
embed tool list
|
|
8068
|
-
embed tool call device.probe --input-json '{"host":"198.19.77.2","ports":[22
|
|
8107
|
+
embed tool call device.probe --input-json '{"host":"198.19.77.2","ports":[22]}'
|
|
8069
8108
|
embed tool call wifi.scan --input-json '{"host":"198.19.77.2","user":"root"}'
|
|
8070
8109
|
embed tool call rp2350.monitor.spi.transfer --input-json '{"hex":"a55a3cc3"}' --approve
|
|
8071
8110
|
embed tool call chip.temperature --input-json '{"host":"198.19.77.2","user":"root"}'
|
|
@@ -8076,9 +8115,11 @@ Local hardware:
|
|
|
8076
8115
|
embed local toolchain latest
|
|
8077
8116
|
embed local toolchain current
|
|
8078
8117
|
embed local toolchain install
|
|
8118
|
+
embed local toolchain uninstall --board pico2w-rp2350-monitor
|
|
8079
8119
|
embed local toolchain validate
|
|
8080
8120
|
embed local compile taishanpi --source ./main.c --output ./.embed-labs/build/main
|
|
8081
8121
|
embed local build qt-smoke --build-dir ./.embed-labs/build/qt-smoke
|
|
8122
|
+
embed local build qt-smoke --source ./taishanpi-app --target-name app --build-dir ./.embed-labs/build/app
|
|
8082
8123
|
embed image boot-logo compose --package ./boot-logo-package.json --base-image ./boot.img --output ./boot-logo.img
|
|
8083
8124
|
embed deploy taishanpi --host 198.19.77.2 --artifact ./artifact.bin --approve --run
|
|
8084
8125
|
embed flash plan --board <rp2350|taishanpi>
|
|
@@ -8156,6 +8197,7 @@ Cloud build path:
|
|
|
8156
8197
|
embed local toolchain validate
|
|
8157
8198
|
embed local compile taishanpi --source ./main.c --output ./.embed-labs/build/main
|
|
8158
8199
|
embed local build qt-smoke --build-dir ./.embed-labs/build/qt-smoke
|
|
8200
|
+
embed local build qt-smoke --source ./taishanpi-app --target-name app --build-dir ./.embed-labs/build/app
|
|
8159
8201
|
embed board registry list
|
|
8160
8202
|
embed board registry show taishanpi-1m-rk3566
|
|
8161
8203
|
embed board methods taishanpi-1m-rk3566
|
|
@@ -8171,9 +8213,6 @@ Cloud build path:
|
|
|
8171
8213
|
embed build workspace source search <workspace_id> --query init --glob "**/*.c"
|
|
8172
8214
|
embed build workspace source patch <workspace_id> --patch ./fix.patch
|
|
8173
8215
|
embed build workspace release <workspace_id> --dry-run
|
|
8174
|
-
embed build application generate --workspace <workspace_id> --prompt "Create a minimal Linux app" --provider bai --model gpt-5.2
|
|
8175
|
-
embed build application compile --workspace <workspace_id> --source app/generated.c --execution-mode docker_worker
|
|
8176
|
-
embed build image generate --workspace <workspace_id> --prompt "Generate a minimal TaishanPi image"
|
|
8177
8216
|
embed build image boot-logo --logo ./logo.png --board taishanpi --variant 1M-RK3566 --output ./boot-logo-package.json
|
|
8178
8217
|
embed image boot-logo compose --package ./boot-logo-package.json --base-image ./boot.img --output ./boot-logo.img
|
|
8179
8218
|
embed cloud task status <task_id>
|
|
@@ -8204,7 +8243,7 @@ Local hardware path:
|
|
|
8204
8243
|
embed run "验证开发板状态"
|
|
8205
8244
|
embed tool list
|
|
8206
8245
|
embed tool call debug.tools.scan
|
|
8207
|
-
embed tool call device.probe --input-json '{"host":"198.19.77.2","ports":[22
|
|
8246
|
+
embed tool call device.probe --input-json '{"host":"198.19.77.2","ports":[22]}'
|
|
8208
8247
|
embed device list
|
|
8209
8248
|
embed deploy taishanpi --host 198.19.77.2 --artifact ./artifact.bin --approve --run
|
|
8210
8249
|
embed flash plan --board <rp2350|taishanpi> --artifact ./artifact.bin
|
|
@@ -8289,9 +8328,10 @@ Usage:
|
|
|
8289
8328
|
embed local toolchain current [--install-root <path>] [--json]
|
|
8290
8329
|
embed local toolchain install [--board taishanpi-1m-rk3566|pico2w-rp2350-monitor|coloreasypico2-rp2350-monitor] [--channel stable] [--metadata-root <path>] [--source-url <tar.gz-url>|--source-release-root <path>] [--install-root <path>] [--mode minimal|runtime|compile|qt|firmware|full|images] [--force] [--json]
|
|
8291
8330
|
Defaults to the production download channel at download.embedboard.com.
|
|
8331
|
+
embed local toolchain uninstall --board taishanpi-1m-rk3566|pico2w-rp2350-monitor|coloreasypico2-rp2350-monitor [--install-root <path>] [--json]
|
|
8292
8332
|
embed local toolchain validate [--board taishanpi-1m-rk3566|pico2w-rp2350-monitor|coloreasypico2-rp2350-monitor] [--release-root <path>] [--mode minimal|runtime|compile|qt|firmware|full|images] [--json]
|
|
8293
8333
|
embed local compile taishanpi --source <main.c|main.cpp> --output <artifact> [--release-root <path>] [--account <account_id>] [--json]
|
|
8294
|
-
embed local build qt-smoke --build-dir <dir> [--source <qt-
|
|
8334
|
+
embed local build qt-smoke --build-dir <dir> [--source <qt-cmake-dir>] [--target-name <executable>] [--release-root <path>] [--account <account_id>] [--json]
|
|
8295
8335
|
embed debug tools [--json]
|
|
8296
8336
|
embed tool list [--json]
|
|
8297
8337
|
embed tool call wifi.scan --input-json '{"host":"198.19.77.2","user":"root"}' [--json]
|