@bridge4dev/runner

中文文档
0.82.0发布于 2026/10/17MITTypeScriptES Module近 30 天下载 1887

DevBridge dev runner — connects a dev server to DevBridge and runs agent sessions (Claude Code / Codex)

原始使用文档
文档目录9 节
  1. Requirements
  2. Install
  3. Commands
  4. What it does on your machine
  5. Files it owns
  6. What the machine's owner can switch off
  7. Agent CLIs
  8. Updating
  9. License

@bridge4dev/runner

The DevBridge dev runner. It connects one of your own machines to DevBridge and runs coding-agent sessions on it — Claude Code, Codex or OpenCode — against a checkout that never leaves that machine.

DevBridge gets no SSH access and no credentials for your server: the runner connects outwards over WSS and holds the only copy of its own token.

Requirements

  • Node.js ≥ 20
  • git
  • an agent CLI: Claude Code or Codex, installed and signed in from the server card in DevBridge (or already on the machine), or OpenCode – Linux only, installed by the runner into a folder of its own (see Agent CLIs)
  • for OpenCode: bubblewrap – every OpenCode session runs inside it. The DevBridge installer puts it down for a runner that runs as root; a runner that is not root also needs unprivileged user namespaces (on Ubuntu 24.04 an AppArmor profile for bwrap)
  • a DevBridge account with a pairing code (dashboard → Development → Connect server)

Install

npm install -g @bridge4dev/runner

Then pair the machine with the code from the dashboard and install it as a service:

devbridge-runner pair DBR-XXXXXXXX
devbridge-runner install-service
devbridge-runner status          # exit code 0 = connected

install-service writes a systemd user unit (CPUQuota=80%, MemoryMax=2G) and starts it. If you would rather run it in the foreground, or under your own supervisor, use devbridge-runner daemon.

Installing globally may print ERESOLVE warnings about zod: the Claude Agent SDK asks for zod 4 as a peer while the runner uses zod 3. The install succeeds — npm nests its own copy — and nothing is broken. Add --loglevel=error if the noise bothers you.

Commands

CommandWhat it does
pair <DBR-code> [--api <url>] [--name <name>]Claim a pairing code and store the runner token
install-serviceInstall + start the systemd user service
daemonRun in the foreground
statusConnection status; exit code 0 when connected
set-token <dbr_token>Store a token rotated from the dashboard

What it does on your machine

  • Runs a session either in the project folder itself — the default: the branch it is already on, nothing to apply afterwards — or in a git worktree on a session branch of its own, which DevBridge asks for when the folder is busy or a branch was named. Which one a session gets is decided per session, in the dashboard.
  • Enforces a local policy layer. Part of it the dashboard cannot raise: secret files and keys are never read, nothing is written into any repository's .git, and sudo, service control, docker and the firewall are refused in every trust level. Part of it is the bound project's own setting, chosen by a manager in DevBridge: whether the agent may git push and to which branches, and whether it may read and change files outside the project folder — other projects on the same machine included. Out of the box the agent pushes nothing and stays in its folder. Plus secret masking in everything it streams, and its own ceiling on how many sessions may run at once.
  • Streams the session journal with sequence numbers and acknowledgements, so a restart of either side resumes instead of losing work.
  • Never uploads your source. Diffs and file views are requested per file, and files matching the secret denylist are refused.

Files it owns

PathContents
~/.config/devbridge-runner/config.tomlAPI URL, server id, runner token (mode 0600 — this file is the secret store)
~/.local/state/devbridge-runner/Session journals and status.json
…/devbridge-runner/opencode-home/OpenCode: its own npm prefix, its home, and one data folder per subscription (its
keys and conversations, mode 0700) – never on the machine's PATH

Both honour XDG_CONFIG_HOME / XDG_STATE_HOME.

What the machine's owner can switch off

config.toml is read by the runner and cannot be changed from the dashboard — these are the owner's vetoes, and they survive re-pairing. A capability switched off here is not announced to the server at all, so the dashboard draws no control rather than a control that answers «refused».

[verify]
enabled = true          # running the project's own build/test recipe

[checkpoints]
enabled = true          # restore points (copies of the working tree, on this disk)

[agents]
install_enabled = true  # installing and updating the agent CLIs (0.47.0)

[agents] install_enabled = false covers both routes at once: the Install / Update buttons on the server card and the automatic update a session start would otherwise trigger. It is the same download onto the same disk either way.

Agent CLIs

Since 0.47.0 the runner does not carry a Claude binary and the installer does not install agents. claude and codex are ordinary system installs, and the server card shows each one with its version:

  • Install / Update run the vendor's own installer for that agent, at a version the card picked from the registry. Free space is checked first, the new binary is smoke-tested by running it, and a build that will not run is rolled back. The daemon does not restart — sessions already running keep the file they opened, and the new version takes effect for the next one.
  • Auto-update agents (on by default) does the same thing on its own when a session starts, for that session's agent only, at most once a day per agent.
claude --version
codex --version

OpenCode (2.x, Linux only) is the exception, on purpose. The runner installs it with npm into a prefix inside its own state folder and starts it only from there, by absolute path – an opencode you put on the PATH yourself is never used, and DevBridge does not pick up a sign-in made in it. It follows the vendor's newest 2.x release; after every install and update the runner checks the version and the package signatures and runs a short probe turn, and puts the previous version back if any of it fails. Each session runs inside bubblewrap: it sees the system read-only, its project folder and the keys of its own subscription, never another subscription's. Where bubblewrap does not start, OpenCode is not offered at all. Keys and subscriptions are added on the server's OpenCode page in DevBridge; devbridge-runner doctor shows whether the isolation starts here (opencode isolation).

Updating

From the dashboard: the server card offers Update runner once a newer version is available, and the runner replaces itself — smoke-testing the new build before it restarts, and rolling back to the previous tarball if that test fails. Updating the runner disconnects every session running on this machine; updating an agent does not.

By hand:

npm install -g --omit=optional @bridge4dev/runner && systemctl --user restart devbridge-runner

License

MIT — see LICENSE.

版本与发布记录

@bridge4dev/runner 共发布 75 个版本,首次发布于 2026/07/26;过去 12 个月发布了 75 个版本。

版本发布日期距今
0.82.0latest2026/10/1722 天前
0.81.02026/10/1623 天前
0.80.02026/10/1524 天前
0.79.02026/10/1326 天前
0.78.22026/10/1029 天前
0.78.12026/10/1029 天前

关于 @bridge4dev/runner 的常见问题

@bridge4dev/runner 是什么?

DevBridge dev runner — connects a dev server to DevBridge and runs agent sessions (Claude Code / Codex)

如何安装 @bridge4dev/runner?

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

@bridge4dev/runner 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@bridge4dev/runner 支持 ESM 还是 CommonJS?

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

@bridge4dev/runner 需要什么版本的 Node.js?

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

@bridge4dev/runner 可以商用吗?

@bridge4dev/runner 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@bridge4dev/runner 的下载量有多少?

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

@bridge4dev/runner 还在维护吗?

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