@yoooclaw/cli 0.0.5 → 0.0.6

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
@@ -9,23 +9,39 @@ yoooclaw 独立 CLI 工具 —— 自带后台守护进程(daemon),不依
9
9
 
10
10
  ## 安装与命令
11
11
 
12
- 免安装(npx,每次拉取最新版):
12
+ 两种分发渠道,二者**功能一致**,按需选择:
13
+
14
+ ### A. npm(需要 Node ≥ 22.12.0)
13
15
 
14
16
  ```bash
15
- npx @yoooclaw/cli --help # 主命令
17
+ # 免安装(每次拉最新版)
18
+ npx @yoooclaw/cli --help
16
19
  npx @yoooclaw/cli notification +today
20
+
21
+ # 全局安装(提供 yoooclaw / yc 两个命令)
22
+ npm i -g @yoooclaw/cli
23
+ yoooclaw --help
24
+ yc --help
17
25
  ```
18
26
 
19
- 全局安装(提供 `yoooclaw` / `yc` 两个命令):
27
+ ### B. 原生二进制(无需 Node)
28
+
29
+ 单文件可执行(内嵌 Bun runtime),首次安装 ~60–90 MB,冷启动与 Node 相当。
20
30
 
21
31
  ```bash
22
- npm i -g @yoooclaw/cli
23
- yoooclaw --help # 主命令
24
- yc --help # 等价短 alias
32
+ # 自动检测平台、下载、校验 sha256、写到 ~/.local/bin
33
+ curl -fsSL https://raw.githubusercontent.com/Yoooclaw/openclaw-plugin/master/packages/cli/scripts/install.sh | sh
34
+
35
+ # 指定版本 / 安装目录 / 覆盖
36
+ curl -fsSL https://raw.githubusercontent.com/Yoooclaw/openclaw-plugin/master/packages/cli/scripts/install.sh \
37
+ | sh -s -- --version 0.0.5 --dir ~/bin --force
25
38
  ```
26
39
 
27
- > `npx @yoooclaw/cli` 始终调用 `yoooclaw` 入口(`yoooclaw` `yc` 指向同一可执行文件,npx 不会歧义)。
28
- > 需要 Node `>=22.12.0`。
40
+ 支持平台:`darwin-arm64` / `darwin-x64` / `linux-x64` / `linux-arm64`。Windows 暂走 npm。
41
+
42
+ 二进制也可以从 [GitHub Releases](https://github.com/Yoooclaw/openclaw-plugin/releases?q=cli-v) 手动下载(同 release 内 `checksums.txt` 校验)。
43
+
44
+ > `yoooclaw update self` 会按当前安装来源给出对应升级命令(npm 走 `npm update -g`,二进制走 install.sh)。
29
45
 
30
46
  ## 命令体系
31
47
 
package/dist/bin.cjs CHANGED
@@ -5941,7 +5941,7 @@ function buildContext(flags) {
5941
5941
  var import_node_fs3 = require("node:fs");
5942
5942
  function readBuildInjectedVersion() {
5943
5943
  if (false) {}
5944
- const version = "0.0.5".trim();
5944
+ const version = "0.0.6".trim();
5945
5945
  return version || undefined;
5946
5946
  }
5947
5947
  function readVersionFromPackageJson() {
@@ -5955,6 +5955,15 @@ function readVersionFromPackageJson() {
5955
5955
  }
5956
5956
  }
5957
5957
  var CLI_VERSION = readBuildInjectedVersion() ?? readVersionFromPackageJson() ?? "unknown";
5958
+ function readBuildInjectedDist() {
5959
+ if (false)
5960
+ ;
5961
+ const value = "npm".trim();
5962
+ if (value === "npm" || value === "native" || value === "dev")
5963
+ return value;
5964
+ return;
5965
+ }
5966
+ var CLI_DIST = readBuildInjectedDist() ?? "dev";
5958
5967
 
5959
5968
  // src/fs-utils.ts
5960
5969
  var import_node_fs4 = require("node:fs");
@@ -9966,8 +9975,8 @@ function quantizeWindow(value) {
9966
9975
  init_env();
9967
9976
  async function sendLightEffect(apiKey, segments, logger, repeatInput, reason, title) {
9968
9977
  const apiUrl = getEnvUrls().lightApiUrl;
9969
- const appKey = process.env.LIGHT_APP_KEY;
9970
- const templateId = process.env.LIGHT_TEMPLATE_ID;
9978
+ const appKey = "7Q617S1G5WD274JI";
9979
+ const templateId = "1990771146010017800";
9971
9980
  const resolvedTitle = resolveLightTitle(title, reason, segments);
9972
9981
  logger?.info(`Light sender: apiUrl=${apiUrl ?? "UNSET"}, appKey=${appKey ? appKey.substring(0, 8) + "…" : "UNSET"}, templateId=${templateId ?? "UNSET"}, apiKey=${apiKey ? apiKey.substring(0, 20) + "…" : "EMPTY"}, title=${resolvedTitle}, reason=${reason ?? ""}, segments=${JSON.stringify(segments)}`);
9973
9982
  if (!apiUrl || !appKey || !templateId) {
@@ -12360,8 +12369,43 @@ function migrateFromOpenclaw(ctx, _args, opts) {
12360
12369
  }
12361
12370
 
12362
12371
  // src/commands/update.ts
12372
+ var import_node_os8 = require("node:os");
12363
12373
  var PACKAGE = "@yoooclaw/cli";
12364
12374
  var REGISTRY = "https://registry.npmjs.org";
12375
+ var INSTALL_SH = "https://raw.githubusercontent.com/Yoooclaw/openclaw-plugin/master/packages/cli/scripts/install.sh";
12376
+ function normalizeOs(p) {
12377
+ if (p === "darwin")
12378
+ return "darwin";
12379
+ if (p === "linux")
12380
+ return "linux";
12381
+ return null;
12382
+ }
12383
+ function normalizeArch(a) {
12384
+ if (a === "arm64")
12385
+ return "arm64";
12386
+ if (a === "x64")
12387
+ return "x64";
12388
+ return null;
12389
+ }
12390
+ function nativeTargetName() {
12391
+ const os3 = normalizeOs(import_node_os8.platform());
12392
+ const arch2 = normalizeArch(import_node_os8.arch());
12393
+ if (!os3 || !arch2)
12394
+ return null;
12395
+ return `yoooclaw-${os3}-${arch2}`;
12396
+ }
12397
+ function upgradeCommand(channel, latest) {
12398
+ if (CLI_DIST === "native") {
12399
+ const target = nativeTargetName();
12400
+ if (!target) {
12401
+ return `curl -fsSL ${INSTALL_SH} | sh`;
12402
+ }
12403
+ return `curl -fsSL ${INSTALL_SH} | sh -s -- --version ${latest}`;
12404
+ }
12405
+ if (channel === "beta")
12406
+ return `npm i -g ${PACKAGE}@beta`;
12407
+ return `npm update -g ${PACKAGE}`;
12408
+ }
12365
12409
  function compareSemver(a, b) {
12366
12410
  const pa = a.split("-")[0].split(".").map(Number);
12367
12411
  const pb = b.split("-")[0].split(".").map(Number);
@@ -12403,10 +12447,11 @@ async function updateSelf(_ctx, _args, opts) {
12403
12447
  ok: true,
12404
12448
  package: PACKAGE,
12405
12449
  channel: tag,
12450
+ dist: CLI_DIST,
12406
12451
  current: CLI_VERSION,
12407
12452
  latest,
12408
12453
  updateAvailable,
12409
- command: updateAvailable ? `npm update -g ${PACKAGE}` : null,
12454
+ command: updateAvailable ? upgradeCommand(tag, latest) : null,
12410
12455
  hint: updateAvailable ? "发现新版本;CLI 不做自动更新,请手动执行上面的命令" : "已是最新版本"
12411
12456
  };
12412
12457
  }
@@ -12508,7 +12553,7 @@ function doctor(ctx, _args, opts) {
12508
12553
  // src/commands/skills.ts
12509
12554
  var import_node_fs27 = require("node:fs");
12510
12555
  var import_node_url = require("node:url");
12511
- var import_node_os8 = require("node:os");
12556
+ var import_node_os9 = require("node:os");
12512
12557
  var import_node_path23 = require("node:path");
12513
12558
  var AGENT_IDS = ["claude", "codex"];
12514
12559
  var INSTALL_AGENT_IDS = ["auto", "custom", ...AGENT_IDS];
@@ -12517,10 +12562,10 @@ function trimEnv(name) {
12517
12562
  return value ? value : undefined;
12518
12563
  }
12519
12564
  function claudeHomeDir() {
12520
- return import_node_path23.join(import_node_os8.homedir(), ".claude");
12565
+ return import_node_path23.join(import_node_os9.homedir(), ".claude");
12521
12566
  }
12522
12567
  function codexHomeDir() {
12523
- return trimEnv("CODEX_HOME") ?? import_node_path23.join(import_node_os8.homedir(), ".codex");
12568
+ return trimEnv("CODEX_HOME") ?? import_node_path23.join(import_node_os9.homedir(), ".codex");
12524
12569
  }
12525
12570
  var AGENT_ADAPTERS = [
12526
12571
  {
@@ -14560,5 +14605,5 @@ async function run(argv = process.argv) {
14560
14605
  // src/bin.ts
14561
14606
  run(process.argv);
14562
14607
 
14563
- //# debugId=39E5DEBA0708DE3F64756E2164756E21
14608
+ //# debugId=D266D461288652C764756E2164756E21
14564
14609
  //# sourceMappingURL=bin.cjs.map