nolo-cli 0.1.51 → 0.1.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.
Files changed (3) hide show
  1. package/README.md +119 -150
  2. package/index.js +18657 -13711
  3. package/package.json +7 -3
package/README.md CHANGED
@@ -1,70 +1,55 @@
1
1
  # @nolo/cli
2
2
 
3
- Agent-first terminal client for Nolo.
3
+ 面向 Agent 的 Nolo 终端客户端。
4
4
 
5
- `nolo` should be understood as the terminal workspace for Nolo agents. The
6
- existing command mode still wraps repo scripts, but the product direction is a
7
- TUI-first experience similar to Claude Code / Codex CLI:
5
+ `nolo` 是 Nolo 智能体的终端工作空间。现有的命令模式仍然包装仓库脚本,但产品方向是类似于 Claude Code / Codex CLI 的 TUI 优先体验:
8
6
 
9
- - open `nolo` and work inside a persistent Agent session;
10
- - chat with an Agent;
11
- - inspect and manage that Agent's dialogs, docs, tables, skills, and spaces;
12
- - run internal ops/doctor agents with the same mental model;
13
- - use non-interactive commands and `--json` for automation.
7
+ - 打开 `nolo`,在持久的 Agent 会话中工作;
8
+ - 与 Agent 聊天;
9
+ - 检查和管理该 Agent 的 dialogs、docs、tables、skills 和 spaces;
10
+ - 以同样的心智模型运行内部 ops/doctor agents;
11
+ - 使用非交互式命令和 `--json` 进行自动化。
14
12
 
15
- The current MVP uses a dependency-free readline workspace. It is intentionally
16
- small: status line, text input, lightweight slash commands, and script-backed
17
- Agent chat. A richer Ink UI can replace the rendering layer later without
18
- changing the session model.
13
+ 当前的 MVP 使用无依赖的 readline 工作空间。它故意保持小巧:状态行、文本输入、轻量级斜杠命令和脚本驱动的 Agent 聊天。未来可以用更丰富的 Ink UI 替换渲染层,而无需更改会话模型。
19
14
 
20
- Inside `nolo`, normal text continues the current dialog after the first agent
21
- reply. Use `/new` when you want a clean dialog. Response token details stay
22
- hidden by default; set `NOLO_SHOW_USAGE=1` when debugging usage.
15
+ 在 `nolo` 内部,收到第一条 Agent 回复后,普通文本继续当前 dialog。需要清空 dialog 时使用 `/new`。响应的 token 详情默认隐藏;调试用量时设置 `NOLO_SHOW_USAGE=1`。
23
16
 
24
- Nolo is intentionally not trying to copy coding-only CLIs one-for-one. Claude
25
- Code, Codex CLI, and Copilot CLI are strongest when a developer is already
26
- inside a codebase. Nolo's CLI should sit between ordinary users and developers:
27
- one assistant by default, with specialist agents, docs, tables, dialogs, and
28
- synced workspace data one slash command away.
17
+ Nolo 并非试图逐字复刻纯编码 CLI。Claude Code、Codex CLI 和 Copilot CLI 在开发者已进入代码库时表现最佳。Nolo 的 CLI 应介于普通用户和开发者之间:默认提供一个助理,而专业 agent、docs、tables、dialogs 和同步工作空间数据只需一个斜杠命令。
29
18
 
30
- ## Usage
19
+ ## 使用说明
31
20
 
32
21
  ```bash
33
22
  npm install -g nolo-cli
34
23
  nolo
35
24
 
36
- # see which install you are running
25
+ # 查看当前运行的安装版本
37
26
  nolo doctor
38
27
  nolo --version
39
28
 
40
- # no Nolo login required: runs the local Codex CLI in the current directory
29
+ # 无需 Nolo 登录:在当前目录运行本地 Codex CLI
41
30
  nolo run "review this repository"
42
31
 
43
- # update later from your shell
32
+ # 稍后从 shell 更新
44
33
  nolo update
45
34
  ```
46
35
 
47
- Inside the TUI, run:
36
+ 在 TUI 内部运行:
48
37
 
49
38
  ```text
50
39
  /update
51
40
  ```
52
41
 
53
- The published npm package runs on plain Node.js (no Bun required). The
54
- shipped entry is a bundled `index.js` with a `#!/usr/bin/env node` shebang.
42
+ 发布的 npm 包在纯 Node.js 上运行(不需要 Bun)。打包入口是一个包含 `#!/usr/bin/env node` shebang 的单一 bundle `index.js`。
55
43
 
56
- For local maintainer workflows, `nolo run "..."` does not require a Nolo
57
- account. It resolves to the built-in `local-codex` agent, runs in the current
58
- working directory, and uses the local Codex CLI installation. This is intended
59
- for repository-local review, triage, and release-check tasks.
44
+ 对于本地维护者工作流,`nolo run "..."` 不需要 Nolo 账户。它会解析为内置的 `local-codex` agent,在当前工作目录运行,并使用本地 Codex CLI 安装。这适用于仓库本地的审查、分类和发布检查任务。
60
45
 
61
- Remote Nolo records and synced workflows still require a token:
46
+ 远程 Nolo 记录和同步工作流仍需要 token:
62
47
 
63
48
  ```bash
64
49
  NOLO_SERVER=https://nolo.chat AUTH_TOKEN=<token> nolo
65
50
  ```
66
51
 
67
- Or save a local profile once:
52
+ 或者一次性保存本地配置文件:
68
53
 
69
54
  ```bash
70
55
  nolo login --server https://nolo.chat
@@ -72,25 +57,21 @@ nolo whoami
72
57
  nolo
73
58
  ```
74
59
 
75
- By default, `nolo login` opens the Nolo website and waits for browser
76
- authorization. In SSH or browserless environments, use:
60
+ 默认情况下,`nolo login` 打开 Nolo 网站并等待浏览器授权。在 SSH 或无浏览器环境中,使用:
77
61
 
78
62
  ```bash
79
63
  nolo login --no-browser
80
64
  ```
81
65
 
82
- Then open the printed URL on a logged-in browser. Automation can still save a
83
- token directly:
66
+ 然后在已登录的浏览器中打开打印的 URL。自动化也可以直接保存 token:
84
67
 
85
68
  ```bash
86
69
  nolo login --server https://nolo.chat --token <token>
87
70
  ```
88
71
 
89
- Local repo development should use `nolo login` or an explicit `AUTH_TOKEN` for
90
- agent runs.
72
+ 本地仓库开发应使用 `nolo login` 或显式 `AUTH_TOKEN` 来运行 agent。
91
73
 
92
- Inside the TUI, `/update` is the shortcut for the same global `nolo update`
93
- command.
74
+ 在 TUI 内部,`/update` 是全局 `nolo update` 命令的快捷方式。
94
75
 
95
76
  ```bash
96
77
  nolo --help
@@ -117,65 +98,55 @@ nolo agent smoke-current agent-user-1-agent-1 --msg "ping"
117
98
  nolo chat --agent agent-pub-01APPBUILDER00000001YAII3I --msg "你好"
118
99
  ```
119
100
 
120
- For document creation, prefer the CLI over direct scripts. Use `nolo doc create`
121
- for ordinary pages and `nolo skill-doc create` for skill-backed pages. Both
122
- support `--sync`, `--dry-run`, `--json`, and `--allow-secrets`, and both write
123
- for the current auth token user rather than a demo bootstrap user.
101
+ 创建文档时,优先使用 CLI 而非直接脚本。普通页面使用 `nolo doc create`,技能驱动的页面使用 `nolo skill-doc create`。两者都支持 `--sync`、`--dry-run`、`--json` 和 `--allow-secrets`,并且都使用当前认证 token 的用户身份写入,而非 demo 引导用户。
124
102
 
125
- Experimental machine connector commands:
103
+ 实验性机器连接器命令:
126
104
 
127
105
  ```bash
128
- nolo connect # send one machine heartbeat
129
- nolo connect --watch # keep this terminal process online with periodic heartbeats
130
- nolo connect --ws # keep a live connector websocket for bound agent runs
131
- nolo connect --daemon # start connect --ws silently in the background
106
+ nolo connect # 发送一次机器心跳
107
+ nolo connect --watch # 通过周期性心跳保持此终端进程在线
108
+ nolo connect --ws # 为绑定的 agent 运行保持实时连接器 websocket
109
+ nolo connect --daemon # 在后台静默启动 connect --ws
132
110
  nolo daemon --server-url https://api.nolo.chat --machine-key sk_machine_xxx
133
- nolo machine status # list machines registered to the current profile
111
+ nolo machine status # 列出注册到当前配置文件的机器
134
112
  ```
135
113
 
136
- These commands only register machine presence and runtime capabilities today.
137
- They do not expose shell, file-write, or raw local LLM endpoints.
114
+ 目前这些命令仅注册机器存在性和运行时能力。它们不会暴露 shell、文件写入或原始本地 LLM 端点。
138
115
 
139
- Run a Slock-style connector command:
116
+ 运行 Slock 风格的连接器命令:
140
117
 
141
118
  ```bash
142
119
  nolo daemon --server-url https://api.nolo.chat --machine-key sk_machine_xxx
143
120
  ```
144
121
 
145
- Future published package shape:
122
+ 未来发布的包形态:
146
123
 
147
124
  ```bash
148
125
  npx @nolo/daemon@latest --server-url https://api.nolo.chat --machine-key sk_machine_xxx
149
126
  ```
150
127
 
151
- The daemon registers this computer, reports local CLI capabilities, keeps a live
152
- websocket open, and executes bound CLI agents on this computer. Agents bind to a
153
- machine, not to a workspace or project folder.
128
+ daemon 注册本台计算机、报告本地 CLI 能力、保持实时 websocket 连接,并在此计算机上执行绑定的 CLI agents。Agent 绑定到机器,而非工作空间或项目文件夹。
154
129
 
155
- Bind an agent to the current machine:
130
+ 将 agent 绑定到当前机器:
156
131
 
157
132
  ```bash
158
133
  nolo agent bind-current <agentKey>
159
134
  ```
160
135
 
161
- The agent keeps its own CLI settings. The binding only records which connected
162
- machine must be online when that agent runs.
136
+ Agent 保持自己的 CLI 设置。绑定仅记录哪个已连接的机器在该 agent 运行时必须在线。
163
137
 
164
- Run a one-command connector smoke test:
138
+ 运行单命令连接器冒烟测试:
165
139
 
166
140
  ```bash
167
141
  nolo agent runtime-doctor <agentKey>
168
142
  nolo agent smoke-current <agentKey> --msg "ping"
169
143
  ```
170
144
 
171
- `runtime-doctor` checks whether the agent is a CLI agent and whether the current
172
- machine has the required CLI capability. `smoke-current` heartbeats the current
173
- machine, binds the agent to it, opens a temporary connector websocket, calls
174
- `/api/agent/run`, and prints the returned dialog id/content.
145
+ `runtime-doctor` 检查该 agent 是否为 CLI agent 以及当前机器是否具有所需的 CLI 能力。`smoke-current` 向当前机器发送心跳,将 agent 绑定到该机器,打开临时的连接器 websocket,调用 `/api/agent/run`,并打印返回的 dialog id/content。
175
146
 
176
- ## Product Shape
147
+ ## 产品形态
177
148
 
178
- The preferred command model is Agent-first:
149
+ 推荐的命令模型是 Agent 优先:
179
150
 
180
151
  ```bash
181
152
  nolo agent list
@@ -190,60 +161,38 @@ nolo dialog list --space <space>
190
161
  nolo dialog read <dialog>
191
162
  nolo dialog delete <dialog...> --yes
192
163
  nolo doc list --agent <agent>
193
- nolo table query --table meta-0e95801d90-NOLOTASKBOARD --limit 20
194
- nolo table query --table meta-0e95801d90-NOLOTASKBOARD --columns '["title","status","owner","priority","codeStatus"]' --no-base-fields --output items
195
- nolo table update-row --table meta-0e95801d90-NOLOTASKBOARD --row 01ROWID --changes '{"status":"已完成"}'
196
- nolo table add-column --table meta-0e95801d90-NOLOTASKBOARD --schema-write-ok --name "blockedBy" --label "Blocked By"
164
+ nolo table query --table meta-0e95801d90-01KWSK4Q4TESXQ06SW39JN2TTJ --limit 20
165
+ nolo table query --table meta-0e95801d90-01KWSK4Q4TESXQ06SW39JN2TTJ --columns '["title","status","owner","priority","codeStatus"]' --no-base-fields --output items
166
+ nolo table update-row --table meta-0e95801d90-01KWSK4Q4TESXQ06SW39JN2TTJ --row 01ROWID --changes '{"status":"已完成"}'
167
+ nolo table add-column --table meta-0e95801d90-01KWSK4Q4TESXQ06SW39JN2TTJ --schema-write-ok --name "blockedBy" --label "Blocked By"
197
168
  ```
198
169
 
199
- `agent list` and `dialog list` use global server candidates for the current CLI
200
- profile: the selected `--server` / `NOLO_SERVER` plus known Nolo cluster peers.
201
- List commands merge tombstones so a newer delete on one server hides older live
202
- records from another.
203
-
204
- Delete commands fan out wider by default: the selected server, cluster peers,
205
- `READ_DIALOG_BASE`, and the local dev API origin. That means `nolo dialog delete`
206
- and script helpers such as `deleteRecord()` / `deleteAgentRecords()` delete on
207
- `nolo.chat`, `us.nolo.chat`, and local dev when present—not just the current
208
- `BASE_URL`. Dialog, doc, skill-doc, space, and agent public-record deletes all
209
- use this multi-server path; each server applies the normal tombstone/cascade
210
- behavior for that record type.
211
-
212
- `nolo table add-column` mutates table schema metadata, so it requires
213
- `--schema-write-ok` and should be run serially per table. Row-level table writes
214
- do not require this flag.
215
-
216
- For agent config inspection and small config mutations, prefer the CLI-native
217
- commands instead of ad hoc scripts:
218
-
219
- - `nolo agent list` is CLI-native and prefers the local cache, then degrades to
220
- remote query when the local LevelDB cache is unavailable or locked.
221
- - `nolo agent read <agent>` reads local cached agent records first, then falls
222
- back to remote fetch + local cache refresh across known server candidates.
223
- - if the local LevelDB cache is unavailable or locked, `nolo agent read`
224
- degrades to remote-only lookup instead of hard-failing on the local DB.
225
- - `nolo agent update <agent> ...` is CLI-native and supports small targeted
226
- updates such as `--model`, `--cli-provider`, `--api-source`, and repeated
227
- `--field key=value`.
228
-
229
- Account ownership matters for private agent maintenance. Default new tests,
230
- validation dialogs, task-board writes, machine-bound agent runs, and
231
- user-visible results should write to the current operator account
232
- `0e95801d90`. The legacy
233
- `b2e06f801f` / platform-demo account still owns older public/shared records, but
234
- it is being retired as the default write target. Use `nolo agent read`,
235
- `nolo agent update`, and repo-native helpers as the normal entrypoints; only
236
- owner-only operations that explicitly target legacy records should use the
237
- maintained platform-demo token from `scripts/testUtils.ts` or a regenerated
238
- token from `scripts/generateToken.ts`. Do not copy token strings into docs,
239
- logs, or prompts.
240
-
241
- Inside the current TUI, examples of supported slash commands include:
242
- `/agent`, `/agents`, `/switch`, `/context` (alias `/ctx`), `/dialog`, `/doc`,
243
- `/help`, `/new`, `/customize`, `/login`, `/profile`, `/version`, `/quit`
244
- (alias `/exit`), and `/update` (which maps to `nolo update`).
245
-
246
- Future product-direction examples for the broader TUI command model:
170
+ `agent list` 和 `dialog list` 使用当前 CLI 配置文件的全局服务器候选列表:选定的 `--server` / `NOLO_SERVER` 加上已知的 Nolo 集群对等节点。列表命令会合并墓碑记录,因此一个服务器上较新的删除会隐藏来自另一个服务器的较旧活动记录。
171
+
172
+ 删除命令默认扩散范围更大:选定的服务器、集群对等节点、`READ_DIALOG_BASE` 以及本地开发 API 源。这意味着 `nolo dialog delete` 和脚本助手如 `deleteRecord()` / `deleteAgentRecords()` 会在 `nolo.chat`、`us.nolo.chat` 和本地开发环境(如果存在)上执行删除——而不仅仅是当前的 `BASE_URL`。Dialog、doc、skill-doc、space 和 agent 公共记录的删除都使用此多服务器路径;每个服务器对该记录类型应用通常的墓碑/级联行为。
173
+
174
+ `nolo table add-column` 会改变表 schema 元数据,因此需要 `--schema-write-ok` 并且应当对每个表串行执行。行级表写入不需要此标志。
175
+
176
+ 对于 agent 配置检查和小的配置变更,优先使用 CLI 原生命令而非临时脚本:
177
+
178
+ - `nolo agent list` 是 CLI 原生命令,优先使用本地缓存,当本地 LevelDB 缓存不可用或被锁定时降级为远程查询。
179
+ - `nolo agent read <agent>` 首先读取本地缓存的 agent 记录,然后回退到跨已知服务器候选的远程获取 + 本地缓存刷新。
180
+ - 如果本地 LevelDB 缓存不可用或被锁定,`nolo agent read` 会降级为纯远程查找,而不会在本地数据库上硬失败。
181
+ - `nolo agent update <agent> ...` 是 CLI 原生命令,支持小的定向更新,如 `--model`、`--cli-provider`、`--api-source` 和重复的 `--field key=value`。
182
+ - `nolo agent create <slug> --name <display> [--prompt <text>] [--copy-provider-from <agent>]` 创建私有 agent 记录(需已登录)。
183
+ - `nolo agent email provision <agent> [--purpose <label>] [--local-part pay]` 调用 `/rpc/provisionAgentEmailIdentity` 开通受控收件箱(如 `pay@nolo.chat`)。
184
+ - `nolo agent email bind <agent> --email <address>` 将已有地址绑定到 agent。
185
+ - `nolo agent email create-and-provision <slug> --name <display> [--local-part pay] [--copy-provider-from <agent>]` 一步创建 agent 并开通邮箱。
186
+ - `nolo auth cloudflare [--client-id <id>] [--generate-token] [--zone-name <domain>] [--write-to-env [path]]` 通过 Cloudflare 自托管 OAuth 授权并可选生成 `Zone:Email Routing:Edit` 的 API Token,还可直接写入 `.env`。
187
+
188
+ 账户所有权对私有 agent 维护很重要。默认的新测试、验证 dialogs、任务板写入、机器绑定的 agent 运行和用户可见的结果应写入当前操作员账户 `0e95801d90`。原有的 `b2e06f801f` / platform-demo 账户仍然拥有较旧的公共/共享记录,但正在作为默认写入目标退出使用。使用 `nolo agent read`、`nolo agent update` 和仓库原生助手作为正常入口点;只有明确针对旧记录的所有者专属操作才应使用维护的 platform-demo token(来自 `scripts/testUtils.ts`)或重新生成的 token(来自 `scripts/generateToken.ts`)。不要将 token 字符串复制到文档、日志或提示词中。
189
+
190
+ 在当前 TUI 中,支持的斜杠命令示例包括:
191
+ `/agent`、`/agents`、`/switch`、`/context`(别名 `/ctx`)、`/dialog`、`/doc`、
192
+ `/help`、`/new`、`/customize`、`/login`、`/profile`、`/version`、`/quit`
193
+ (别名 `/exit`)和 `/update`(映射到 `nolo update`)。
194
+
195
+ 更广泛的 TUI 命令模型的未来产品方向示例:
247
196
 
248
197
  ```text
249
198
  /agent list
@@ -253,28 +202,22 @@ Future product-direction examples for the broader TUI command model:
253
202
  /table query builtin-dialog-probe-runs
254
203
  ```
255
204
 
256
- See [`docs/nolo-cli-tui.md`](../../docs/nolo-cli-tui.md) for the product and
257
- technical direction.
205
+ 参见 [`docs/nolo-cli-tui.md`](../../docs/nolo-cli-tui.md) 了解产品和技术方向。
258
206
 
259
- ## Building for Publish
207
+ ## 构建与发布
260
208
 
261
- The CLI is developed in a monorepo with workspace dependencies (`ai` and
262
- `connector-experimental`). To generate a publish-safe package that can be
263
- installed via npm outside the monorepo:
209
+ CLI 在包含工作空间依赖(`ai` 和 `connector-experimental`)的单仓库中开发。要生成可在单仓库外通过 npm 安装的发布安全包:
264
210
 
265
211
  ```bash
266
212
  bun run build:publish
267
213
  ```
268
214
 
269
- This creates a `dist/` directory with:
270
- - A single bundled `index.js` (esbuild, `platform: node`, ESM) with a
271
- `#!/usr/bin/env node` shebang, runnable on plain Node.js without Bun
272
- - Workspace dependencies inlined into the bundle
273
- - A modified package.json with workspace dependencies stripped, `bin.nolo`
274
- pointing at `index.js`, and only `index.js` + `README.md` in `files`
215
+ 这将创建一个 `dist/` 目录,包含:
216
+ - 一个单一的 bundle `index.js`(esbuild、`platform: node`、ESM),带有 `#!/usr/bin/env node` shebang,可在纯 Node.js 上运行,无需 Bun
217
+ - 工作空间依赖内联到 bundle 中
218
+ - 修改后的 package.json,去除了工作空间依赖,`bin.nolo` 指向 `index.js`,`files` 中仅包含 `index.js` + `README.md`
275
219
 
276
- The `dist/` directory is the publish-safe artifact consumed by the CI npm
277
- publish workflow:
220
+ `dist/` 目录是 CI npm 发布工作流使用的发布安全产物:
278
221
 
279
222
  ```bash
280
223
  bun ./scripts/release/prepareCliPublishPackage.ts --out-dir .tmp/nolo-cli-publish
@@ -282,18 +225,44 @@ cd .tmp/nolo-cli-publish
282
225
  npm pack
283
226
  ```
284
227
 
285
- For this repository, the default release path for `nolo-cli` is the GitHub
286
- Actions workflow [`.github/workflows/cli-npm-publish.yml`](../../.github/workflows/cli-npm-publish.yml).
287
- Use local `npm pack` or tarball-based `npm install -g` as preflight verification.
288
- Do not treat manual local `npm publish` as the normal release route unless you
289
- are intentionally debugging the CI publish lane.
290
-
291
- Key differences between repo-local and published versions:
292
- - **Repo-local**: Runs from source (`packages/cli/index.ts`) under Bun
293
- (`bun ./packages/cli/index.ts`, `bun test`) with workspace dependencies
294
- resolved by the monorepo
295
- - **Published**: Runs from the bundled `dist/index.js` under plain Node.js with
296
- workspace dependencies inlined and npm packages declared as `dependencies`
297
-
298
- Repo-local development still uses Bun (`bun test`, `bun ./packages/cli/index.ts`);
299
- only the shipped/published runtime is Bun-free.
228
+ 对于本仓库,`nolo-cli` 的默认发布路径是 GitHub Actions 工作流 [`.github/workflows/cli-npm-publish.yml`](../../.github/workflows/cli-npm-publish.yml)。使用本地 `npm pack` 或基于 tarball 的 `npm install -g` 作为预检验证。除非你正在有意调试 CI 发布通道,否则不要将手动本地 `npm publish` 视为正常发布途径。
229
+
230
+ 仓库本地版本与发布版本的关键区别:
231
+ - **仓库本地**:在 Bun 下从源码运行(`packages/cli/index.ts`)(`bun ./packages/cli/index.ts`、`bun test`),工作空间依赖由 monorepo 解析
232
+ - **发布版本**:在纯 Node.js 下从 bundle `dist/index.js` 运行,工作空间依赖内联,npm 包声明为 `dependencies`
233
+
234
+ 仓库本地开发仍使用 Bun(`bun test`、`bun ./packages/cli/index.ts`);只有发布的运行时不依赖 Bun。
235
+
236
+ ## 原生二进制包
237
+
238
+ `nolo-cli` 现在支持按平台分发的原生二进制包,以提供更快的启动速度和独立的可执行文件(无需用户本地安装 Bun)。模式与 oh-my-pi 的 `pi-natives` 类似:
239
+
240
+ - `nolo-cli` 作为入口包,包含一个 Node.js 兼容的 `index.js` 引导脚本
241
+ - `nolo-cli-darwin-arm64` 等子包包含对应平台的预编译二进制
242
+ - 安装时 npm/bun 只会安装匹配当前平台与架构的可选依赖
243
+ - 引导脚本优先调用原生二进制;缺失时回退到 `bun index.ts`
244
+
245
+ 当前支持的平台:
246
+
247
+ | 平台 | 包名 |
248
+ |---|---|
249
+ | macOS Apple Silicon | `nolo-cli-darwin-arm64` |
250
+
251
+ 构建当前平台的原生包:
252
+
253
+ ```bash
254
+ bun run packages/cli-darwin-arm64/build.ts
255
+ ```
256
+
257
+ 这会在 `packages/cli-darwin-arm64/nolo` 生成一个 Bun `--compile` 独立可执行文件。发布原生包时使用:
258
+
259
+ ```bash
260
+ bun ./scripts/release/prepareCliNativePackage.ts --out-dir .tmp/nolo-cli-native
261
+ npm publish .tmp/nolo-cli-native/nolo-cli-darwin-arm64
262
+ ```
263
+
264
+ 本地开发时,若已生成本地原生二进制,`nolo` 会通过引导脚本自动使用它。若希望强制走源码(例如正在修改 TS 源码),设置环境变量:
265
+
266
+ ```bash
267
+ NOLO_CLI_SOURCE=1 nolo doctor
268
+ ```