@codexhost/cli 0.17.4 → 0.18.0-beta.1

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 @codexhost/cli@0.17.4
8
+ npm install -g @codexhost/cli@0.18.0-beta.1
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 @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";
9
+ const version = "0.18.0-beta.1";
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") {
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);
@@ -274,18 +281,23 @@ if (userArguments.length === 0) {
274
281
  " codexhost",
275
282
  " codexhost --version",
276
283
  " codexhost inspect",
284
+ " codexhost web [--host address] [--port port] [--public-url url] [--trusted-proxy addresses]",
285
+ " codexhost stop",
286
+ " codexhost status",
287
+ " codexhost autostart on|off|status",
277
288
  " codexhost console",
278
289
  " codexhost update",
279
290
  " codexhost launch [launcher options]",
280
291
  " codexhost remote install|start|stop|status|uninstall",
281
292
  " codexhost broker install|status|stop|uninstall",
293
+ " codexhost host ensure|stop [--data directory]",
282
294
  " codexhost delegate --help",
283
295
  " codexhost harness inspect ...",
284
296
  " codexhost delegate start ...",
285
297
  " codexhost thread send|cancel|read|wait|list ...",
286
298
  "",
287
299
  "This npm package uses the current Node.js runtime and the packaged",
288
- "Rust launcher/shim. Codex Desktop must already be installed.",
300
+ "Rust launcher/shim. Without Codex Desktop, codexhost opens Web.",
289
301
  ].join("\n"),
290
302
  );
291
303
  process.exit(0);
@@ -486,7 +498,8 @@ if (consoleArguments !== null) {
486
498
  if (finished) return;
487
499
  finished = true;
488
500
  startupTrace("Launcher finished startup with code " + code);
489
- process.exit(code);
501
+ // Flush queued startup output without waiting for the supervising Launcher.
502
+ process.stdout.end((error) => process.exit(error ? code || 1 : code));
490
503
  };
491
504
  child.stdout.setEncoding("utf8");
492
505
  let ready = false;
@@ -495,14 +508,17 @@ if (consoleArguments !== null) {
495
508
  child.stdout.on("data", (chunk) => {
496
509
  if (ready) return;
497
510
  const output = launcherOutput + chunk;
498
- if (output.includes(readyMarker)) {
511
+ const marker = output.indexOf(readyMarker);
512
+ if (marker !== -1) {
513
+ process.stdout.write(output.slice(0, marker));
499
514
  ready = true;
500
515
  launcherOutput = "";
501
516
  startupTrace("received Launcher ready");
502
517
  if (!keepLauncherForeground) finish(0);
503
518
  return;
504
519
  }
505
- // Only retain the tail needed to recognize a marker split across chunks.
520
+ // Retain only a possible split readiness marker; forward service results unchanged.
521
+ process.stdout.write(output.slice(0, Math.max(0, output.length - readyMarker.length + 1)));
506
522
  launcherOutput = output.slice(1 - readyMarker.length);
507
523
  });
508
524
  child.on("error", (error) => {
@@ -511,6 +527,7 @@ if (consoleArguments !== null) {
511
527
  });
512
528
  child.on("exit", (code, signal) => {
513
529
  startupTrace(ready ? "Launcher exited after ready" : "Launcher exited before ready");
530
+ if (!ready) process.stdout.write(launcherOutput);
514
531
  if (signal) {
515
532
  process.kill(process.pid, signal);
516
533
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codexhost/cli",
3
- "version": "0.17.4",
3
+ "version": "0.18.0-beta.1",
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
- "@codexhost/cli-darwin-arm64": "0.17.4",
18
- "@codexhost/cli-darwin-x64": "0.17.4",
19
- "@codexhost/cli-win32-x64": "0.17.4",
20
- "@codexhost/cli-win32-arm64": "0.17.4",
21
- "@codexhost/cli-linux-x64": "0.17.4",
22
- "@codexhost/cli-linux-arm64": "0.17.4"
17
+ "@codexhost/cli-darwin-arm64": "0.18.0-beta.1",
18
+ "@codexhost/cli-darwin-x64": "0.18.0-beta.1",
19
+ "@codexhost/cli-win32-x64": "0.18.0-beta.1",
20
+ "@codexhost/cli-win32-arm64": "0.18.0-beta.1",
21
+ "@codexhost/cli-linux-x64": "0.18.0-beta.1",
22
+ "@codexhost/cli-linux-arm64": "0.18.0-beta.1"
23
23
  },
24
24
  "keywords": [
25
25
  "codex",