@yoooclaw/cli 0.0.4 → 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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Yoooclaw
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -3,30 +3,45 @@
3
3
  yoooclaw 独立 CLI 工具 —— 自带后台守护进程(daemon),不依赖 openclaw 客户端在线。
4
4
  设计对齐飞书 [lark-cli](https://github.com/larksuite/cli):Service-oriented 命令树、三层命令体系(Shortcuts / Service Commands / Raw API)、统一 `--format`、Agent-Native。
5
5
 
6
- 需求详见 [docs/features/prd-yoooclaw-standalone-cli.md](../../docs/features/prd-yoooclaw-standalone-cli.md)。
6
+ 完整文档见 [packages/docs/src/cli](../docs/src/cli)。
7
7
 
8
- > **状态:脚手架阶段。** 命令树、全局 flags、统一输出 / 错误层、profile 解析、目录布局已贯通;
9
- > 各 service 的真实逻辑按后续 imp 文档逐个落地,当前 action 返回 `YOOOCLAW_NOT_IMPLEMENTED` 占位。
8
+ > **状态:可用。** 配置、认证、daemon、通知、录音、图片、灯效规则、监控、Relay、日志、gateway 自检和 raw API 等 service 命令已落地;本地查询类可纯读磁盘,控制类通过本地 daemon 协作。
10
9
 
11
10
  ## 安装与命令
12
11
 
13
- 免安装(npx,每次拉取最新版):
12
+ 两种分发渠道,二者**功能一致**,按需选择:
13
+
14
+ ### A. npm(需要 Node ≥ 22.12.0)
14
15
 
15
16
  ```bash
16
- npx @yoooclaw/cli --help # 主命令
17
+ # 免安装(每次拉最新版)
18
+ npx @yoooclaw/cli --help
17
19
  npx @yoooclaw/cli notification +today
20
+
21
+ # 全局安装(提供 yoooclaw / yc 两个命令)
22
+ npm i -g @yoooclaw/cli
23
+ yoooclaw --help
24
+ yc --help
18
25
  ```
19
26
 
20
- 全局安装(提供 `yoooclaw` / `yc` 两个命令):
27
+ ### B. 原生二进制(无需 Node)
28
+
29
+ 单文件可执行(内嵌 Bun runtime),首次安装 ~60–90 MB,冷启动与 Node 相当。
21
30
 
22
31
  ```bash
23
- npm i -g @yoooclaw/cli
24
- yoooclaw --help # 主命令
25
- 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
26
38
  ```
27
39
 
28
- > `npx @yoooclaw/cli` 始终调用 `yoooclaw` 入口(`yoooclaw` `yc` 指向同一可执行文件,npx 不会歧义)。
29
- > 需要 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)。
30
45
 
31
46
  ## 命令体系
32
47
 
@@ -48,11 +63,32 @@ yc --help # 等价短 alias
48
63
  成功与失败共用同一通道(stdout)与可预测结构;失败额外以非零退出码表达:
49
64
 
50
65
  ```json
51
- { "ok": false, "error": { "code": "YOOOCLAW_NOT_IMPLEMENTED", "message": "...", "hint": "..." } }
66
+ { "ok": false, "error": { "code": "YOOOCLAW_DAEMON_NOT_RUNNING", "message": "...", "hint": "..." } }
52
67
  ```
53
68
 
54
69
  错误码统一前缀 `YOOOCLAW_*`(见 [src/errors.ts](src/errors.ts))。
55
70
 
71
+ ## 录音与 Relay
72
+
73
+ 独立 daemon 会复用 `@yoooclaw/phone-notifications` 的录音存储、状态机和 ASR 调度,并通过 `RelayClient + RelayDispatcher` 接收手机端 `recordings.sync` / `POST /recordings`。
74
+
75
+ ```bash
76
+ # api 模式:未写 --api-key 时回退 account 级 ock- key
77
+ yoooclaw recording setup-asr --mode api --language auto --non-interactive
78
+
79
+ # 查询和跟随录音状态事件
80
+ yoooclaw recording list
81
+ yoooclaw recording events --since 1h --limit 50
82
+ yoooclaw recording events --id <recording-id> --watch
83
+ ```
84
+
85
+ 录音配置与事件分别落在当前 profile 的:
86
+
87
+ ```text
88
+ ~/.yoooclaw/profiles/<profile>/recordings/asr-config.json
89
+ ~/.yoooclaw/profiles/<profile>/recordings/state/events.jsonl
90
+ ```
91
+
56
92
  ## Agent Skill
57
93
 
58
94
  随包发布 [skills/](skills/) 下的 SKILL.md(流式查通知、从 stdin 建灯效规则、隧道排查),教 Agent 直接调 `yoooclaw` 命令。在 openclaw 插件里这些 Skill 由 `openclaw.plugin.json` 自动注册;独立 CLI 形态下需手动安装到 Agent 的 skills 发现目录:
@@ -94,4 +130,7 @@ node dist/bin.cjs --help
94
130
  | [src/output/format.ts](src/output/format.ts) | `--format` 统一序列化 + 错误 schema |
95
131
  | [src/errors.ts](src/errors.ts) | `YOOOCLAW_*` 错误码 + `YoooclawError` |
96
132
  | [src/paths.ts](src/paths.ts) | `~/.yoooclaw/` 目录布局解析 |
133
+ | [src/daemon/recording-bridge.ts](src/daemon/recording-bridge.ts) | daemon 形态的 `recordings.sync` 覆盖、ASR fallback 与 in-flight 去重 |
134
+ | [src/daemon/recording-events.ts](src/daemon/recording-events.ts) | 录音状态事件 JSONL 追加日志 |
135
+ | [src/daemon/relay-dispatcher.ts](src/daemon/relay-dispatcher.ts) | Relay 入站帧到 `StandaloneRuntime` 的进程内分发 |
97
136
  | [src/commands/skills.ts](src/commands/skills.ts) | 内置 Skill 列举 / 安装到 Agent skills 目录 |