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.
- package/README.md +119 -150
- package/index.js +18657 -13711
- package/package.json +7 -3
package/README.md
CHANGED
|
@@ -1,70 +1,55 @@
|
|
|
1
1
|
# @nolo/cli
|
|
2
2
|
|
|
3
|
-
Agent
|
|
3
|
+
面向 Agent 的 Nolo 终端客户端。
|
|
4
4
|
|
|
5
|
-
`nolo`
|
|
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
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
7
|
+
- 打开 `nolo`,在持久的 Agent 会话中工作;
|
|
8
|
+
- 与 Agent 聊天;
|
|
9
|
+
- 检查和管理该 Agent 的 dialogs、docs、tables、skills 和 spaces;
|
|
10
|
+
- 以同样的心智模型运行内部 ops/doctor agents;
|
|
11
|
+
- 使用非交互式命令和 `--json` 进行自动化。
|
|
14
12
|
|
|
15
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
##
|
|
19
|
+
## 使用说明
|
|
31
20
|
|
|
32
21
|
```bash
|
|
33
22
|
npm install -g nolo-cli
|
|
34
23
|
nolo
|
|
35
24
|
|
|
36
|
-
#
|
|
25
|
+
# 查看当前运行的安装版本
|
|
37
26
|
nolo doctor
|
|
38
27
|
nolo --version
|
|
39
28
|
|
|
40
|
-
#
|
|
29
|
+
# 无需 Nolo 登录:在当前目录运行本地 Codex CLI
|
|
41
30
|
nolo run "review this repository"
|
|
42
31
|
|
|
43
|
-
#
|
|
32
|
+
# 稍后从 shell 更新
|
|
44
33
|
nolo update
|
|
45
34
|
```
|
|
46
35
|
|
|
47
|
-
|
|
36
|
+
在 TUI 内部运行:
|
|
48
37
|
|
|
49
38
|
```text
|
|
50
39
|
/update
|
|
51
40
|
```
|
|
52
41
|
|
|
53
|
-
|
|
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
|
-
|
|
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
|
-
|
|
46
|
+
远程 Nolo 记录和同步工作流仍需要 token:
|
|
62
47
|
|
|
63
48
|
```bash
|
|
64
49
|
NOLO_SERVER=https://nolo.chat AUTH_TOKEN=<token> nolo
|
|
65
50
|
```
|
|
66
51
|
|
|
67
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
90
|
-
agent runs.
|
|
72
|
+
本地仓库开发应使用 `nolo login` 或显式 `AUTH_TOKEN` 来运行 agent。
|
|
91
73
|
|
|
92
|
-
|
|
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
|
-
|
|
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
|
-
|
|
103
|
+
实验性机器连接器命令:
|
|
126
104
|
|
|
127
105
|
```bash
|
|
128
|
-
nolo connect #
|
|
129
|
-
nolo connect --watch #
|
|
130
|
-
nolo connect --ws #
|
|
131
|
-
nolo connect --daemon #
|
|
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 #
|
|
111
|
+
nolo machine status # 列出注册到当前配置文件的机器
|
|
134
112
|
```
|
|
135
113
|
|
|
136
|
-
|
|
137
|
-
They do not expose shell, file-write, or raw local LLM endpoints.
|
|
114
|
+
目前这些命令仅注册机器存在性和运行时能力。它们不会暴露 shell、文件写入或原始本地 LLM 端点。
|
|
138
115
|
|
|
139
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
130
|
+
将 agent 绑定到当前机器:
|
|
156
131
|
|
|
157
132
|
```bash
|
|
158
133
|
nolo agent bind-current <agentKey>
|
|
159
134
|
```
|
|
160
135
|
|
|
161
|
-
|
|
162
|
-
machine must be online when that agent runs.
|
|
136
|
+
Agent 保持自己的 CLI 设置。绑定仅记录哪个已连接的机器在该 agent 运行时必须在线。
|
|
163
137
|
|
|
164
|
-
|
|
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`
|
|
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
|
-
##
|
|
147
|
+
## 产品形态
|
|
177
148
|
|
|
178
|
-
|
|
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-
|
|
194
|
-
nolo table query --table meta-0e95801d90-
|
|
195
|
-
nolo table update-row --table meta-0e95801d90-
|
|
196
|
-
nolo table add-column --table meta-0e95801d90-
|
|
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`
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
`
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
`nolo
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
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
|
-
|
|
257
|
-
technical direction.
|
|
205
|
+
参见 [`docs/nolo-cli-tui.md`](../../docs/nolo-cli-tui.md) 了解产品和技术方向。
|
|
258
206
|
|
|
259
|
-
##
|
|
207
|
+
## 构建与发布
|
|
260
208
|
|
|
261
|
-
|
|
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
|
-
|
|
270
|
-
-
|
|
271
|
-
|
|
272
|
-
-
|
|
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
|
-
|
|
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
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
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
|
+
```
|