@codexhost/cli 0.4.0 → 0.4.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,7 +5,7 @@ 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.4.0
8
+ npm install -g @codexhost/cli@0.4.1
9
9
  ```
10
10
 
11
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.
@@ -15,8 +15,12 @@ npm automatically installs the matching macOS, Windows, or Linux platform packag
15
15
  ```bash
16
16
  codexhost --version
17
17
  codexhost
18
+ codexhost remote install
19
+ codexhost remote status
18
20
  ```
19
21
 
20
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.
21
23
 
24
+ 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
+
22
26
  If installation used `--omit=optional`, reinstall without that option so npm can select the native package for the current architecture.
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.4.0";
9
+ const version = "0.4.1";
10
10
  const userArguments = process.argv.slice(2);
11
11
  const startupTraceStartedAt = Date.now();
12
12
  function startupTrace(stage) {
@@ -190,6 +190,7 @@ if (updateEnvironment.CODEXHOST_REMOTE_SSH_MANAGED === "1") {
190
190
 
191
191
  let launchArguments;
192
192
  let remoteArguments = null;
193
+ let brokerArguments = null;
193
194
  let delegationArguments = null;
194
195
  if (userArguments.length === 0) {
195
196
  launchArguments = ["launch"];
@@ -200,6 +201,9 @@ if (userArguments.length === 0) {
200
201
  } else if (userArguments[0] === "remote") {
201
202
  launchArguments = null;
202
203
  remoteArguments = userArguments.slice(1);
204
+ } else if (userArguments[0] === "broker") {
205
+ launchArguments = null;
206
+ brokerArguments = userArguments.slice(1);
203
207
  } else if (
204
208
  userArguments[0] === "harness" ||
205
209
  userArguments[0] === "delegate" ||
@@ -216,6 +220,7 @@ if (userArguments.length === 0) {
216
220
  " codexhost inspect",
217
221
  " codexhost launch [launcher options]",
218
222
  " codexhost remote install|start|stop|status|uninstall",
223
+ " codexhost broker install|status|stop|uninstall",
219
224
  " codexhost delegate --help",
220
225
  " codexhost harness inspect ...",
221
226
  " codexhost delegate start ...",
@@ -279,7 +284,50 @@ if (delegationArguments !== null) {
279
284
  }
280
285
  process.exit(code ?? 1);
281
286
  });
287
+ } else if (brokerArguments !== null) {
288
+ const child = spawn(
289
+ launcher,
290
+ [
291
+ "broker",
292
+ ...brokerArguments,
293
+ "--node", process.execPath, "--host-runtime", hostRuntime,
294
+ ],
295
+ {
296
+ env: updateEnvironment,
297
+ stdio: "inherit",
298
+ windowsHide: true,
299
+ },
300
+ );
301
+ child.on("error", (error) => fail(error.message));
302
+ child.on("exit", (code, signal) => {
303
+ if (signal) {
304
+ process.kill(process.pid, signal);
305
+ return;
306
+ }
307
+ process.exit(code ?? 1);
308
+ });
282
309
  } else if (remoteArguments !== null) {
310
+ const runNativeBroker = (command) => {
311
+ const broker = spawn(
312
+ launcher,
313
+ ["broker", command, "--node", process.execPath, "--host-runtime", hostRuntime],
314
+ {
315
+ env: updateEnvironment,
316
+ // remote status is a stable JSON stdout surface. Keep the broker's
317
+ // human-readable status beside it on stderr instead of corrupting JSON.
318
+ stdio: command === "status" ? ["inherit", process.stderr, "inherit"] : "inherit",
319
+ windowsHide: true,
320
+ },
321
+ );
322
+ broker.on("error", (error) => fail(error.message));
323
+ broker.on("exit", (code, signal) => {
324
+ if (signal) {
325
+ process.kill(process.pid, signal);
326
+ return;
327
+ }
328
+ process.exit(code ?? 1);
329
+ });
330
+ };
283
331
  const child = spawn(
284
332
  process.execPath,
285
333
  [
@@ -305,6 +353,20 @@ if (delegationArguments !== null) {
305
353
  process.kill(process.pid, signal);
306
354
  return;
307
355
  }
356
+ if (code === 0 && process.platform === "darwin") {
357
+ if (remoteArguments[0] === "install") {
358
+ runNativeBroker("install");
359
+ return;
360
+ }
361
+ if (remoteArguments[0] === "status") {
362
+ runNativeBroker("status");
363
+ return;
364
+ }
365
+ if (remoteArguments[0] === "uninstall") {
366
+ runNativeBroker("uninstall");
367
+ return;
368
+ }
369
+ }
308
370
  process.exit(code ?? 1);
309
371
  });
310
372
  } else if (launchArguments?.[0] === "launch") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codexhost/cli",
3
- "version": "0.4.0",
3
+ "version": "0.4.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"
15
15
  },
16
16
  "optionalDependencies": {
17
- "@codexhost/cli-darwin-arm64": "0.4.0",
18
- "@codexhost/cli-darwin-x64": "0.4.0",
19
- "@codexhost/cli-win32-x64": "0.4.0",
20
- "@codexhost/cli-win32-arm64": "0.4.0",
21
- "@codexhost/cli-linux-x64": "0.4.0",
22
- "@codexhost/cli-linux-arm64": "0.4.0"
17
+ "@codexhost/cli-darwin-arm64": "0.4.1",
18
+ "@codexhost/cli-darwin-x64": "0.4.1",
19
+ "@codexhost/cli-win32-x64": "0.4.1",
20
+ "@codexhost/cli-win32-arm64": "0.4.1",
21
+ "@codexhost/cli-linux-x64": "0.4.1",
22
+ "@codexhost/cli-linux-arm64": "0.4.1"
23
23
  },
24
24
  "keywords": [
25
25
  "codex",