@karlorz/codexhost-cli 0.17.4-7 → 0.18.0-0

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,21 +5,50 @@ Run Pi and Claude Code as first-class external harnesses inside Codex Desktop.
5
5
  ## Install
6
6
 
7
7
  ```bash
8
- npm install -g @karlorz/codexhost-cli@0.17.4-7
8
+ npm install -g @karlorz/codexhost-cli@0.18.0-0
9
9
  ```
10
10
 
11
- npm automatically installs the matching macOS, Windows, or Linux platform package. Node.js 22.19.0 or later, except 23.x 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
  codexhost --version
17
17
  codexhost
18
+ codexhost web
19
+ codexhost status
20
+ codexhost autostart on
21
+ codexhost autostart status
22
+ codexhost stop
18
23
  codexhost remote install
19
24
  codexhost remote status
20
25
  ```
21
26
 
22
- The `codexhost` command starts Codex Desktop. 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 `codexhost` attaches to the same controlled instance.
27
+ The `codexhost` 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 `codexhost` attaches to the same controlled instance.
28
+
29
+ `codexhost 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 `codexhost`.
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 `codexhost 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. `codexhost status` is read-only and shows Host/Web versions, the token-free Web address, the last Web failure and autostart status. `codexhost 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. `codexhost 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 `codexhost` 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
+ codexhost stop
45
+ codexhost autostart off
46
+ npm uninstall -g @karlorz/codexhost-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
 
package/bin/codexhost.js CHANGED
@@ -6,7 +6,7 @@ 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.17.4-7";
9
+ const version = "0.18.0-0";
10
10
  const minimumNodeVersion = "22.19.0";
11
11
  const excludedNodeRange = {"from":"23.0.0","to":"24.0.0"};
12
12
  const userArguments = process.argv.slice(2);
@@ -247,8 +247,15 @@ if (userArguments.length === 0) {
247
247
  launchArguments = ["launch"];
248
248
  } else if (userArguments[0] === "launch" || userArguments[0] === "restart") {
249
249
  launchArguments = userArguments;
250
- } else if (userArguments[0] === "inspect") {
250
+ } else if (userArguments[0] === "inspect" || userArguments[0] === "status" || userArguments[0] === "autostart") {
251
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") {
256
+ if (userArguments[1] !== "ensure" && userArguments[1] !== "stop") fail("host expects 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)];
252
259
  } else if (userArguments[0] === "console" || userArguments[0] === "update") {
253
260
  launchArguments = null;
254
261
  consoleArguments = userArguments.slice(1);
@@ -264,7 +271,9 @@ if (userArguments.length === 0) {
264
271
  userArguments[0] === "harness" ||
265
272
  userArguments[0] === "delegate" ||
266
273
  userArguments[0] === "thread" ||
267
- userArguments[0] === "enroll"
274
+ userArguments[0] === "enroll" ||
275
+ userArguments[0] === "client" ||
276
+ userArguments[0] === "events"
268
277
  ) {
269
278
  launchArguments = null;
270
279
  delegationArguments = userArguments;
@@ -275,20 +284,27 @@ if (userArguments.length === 0) {
275
284
  " codexhost",
276
285
  " codexhost --version",
277
286
  " codexhost inspect",
287
+ " codexhost web [--host address] [--port port] [--public-url url] [--trusted-proxy addresses]",
288
+ " codexhost stop",
289
+ " codexhost status",
290
+ " codexhost autostart on|off|status",
278
291
  " codexhost console",
279
292
  " codexhost update",
280
293
  " codexhost restart",
281
294
  " codexhost launch [launcher options]",
282
295
  " codexhost remote install|start|stop|status|uninstall",
283
296
  " codexhost broker install|status|stop|uninstall",
297
+ " codexhost host ensure|stop [--data directory]",
284
298
  " codexhost delegate --help",
285
299
  " codexhost harness inspect ...",
286
300
  " codexhost delegate start ...",
287
- " codexhost thread send|cancel|read|wait|list ...",
301
+ " codexhost thread send|cancel|read|wait|watch|watches|list ...",
288
302
  " codexhost enroll [--client <id>]|status|revoke ...",
303
+ " codexhost client add|list|remove ...",
304
+ " codexhost events [--after <id>] [--limit <n>] [--follow true|false]",
289
305
  "",
290
306
  "This npm package uses the current Node.js runtime and the packaged",
291
- "Rust launcher/shim. Codex Desktop must already be installed.",
307
+ "Rust launcher/shim. Without Codex Desktop, codexhost opens Web.",
292
308
  ].join("\n"),
293
309
  );
294
310
  process.exit(0);
@@ -489,7 +505,8 @@ if (consoleArguments !== null) {
489
505
  if (finished) return;
490
506
  finished = true;
491
507
  startupTrace("Launcher finished startup with code " + code);
492
- process.exit(code);
508
+ // Flush queued startup output without waiting for the supervising Launcher.
509
+ process.stdout.end((error) => process.exit(error ? code || 1 : code));
493
510
  };
494
511
  child.stdout.setEncoding("utf8");
495
512
  let ready = false;
@@ -498,14 +515,17 @@ if (consoleArguments !== null) {
498
515
  child.stdout.on("data", (chunk) => {
499
516
  if (ready) return;
500
517
  const output = launcherOutput + chunk;
501
- if (output.includes(readyMarker)) {
518
+ const marker = output.indexOf(readyMarker);
519
+ if (marker !== -1) {
520
+ process.stdout.write(output.slice(0, marker));
502
521
  ready = true;
503
522
  launcherOutput = "";
504
523
  startupTrace("received Launcher ready");
505
524
  if (!keepLauncherForeground) finish(0);
506
525
  return;
507
526
  }
508
- // Only retain the tail needed to recognize a marker split across chunks.
527
+ // Retain only a possible split readiness marker; forward service results unchanged.
528
+ process.stdout.write(output.slice(0, Math.max(0, output.length - readyMarker.length + 1)));
509
529
  launcherOutput = output.slice(1 - readyMarker.length);
510
530
  });
511
531
  child.on("error", (error) => {
@@ -514,6 +534,7 @@ if (consoleArguments !== null) {
514
534
  });
515
535
  child.on("exit", (code, signal) => {
516
536
  startupTrace(ready ? "Launcher exited after ready" : "Launcher exited before ready");
537
+ if (!ready) process.stdout.write(launcherOutput);
517
538
  if (signal) {
518
539
  process.kill(process.pid, signal);
519
540
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@karlorz/codexhost-cli",
3
- "version": "0.17.4-7",
3
+ "version": "0.18.0-0",
4
4
  "description": "Run Pi and Claude Code as first-class external harnesses inside Codex Desktop.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -14,12 +14,12 @@
14
14
  "node": ">=22.19.0 <23.0.0 || >=24.0.0"
15
15
  },
16
16
  "optionalDependencies": {
17
- "@karlorz/codexhost-cli-darwin-arm64": "0.17.4-7",
18
- "@karlorz/codexhost-cli-darwin-x64": "0.17.4-7",
19
- "@karlorz/codexhost-cli-win32-x64": "0.17.4-7",
20
- "@karlorz/codexhost-cli-win32-arm64": "0.17.4-7",
21
- "@karlorz/codexhost-cli-linux-x64": "0.17.4-7",
22
- "@karlorz/codexhost-cli-linux-arm64": "0.17.4-7"
17
+ "@karlorz/codexhost-cli-darwin-arm64": "0.18.0-0",
18
+ "@karlorz/codexhost-cli-darwin-x64": "0.18.0-0",
19
+ "@karlorz/codexhost-cli-win32-x64": "0.18.0-0",
20
+ "@karlorz/codexhost-cli-win32-arm64": "0.18.0-0",
21
+ "@karlorz/codexhost-cli-linux-x64": "0.18.0-0",
22
+ "@karlorz/codexhost-cli-linux-arm64": "0.18.0-0"
23
23
  },
24
24
  "keywords": [
25
25
  "codex",