@codexhost/cli

中文文档
0.18.0发布于 2026/11/12ES Module零依赖构建来源已验证近 30 天下载 4415

Run Pi and Claude Code as first-class external harnesses inside Codex Desktop.

原始使用文档
文档目录4 节
  1. Install
  2. Usage
  3. Uninstall or downgrade
  4. Notes

@codexhost/cli

Run Pi and Claude Code as first-class external harnesses inside Codex Desktop.

Install

npm install -g @codexhost/[email protected]

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.

Usage

codexhost --version
codexhost
codexhost web
codexhost status
codexhost autostart on
codexhost autostart status
codexhost stop
codexhost remote install
codexhost remote status

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.

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.

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.

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.

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.

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.

Uninstall or downgrade

Before removing this package or switching to a version without background Web support:

codexhost stop
codexhost autostart off
npm uninstall -g @codexhost/cli

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.

Notes

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.

If installation used --omit=optional, reinstall without that option so npm can select the native package for the current architecture.

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.

版本与发布记录

@codexhost/cli 共发布 66 个版本,首次发布于 2026/08/04;过去 12 个月发布了 66 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.18.0latest2026/11/12今天
0.18.0-beta.5next2026/11/111 天前
0.18.0-beta.42026/11/102 天前
0.18.0-beta.32026/11/093 天前
0.18.0-beta.12026/11/084 天前
0.17.42026/11/075 天前

其他发布通道:test → 0.9.1-test.2,next → 0.18.0-beta.5。

关于 @codexhost/cli 的常见问题

@codexhost/cli 是什么?

Run Pi and Claude Code as first-class external harnesses inside Codex Desktop.

如何安装 @codexhost/cli?

在项目目录运行 npm install @codexhost/cli,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 codexhost,可以用 npx codexhost 直接运行。

@codexhost/cli 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/codexhost__cli 是否存在。

@codexhost/cli 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@codexhost/cli 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=22.19.0 <23.0.0 || >=24.0.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@codexhost/cli 可以商用吗?

@codexhost/cli 使用 未声明 许可。package.json 没有声明许可证。没有许可证的代码默认保留全部权利,商用前请联系作者或查看仓库中的 LICENSE 文件。以上为概括,不构成法律意见,请以许可原文为准。

@codexhost/cli 的下载量有多少?

根据 npm 官方下载统计,@codexhost/cli 在 2026/10/10 – 2026/11/08 这 30 天内被下载 4,415 次,日均约 147 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@codexhost/cli 还在维护吗?

最新版本 0.18.0 发布于 2026/11/12(今天);至今共发布 66 个版本,其中过去 12 个月发布了 66 个;首次发布于 2026/08/04。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。