@kvell007/embed-labs-cli 0.1.0-alpha.50 → 0.1.0-alpha.51

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
@@ -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
- - Server-side application source generation through Cloud API agents, followed by
26
- task artifacts and downloads.
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 the cloud build path:
120
+ For board knowledge and local toolchain work:
121
121
 
122
122
  ```bash
123
- embed build template list
124
- embed build template show <template_id>
125
- embed build workspace provision --account <account_id> --project <project_id> --template <template_id>
126
- embed build workspace source put <workspace_id> --file ./main.c:src/main.c
127
- embed build application generate --workspace <workspace_id> --prompt "Create a minimal Linux app"
128
- embed cloud task artifacts <task_id>
129
- embed artifact download <artifact_id> --output ./artifact.bin
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,20 @@ 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 build workspace provision --account <account_id> --project <project_id> [--template <template_id>] [--copy-mode auto|copy|symlink|skeleton] [--require-seed] [--dry-run] [--json]
205
- embed build workspace list --account <account_id> [--json]
206
- embed build workspace show <workspace_id> [--json]
207
- embed build workspace source put <workspace_id> [--account <account_id>] --file <local_path>:<source_path> [--file <local_path>:<source_path>] [--json]
208
- embed build application stub --workspace <workspace_id> [--account <account_id>] [--json]
209
- embed build application generate --workspace <workspace_id> --prompt <request> [--account <account_id>] [--target <source_path>] [--provider stub|openai|cc|claude-code] [--model <model>] [--json]
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> [--json]
210
221
 
211
222
  embed bridge start [--host 127.0.0.1] [--port 18083]
212
223
  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,6 +102,7 @@ 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
108
  const LOCAL_BUILD_QT_SMOKE_USAGE = "Usage: embed local build qt-smoke --build-dir <dir> [--source <qt-smoke-dir>] [--release-root <path>] [--account <account_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,23 @@ 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
- 6. Pick a cloud build template:
8080
+ 6. Query board knowledge and method metadata:
8031
8081
  embed board registry list
8032
8082
  embed board methods taishanpi-1m-rk3566
8033
8083
  embed board knowledge taishanpi-1m-rk3566
8034
8084
  embed board knowledge search taishanpi-1m-rk3566 --query "UART pinout"
8035
8085
  embed build template list
8036
8086
  embed build template show <template_id>
8037
- 7. Provision and populate a build workspace:
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"
8087
+ 7. Generate small image packages and compose locally:
8050
8088
  embed build image boot-logo --logo ./logo.png --board taishanpi --variant 1M-RK3566 --output ./boot-logo-package.json
8051
8089
  embed image boot-logo compose --package ./boot-logo-package.json --base-image ./boot.img --output ./boot-logo.img
8052
8090
  embed cloud task artifacts <task_id>
8053
8091
  embed artifact download <artifact_id> --output ./artifact.bin
8054
- 9. Check credits or create a recharge QR:
8092
+ 8. Check credits or create a recharge QR:
8055
8093
  embed billing balance --account <account_id>
8056
8094
  embed billing tokens --account <account_id>
8057
8095
  embed billing ledger --account <account_id>
@@ -8065,7 +8103,7 @@ Local hardware:
8065
8103
  embed agent run --prompt "部署泰山派应用" --host 198.19.77.2 --artifact ./artifact.bin --remote-path /userdata/embed-labs/apps/app --approve --run
8066
8104
  embed agent run --prompt "部署生成的泰山派应用" --host 198.19.77.2 --artifact-task <task_id> --remote-path /userdata/embed-labs/apps/app --approve --run
8067
8105
  embed tool list
8068
- embed tool call device.probe --input-json '{"host":"198.19.77.2","ports":[22,15301]}'
8106
+ embed tool call device.probe --input-json '{"host":"198.19.77.2","ports":[22]}'
8069
8107
  embed tool call wifi.scan --input-json '{"host":"198.19.77.2","user":"root"}'
8070
8108
  embed tool call rp2350.monitor.spi.transfer --input-json '{"hex":"a55a3cc3"}' --approve
8071
8109
  embed tool call chip.temperature --input-json '{"host":"198.19.77.2","user":"root"}'
@@ -8076,6 +8114,7 @@ Local hardware:
8076
8114
  embed local toolchain latest
8077
8115
  embed local toolchain current
8078
8116
  embed local toolchain install
8117
+ embed local toolchain uninstall --board pico2w-rp2350-monitor
8079
8118
  embed local toolchain validate
8080
8119
  embed local compile taishanpi --source ./main.c --output ./.embed-labs/build/main
8081
8120
  embed local build qt-smoke --build-dir ./.embed-labs/build/qt-smoke
@@ -8171,9 +8210,6 @@ Cloud build path:
8171
8210
  embed build workspace source search <workspace_id> --query init --glob "**/*.c"
8172
8211
  embed build workspace source patch <workspace_id> --patch ./fix.patch
8173
8212
  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
8213
  embed build image boot-logo --logo ./logo.png --board taishanpi --variant 1M-RK3566 --output ./boot-logo-package.json
8178
8214
  embed image boot-logo compose --package ./boot-logo-package.json --base-image ./boot.img --output ./boot-logo.img
8179
8215
  embed cloud task status <task_id>
@@ -8204,7 +8240,7 @@ Local hardware path:
8204
8240
  embed run "验证开发板状态"
8205
8241
  embed tool list
8206
8242
  embed tool call debug.tools.scan
8207
- embed tool call device.probe --input-json '{"host":"198.19.77.2","ports":[22,15301]}'
8243
+ embed tool call device.probe --input-json '{"host":"198.19.77.2","ports":[22]}'
8208
8244
  embed device list
8209
8245
  embed deploy taishanpi --host 198.19.77.2 --artifact ./artifact.bin --approve --run
8210
8246
  embed flash plan --board <rp2350|taishanpi> --artifact ./artifact.bin
@@ -8289,6 +8325,7 @@ Usage:
8289
8325
  embed local toolchain current [--install-root <path>] [--json]
8290
8326
  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
8327
  Defaults to the production download channel at download.embedboard.com.
8328
+ embed local toolchain uninstall --board taishanpi-1m-rk3566|pico2w-rp2350-monitor|coloreasypico2-rp2350-monitor [--install-root <path>] [--json]
8292
8329
  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
8330
  embed local compile taishanpi --source <main.c|main.cpp> --output <artifact> [--release-root <path>] [--account <account_id>] [--json]
8294
8331
  embed local build qt-smoke --build-dir <dir> [--source <qt-smoke-dir>] [--release-root <path>] [--account <account_id>] [--json]