@liberseek/boft-cli 0.8.5 → 0.8.7

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
@@ -5,24 +5,53 @@ BOFT CLI runs Pi and other external harnesses inside Codex Desktop.
5
5
  ## Install
6
6
 
7
7
  ```bash
8
- npm install -g @liberseek/boft-cli@0.8.5
8
+ npm install -g @liberseek/boft-cli@0.8.7
9
9
  ```
10
10
 
11
- npm automatically installs the matching macOS, Windows, or Linux platform package. Node.js 22 or 24 and the official ChatGPT/Codex Desktop are required.
11
+ npm automatically installs the matching macOS, Windows, or Linux platform package. Node.js 22.19.0 or later, except 23.x is required. Official ChatGPT/Codex Desktop is only required for the Desktop interface; Web is included and works without it.
12
12
 
13
13
  ## Usage
14
14
 
15
15
  ```bash
16
16
  boft --version
17
17
  boft
18
+ boft web
19
+ boft status
20
+ boft autostart on
21
+ boft autostart status
22
+ boft stop
18
23
  boft remote install
19
24
  boft remote status
20
25
  ```
21
26
 
22
- The `boft` command starts Codex Desktop. `codexhost` remains available as a compatibility alias. On macOS and Linux it returns immediately while the packaged Launcher keeps supervising in the background. On Windows, the command remains attached until Codex Desktop exits so shells that clean up process trees of completed commands cannot discard the supervisor. Re-running `boft` attaches to the same controlled instance.
27
+ The `boft` command starts Codex Desktop and background Web; without Desktop installed it opens Web instead. On macOS and Linux it returns immediately while the packaged Launcher keeps supervising in the background. On Windows, the command remains attached until Codex Desktop exits so shells that clean up process trees of completed commands cannot discard the supervisor. Re-running `boft` attaches to the same controlled instance. `codexhost` remains available as a compatibility alias.
28
+
29
+ `boft web` ensures Host and Web run in the background, prints a local login link and opens a browser. Over SSH or without a graphical session it only prints the link. Closing the terminal, Desktop or browser leaves Host and Web running; the computer must stay awake and connected. `CODEXHOST_WEB_SERVICE=0` disables Web startup alongside `boft`.
30
+
31
+ Web initially listens on `127.0.0.1:4400`. Use the local Connect devices page for LAN access and Tailscale Serve, or run `boft web --host 0.0.0.0 --port 4500`. The options `--host`, `--port`, `--public-url` and `--trusted-proxy` are validated and saved for later starts; an empty value clears an option. Changing them restarts only Web, disconnecting Web terminals but not Host tasks. An occupied port fails without killing its owner or selecting another port. LAN HTTP is unencrypted.
32
+
33
+ Matching services are reused. A different version or installation replaces the running services; replacing Host interrupts tasks without confirmation. `boft status` is read-only and shows Host/Web versions, the token-free Web address, the last Web failure and autostart status. `boft stop` stops managed Desktop, Web, Host, remote services, Broker and Console in that order, reports interrupted Host tasks, and preserves session data and configuration. A Desktop opened independently is not closed. Remote services return when another computer reconnects; interrupted tasks do not resume automatically.
34
+
35
+ Autostart is off by default. `boft autostart on|off|status` manages current-user login startup; it starts Host and Web without opening a browser. Linux requires systemd user services; linger is user-managed. Running `boft` refreshes enabled autostart with the current Node and CLI paths.
36
+
37
+ Office preview components are downloaded from the npm registry on first use on the Web computer, not the phone. No documents are uploaded for conversion. Download failure affects only Office previews; retry after checking the computer's network.
38
+
39
+ ## Uninstall or downgrade
40
+
41
+ Before removing this package or switching to a version without background Web support:
42
+
43
+ ```bash
44
+ boft stop
45
+ boft autostart off
46
+ npm uninstall -g @liberseek/boft-cli
47
+ ```
48
+
49
+ Tailscale Serve configuration remains after stopping or uninstalling. Check `tailscale serve status`; only if the HTTPS 443 root path still points to this Web, remove it with `tailscale serve --https=443 --set-path=/ off` (substitute the actual HTTPS port). This leaves other paths intact. While Web is running, the local Connect devices page can also disable Serve after confirmation.
50
+
51
+ ## Notes
23
52
 
24
53
  On macOS, `remote install` installs a current-user Aqua Harness broker so Background SSH Hosts can use native Claude Code login without reading, copying, or unlocking Keychain credentials.
25
54
 
26
55
  If installation used `--omit=optional`, reinstall without that option so npm can select the native package for the current architecture.
27
56
 
28
- If startup reports a platform package version mismatch, close Codex Desktop and run the exact reinstall command in the error. This installs both the CLI and its platform package at the same version, replacing stale independently installed payloads. `codexhost --version` reports the CLI package version; startup also validates the platform payload before launching it.
57
+ If startup reports a platform package version mismatch, close Codex Desktop and run the exact reinstall command in the error. This installs both the CLI and its platform package at the same version, replacing stale independently installed payloads. `boft --version` reports the CLI package version; startup also validates the platform payload before launching it.
package/bin/boft.js CHANGED
@@ -6,9 +6,29 @@ import { homedir } from "node:os";
6
6
  import path from "node:path";
7
7
  import { fileURLToPath } from "node:url";
8
8
 
9
- const version = "0.8.5";
9
+ const version = "0.8.7";
10
+ const minimumNodeVersion = "22.19.0";
11
+ const excludedNodeRange = {"from":"23.0.0","to":"24.0.0"};
10
12
  const userArguments = process.argv.slice(2);
11
- const repositoryUrl = "https://github.com/BytePioneer-AI/codex-host";
13
+ {
14
+ const compare = (left, right) => {
15
+ const a = left.split(".").map(Number);
16
+ const b = right.split(".").map(Number);
17
+ return a[0] - b[0] || a[1] - b[1] || a[2] - b[2];
18
+ };
19
+ const current = process.versions.node;
20
+ if (
21
+ compare(current, minimumNodeVersion) < 0 ||
22
+ (compare(current, excludedNodeRange.from) >= 0 &&
23
+ compare(current, excludedNodeRange.to) < 0)
24
+ ) {
25
+ console.error(
26
+ `boft: Node.js ${current} is not supported; @liberseek/boft-cli requires Node.js 22.19.0 or later, except 23.x.`,
27
+ );
28
+ process.exit(1);
29
+ }
30
+ }
31
+ const repositoryUrl = "https://github.com/LIBERSEEK/BOFT-CLI";
12
32
  const startupTraceStartedAt = Date.now();
13
33
  function startupTrace(stage) {
14
34
  if (process.env.CODEXHOST_STARTUP_TRACE !== "1") return;
@@ -227,21 +247,34 @@ if (userArguments.length === 0) {
227
247
  launchArguments = ["launch"];
228
248
  } else if (userArguments[0] === "launch") {
229
249
  launchArguments = userArguments;
230
- } else if (userArguments[0] === "inspect") {
250
+ } else if (userArguments[0] === "inspect" || userArguments[0] === "status" || userArguments[0] === "autostart") {
231
251
  launchArguments = userArguments;
252
+ } else if (userArguments[0] === "web" || userArguments[0] === "stop") {
253
+ launchArguments = [userArguments[0], "--node", process.execPath, "--host-runtime", hostRuntime,
254
+ "--web-runtime", path.join(packageRoot, "app", "web-server.mjs"), ...userArguments.slice(1)];
255
+ } else if (userArguments[0] === "host" && !["info", "--help", "-h", "help"].includes(userArguments[1])) {
256
+ if (userArguments[1] !== "ensure" && userArguments[1] !== "stop") fail("host expects info, ensure or stop");
257
+ launchArguments = ["host", userArguments[1], "--node", process.execPath, "--host-runtime", hostRuntime,
258
+ "--data", updateEnvironment.CODEXHOST_DATA_DIR || path.join(homedir(), ".codexhost"), ...userArguments.slice(2)];
232
259
  } else if (userArguments[0] === "console" || userArguments[0] === "update") {
233
260
  launchArguments = null;
234
261
  consoleArguments = userArguments.slice(1);
235
262
  } else if (userArguments[0] === "remote") {
236
263
  launchArguments = null;
237
- remoteArguments = userArguments.slice(1);
264
+ // The packaged resources are appended after the subcommand; without one, the
265
+ // first injected option would be read as the subcommand. Show usage instead.
266
+ remoteArguments = userArguments.length > 1 ? userArguments.slice(1) : ["help"];
238
267
  } else if (userArguments[0] === "broker") {
239
268
  launchArguments = null;
240
269
  brokerArguments = userArguments.slice(1);
241
270
  } else if (
242
271
  userArguments[0] === "harness" ||
272
+ userArguments[0] === "host" ||
273
+ userArguments[0] === "project" ||
243
274
  userArguments[0] === "delegate" ||
244
- userArguments[0] === "thread"
275
+ userArguments[0] === "thread" ||
276
+ userArguments[0] === "client" ||
277
+ userArguments[0] === "events"
245
278
  ) {
246
279
  launchArguments = null;
247
280
  delegationArguments = userArguments;
@@ -252,18 +285,27 @@ if (userArguments.length === 0) {
252
285
  " boft",
253
286
  " boft --version",
254
287
  " boft inspect",
288
+ " boft web [--host address] [--port port] [--public-url url] [--trusted-proxy addresses] [--relay control-host]",
289
+ " boft stop",
290
+ " boft status",
291
+ " boft autostart on|off|status",
255
292
  " boft console",
256
293
  " boft update",
257
294
  " boft launch [launcher options]",
258
295
  " boft remote install|start|stop|status|uninstall",
259
296
  " boft broker install|status|stop|uninstall",
297
+ " boft host ensure|stop [--data directory]",
298
+ " boft host info [--refresh true|false]",
299
+ " boft project list [--query text] [--refresh true|false]",
260
300
  " boft delegate --help",
261
301
  " boft harness inspect ...",
262
302
  " boft delegate start ...",
263
- " boft thread send|cancel|read|wait|list ...",
303
+ " boft thread send|cancel|read|wait|watch|watches|list|file ...",
304
+ " boft client add|list|remove ...",
305
+ " boft events [--after <id>] [--limit <n>] [--follow true|false]",
264
306
  "",
265
307
  "This npm package uses the current Node.js runtime and the packaged",
266
- "Rust launcher/shim. Codex Desktop must already be installed.",
308
+ "Rust launcher/shim. Without Codex Desktop, boft opens Web.",
267
309
  ].join("\n"),
268
310
  );
269
311
  process.exit(0);
@@ -289,7 +331,9 @@ if (launchArguments?.[0] === "launch") {
289
331
  }
290
332
  }
291
333
  const extras = [];
292
- if (!injected.has("--node")) extras.push("--node", process.execPath);
334
+ if (!injected.has("--node") && process.platform !== "darwin") {
335
+ extras.push("--node", process.execPath);
336
+ }
293
337
  if (!injected.has("--shim")) extras.push("--shim", shim);
294
338
  if (!injected.has("--host-runtime")) extras.push("--host-runtime", hostRuntime);
295
339
  if (!injected.has("--desktop-controller")) {
@@ -462,7 +506,8 @@ if (consoleArguments !== null) {
462
506
  if (finished) return;
463
507
  finished = true;
464
508
  startupTrace("Launcher finished startup with code " + code);
465
- process.exit(code);
509
+ // Flush queued startup output without waiting for the supervising Launcher.
510
+ process.stdout.end((error) => process.exit(error ? code || 1 : code));
466
511
  };
467
512
  child.stdout.setEncoding("utf8");
468
513
  let ready = false;
@@ -471,14 +516,17 @@ if (consoleArguments !== null) {
471
516
  child.stdout.on("data", (chunk) => {
472
517
  if (ready) return;
473
518
  const output = launcherOutput + chunk;
474
- if (output.includes(readyMarker)) {
519
+ const marker = output.indexOf(readyMarker);
520
+ if (marker !== -1) {
521
+ process.stdout.write(output.slice(0, marker));
475
522
  ready = true;
476
523
  launcherOutput = "";
477
524
  startupTrace("received Launcher ready");
478
525
  if (!keepLauncherForeground) finish(0);
479
526
  return;
480
527
  }
481
- // Only retain the tail needed to recognize a marker split across chunks.
528
+ // Retain only a possible split readiness marker; forward service results unchanged.
529
+ process.stdout.write(output.slice(0, Math.max(0, output.length - readyMarker.length + 1)));
482
530
  launcherOutput = output.slice(1 - readyMarker.length);
483
531
  });
484
532
  child.on("error", (error) => {
@@ -487,6 +535,7 @@ if (consoleArguments !== null) {
487
535
  });
488
536
  child.on("exit", (code, signal) => {
489
537
  startupTrace(ready ? "Launcher exited after ready" : "Launcher exited before ready");
538
+ if (!ready) process.stdout.write(launcherOutput);
490
539
  if (signal) {
491
540
  process.kill(process.pid, signal);
492
541
  return;
package/bin/codexhost.js CHANGED
@@ -6,9 +6,29 @@ import { homedir } from "node:os";
6
6
  import path from "node:path";
7
7
  import { fileURLToPath } from "node:url";
8
8
 
9
- const version = "0.8.5";
9
+ const version = "0.8.7";
10
+ const minimumNodeVersion = "22.19.0";
11
+ const excludedNodeRange = {"from":"23.0.0","to":"24.0.0"};
10
12
  const userArguments = process.argv.slice(2);
11
- const repositoryUrl = "https://github.com/BytePioneer-AI/codex-host";
13
+ {
14
+ const compare = (left, right) => {
15
+ const a = left.split(".").map(Number);
16
+ const b = right.split(".").map(Number);
17
+ return a[0] - b[0] || a[1] - b[1] || a[2] - b[2];
18
+ };
19
+ const current = process.versions.node;
20
+ if (
21
+ compare(current, minimumNodeVersion) < 0 ||
22
+ (compare(current, excludedNodeRange.from) >= 0 &&
23
+ compare(current, excludedNodeRange.to) < 0)
24
+ ) {
25
+ console.error(
26
+ `boft: Node.js ${current} is not supported; @liberseek/boft-cli requires Node.js 22.19.0 or later, except 23.x.`,
27
+ );
28
+ process.exit(1);
29
+ }
30
+ }
31
+ const repositoryUrl = "https://github.com/LIBERSEEK/BOFT-CLI";
12
32
  const startupTraceStartedAt = Date.now();
13
33
  function startupTrace(stage) {
14
34
  if (process.env.CODEXHOST_STARTUP_TRACE !== "1") return;
@@ -227,21 +247,34 @@ if (userArguments.length === 0) {
227
247
  launchArguments = ["launch"];
228
248
  } else if (userArguments[0] === "launch") {
229
249
  launchArguments = userArguments;
230
- } else if (userArguments[0] === "inspect") {
250
+ } else if (userArguments[0] === "inspect" || userArguments[0] === "status" || userArguments[0] === "autostart") {
231
251
  launchArguments = userArguments;
252
+ } else if (userArguments[0] === "web" || userArguments[0] === "stop") {
253
+ launchArguments = [userArguments[0], "--node", process.execPath, "--host-runtime", hostRuntime,
254
+ "--web-runtime", path.join(packageRoot, "app", "web-server.mjs"), ...userArguments.slice(1)];
255
+ } else if (userArguments[0] === "host" && !["info", "--help", "-h", "help"].includes(userArguments[1])) {
256
+ if (userArguments[1] !== "ensure" && userArguments[1] !== "stop") fail("host expects info, ensure or stop");
257
+ launchArguments = ["host", userArguments[1], "--node", process.execPath, "--host-runtime", hostRuntime,
258
+ "--data", updateEnvironment.CODEXHOST_DATA_DIR || path.join(homedir(), ".codexhost"), ...userArguments.slice(2)];
232
259
  } else if (userArguments[0] === "console" || userArguments[0] === "update") {
233
260
  launchArguments = null;
234
261
  consoleArguments = userArguments.slice(1);
235
262
  } else if (userArguments[0] === "remote") {
236
263
  launchArguments = null;
237
- remoteArguments = userArguments.slice(1);
264
+ // The packaged resources are appended after the subcommand; without one, the
265
+ // first injected option would be read as the subcommand. Show usage instead.
266
+ remoteArguments = userArguments.length > 1 ? userArguments.slice(1) : ["help"];
238
267
  } else if (userArguments[0] === "broker") {
239
268
  launchArguments = null;
240
269
  brokerArguments = userArguments.slice(1);
241
270
  } else if (
242
271
  userArguments[0] === "harness" ||
272
+ userArguments[0] === "host" ||
273
+ userArguments[0] === "project" ||
243
274
  userArguments[0] === "delegate" ||
244
- userArguments[0] === "thread"
275
+ userArguments[0] === "thread" ||
276
+ userArguments[0] === "client" ||
277
+ userArguments[0] === "events"
245
278
  ) {
246
279
  launchArguments = null;
247
280
  delegationArguments = userArguments;
@@ -252,18 +285,27 @@ if (userArguments.length === 0) {
252
285
  " boft",
253
286
  " boft --version",
254
287
  " boft inspect",
288
+ " boft web [--host address] [--port port] [--public-url url] [--trusted-proxy addresses] [--relay control-host]",
289
+ " boft stop",
290
+ " boft status",
291
+ " boft autostart on|off|status",
255
292
  " boft console",
256
293
  " boft update",
257
294
  " boft launch [launcher options]",
258
295
  " boft remote install|start|stop|status|uninstall",
259
296
  " boft broker install|status|stop|uninstall",
297
+ " boft host ensure|stop [--data directory]",
298
+ " boft host info [--refresh true|false]",
299
+ " boft project list [--query text] [--refresh true|false]",
260
300
  " boft delegate --help",
261
301
  " boft harness inspect ...",
262
302
  " boft delegate start ...",
263
- " boft thread send|cancel|read|wait|list ...",
303
+ " boft thread send|cancel|read|wait|watch|watches|list|file ...",
304
+ " boft client add|list|remove ...",
305
+ " boft events [--after <id>] [--limit <n>] [--follow true|false]",
264
306
  "",
265
307
  "This npm package uses the current Node.js runtime and the packaged",
266
- "Rust launcher/shim. Codex Desktop must already be installed.",
308
+ "Rust launcher/shim. Without Codex Desktop, boft opens Web.",
267
309
  ].join("\n"),
268
310
  );
269
311
  process.exit(0);
@@ -289,7 +331,9 @@ if (launchArguments?.[0] === "launch") {
289
331
  }
290
332
  }
291
333
  const extras = [];
292
- if (!injected.has("--node")) extras.push("--node", process.execPath);
334
+ if (!injected.has("--node") && process.platform !== "darwin") {
335
+ extras.push("--node", process.execPath);
336
+ }
293
337
  if (!injected.has("--shim")) extras.push("--shim", shim);
294
338
  if (!injected.has("--host-runtime")) extras.push("--host-runtime", hostRuntime);
295
339
  if (!injected.has("--desktop-controller")) {
@@ -462,7 +506,8 @@ if (consoleArguments !== null) {
462
506
  if (finished) return;
463
507
  finished = true;
464
508
  startupTrace("Launcher finished startup with code " + code);
465
- process.exit(code);
509
+ // Flush queued startup output without waiting for the supervising Launcher.
510
+ process.stdout.end((error) => process.exit(error ? code || 1 : code));
466
511
  };
467
512
  child.stdout.setEncoding("utf8");
468
513
  let ready = false;
@@ -471,14 +516,17 @@ if (consoleArguments !== null) {
471
516
  child.stdout.on("data", (chunk) => {
472
517
  if (ready) return;
473
518
  const output = launcherOutput + chunk;
474
- if (output.includes(readyMarker)) {
519
+ const marker = output.indexOf(readyMarker);
520
+ if (marker !== -1) {
521
+ process.stdout.write(output.slice(0, marker));
475
522
  ready = true;
476
523
  launcherOutput = "";
477
524
  startupTrace("received Launcher ready");
478
525
  if (!keepLauncherForeground) finish(0);
479
526
  return;
480
527
  }
481
- // Only retain the tail needed to recognize a marker split across chunks.
528
+ // Retain only a possible split readiness marker; forward service results unchanged.
529
+ process.stdout.write(output.slice(0, Math.max(0, output.length - readyMarker.length + 1)));
482
530
  launcherOutput = output.slice(1 - readyMarker.length);
483
531
  });
484
532
  child.on("error", (error) => {
@@ -487,6 +535,7 @@ if (consoleArguments !== null) {
487
535
  });
488
536
  child.on("exit", (code, signal) => {
489
537
  startupTrace(ready ? "Launcher exited after ready" : "Launcher exited before ready");
538
+ if (!ready) process.stdout.write(launcherOutput);
490
539
  if (signal) {
491
540
  process.kill(process.pid, signal);
492
541
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@liberseek/boft-cli",
3
- "version": "0.8.5",
3
+ "version": "0.8.7",
4
4
  "description": "BOFT CLI runs Pi and other external harnesses inside Codex Desktop.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -12,15 +12,15 @@
12
12
  "README.md"
13
13
  ],
14
14
  "engines": {
15
- "node": ">=22"
15
+ "node": ">=22.19.0 <23.0.0 || >=24.0.0"
16
16
  },
17
17
  "optionalDependencies": {
18
- "@liberseek/boft-cli-darwin-arm64": "0.8.5",
19
- "@liberseek/boft-cli-darwin-x64": "0.8.5",
20
- "@liberseek/boft-cli-win32-x64": "0.8.5",
21
- "@liberseek/boft-cli-win32-arm64": "0.8.5",
22
- "@liberseek/boft-cli-linux-x64": "0.8.5",
23
- "@liberseek/boft-cli-linux-arm64": "0.8.5"
18
+ "@liberseek/boft-cli-darwin-arm64": "0.8.7",
19
+ "@liberseek/boft-cli-darwin-x64": "0.8.7",
20
+ "@liberseek/boft-cli-win32-x64": "0.8.7",
21
+ "@liberseek/boft-cli-win32-arm64": "0.8.7",
22
+ "@liberseek/boft-cli-linux-x64": "0.8.7",
23
+ "@liberseek/boft-cli-linux-arm64": "0.8.7"
24
24
  },
25
25
  "keywords": [
26
26
  "codex",