@chatpanel/bridge

中文文档
0.47.1发布于 2026/10/30SEE LICENSE IN LICENSEES Module零依赖近 30 天下载 1773

Local bridge that exposes the AI coding agents installed on your machine — Claude Code (CLI), Codex (CLI), and Antigravity CLI (formerly Gemini CLI, which remains available for business/enterprise) — to the ChatPanel Chrome extension over a localhost SSE

原始使用文档
文档目录13 节
  1. Run it
  2. macOS / Linux — one line, no Node.js needed
  3. Windows — via Node (recommended)
  4. Manual download
  5. Prerequisites
  6. Develop (from source)
  7. API
  8. Use your skills from any CLI
  9. OpenAI and Anthropic SDK compatibility
  10. Safety
  11. Run as a background service (optional)
  12. License
  13. Trademarks & brand

ChatPanel Bridge

A tiny localhost server that lets the ChatPanel Chrome extension talk to the coding agents on your machine. A browser extension can't spawn local processes, so this bridges the gap.

  • Claude Code — embedded via @anthropic-ai/claude-agent-sdk, using your existing Claude Code login (or ANTHROPIC_API_KEY).
  • Codex — driven via the codex exec CLI, using your codex login.
  • Antigravity CLI — driven via the agy -p CLI, using your Antigravity login. This is Google's successor to Gemini CLI; Gemini CLI itself remains available for business/enterprise (paid API keys) and can be added as a custom agent.

Bring whichever agent you already have installed — the extension auto-detects the ones the bridge reports as available.

Run it

macOS / Linux — one line, no Node.js needed

curl -fsSL https://dl.chatpanel.net/bridge/install.sh | bash

Downloads the standalone binary, installs it, and sets it to start at login (installing via curl avoids the macOS "damaged" prompt). Re-running is a clean in-place upgrade.

Windows SmartScreen flags unsigned downloads, so on Windows run the bridge through Node — you already have it if you use Claude Code / Codex (both npm CLIs), and there's no security prompt:

npm i -g @chatpanel/bridge
chatpanel-bridge --install      # starts hidden at login

Just trying it? npx @chatpanel/bridge runs it once in the foreground.

Manage it anywhere: chatpanel-bridge --status · --uninstall.

Manual download

Grab the binary from the latest release and:

# macOS (clear the download quarantine first, then install)
xattr -cr chatpanel-bridge-macos-arm64
chmod +x chatpanel-bridge-macos-arm64
./chatpanel-bridge-macos-arm64 --install

# Windows (PowerShell) — click "More info → Run anyway" if SmartScreen warns
.\chatpanel-bridge-windows-x64.exe --install

These binaries aren't code-signed yet, so macOS/Windows may warn on first run (the curl/npm routes above sidestep that). Intel Mac? No x64 binary yet — use npm (npx @chatpanel/bridge). Apple Silicon uses chatpanel-bridge-macos-arm64.

Prerequisites

The agents you want to use must already be set up:

  • Claude Code: installed and signed in (claude), or set ANTHROPIC_API_KEY.
  • Codex: codex on your PATH and codex login done.
  • Antigravity CLI: agy on your PATH and signed in (install the Antigravity app, then run agy once to sign in). Replaces Gemini CLI; business/enterprise users can still run gemini as a custom agent.

The extension polls /health and shows each agent as available/unavailable.

Develop (from source)

Only if you're hacking on the bridge itself:

git clone https://github.com/chatpanel/chatpanel-bridge
cd chatpanel-bridge
npm install
npm start                    # → http://127.0.0.1:4319

API

MethodPathPurpose
GET/health{ ok, version, agents:[{id,label,available,reason}] }
POST/chatSSE stream — body { agent, system, options, messages }
GET/v1/modelsOpenAI-compatible list of available local agents
POST/v1/chat/completionsOpenAI-compatible Chat Completions (streaming and non-streaming)
POST/v1/completionsOpenAI-compatible legacy text Completions (streaming and non-streaming)
POST/v1/responsesOpenAI-compatible Responses API (streaming and non-streaming)
POST/v1/messagesAnthropic-compatible Messages API (streaming and non-streaming)
GET/skillsskills installed on this machine, across every agent harness + configured folders
GET/skills/<name> · /skills/<name>/file/<path>one skill's instructions · one reference file
POST/mcpMCP endpoint — chatpanel_skill_* tools any CLI can call (plus browser tools while a ChatPanel chat is driving)

/chat streams Server-Sent Events: {type:'delta',text} as the answer is generated, {type:'tool',name,summary} / {type:'status'} for activity, and a final {type:'done'} (or {type:'error',error}).

Use your skills from any CLI

The bridge discovers the skills installed on your machine — Claude Code, Codex, Copilot, Gemini, Hermes, ~/.agents/skills, and any folder you configure — and exposes them as MCP tools (chatpanel_skill_list / _open / _read). Point any MCP client at http://127.0.0.1:4319/mcp and it can list and load them with no browser open.

For one server that adds your local history (chats, meetings, notes — redacted) alongside your skills, add the Privacy Gateway instead and point your CLI at chatpanel-gateway mcp. The gateway proxies these skill tools and puts redaction in front.

options per agent (set in ChatPanel Settings):

{
  "workingDir": "/path/to/project",   // where the agent reads/works
  "permissionMode": "default",         // default | acceptEdits | bypassPermissions
  "model": ""                          // optional model override
}

OpenAI and Anthropic SDK compatibility

The compatibility routes run a local coding agent; they do not call a provider API. Use the per-install token from ~/.chatpanel/bridge-token as the SDK API key. The token protects endpoints that can start local processes, so do not put it in browser-delivered code or share it.

For OpenAI clients, set the base URL to http://127.0.0.1:4319/v1 and use an installed agent id such as codex as the model:

import OpenAI from 'openai';
import { readFileSync } from 'node:fs';

const client = new OpenAI({
  apiKey: readFileSync(`${process.env.HOME}/.chatpanel/bridge-token`, 'utf8').trim(),
  baseURL: 'http://127.0.0.1:4319/v1',
});

const result = await client.responses.create({
  model: 'codex',
  input: 'Explain this project in three bullets.',
});
console.log(result.output_text);

client.chat.completions.create(...) and legacy client.completions.create(...) work through the same base URL. For the Anthropic SDK, use http://127.0.0.1:4319 as its base URL and the same token as its API key; requests to /v1/messages can also use model: "codex".

The model field selects the local agent. codex/gpt-5.5, for example, selects the Codex agent and passes gpt-5.5 as its CLI model override. Advanced bridge settings can be supplied through an extra chatpanel request object:

{
  "model": "codex",
  "messages": [{ "role": "user", "content": "Fix the failing tests." }],
  "chatpanel": {
    "working_dir": "/absolute/path/to/project",
    "permission_mode": "acceptEdits",
    "use_local_config": true
  }
}

The adapter currently covers text conversations. Provider-hosted function tools, stored responses, log probabilities, and exact token accounting are not available; unsupported tool requests return HTTP 400, and usage counts are zero.

Safety

  • Binds to 127.0.0.1 only. Every request must carry a loopback Host (no DNS rebinding) and, if it has an Origin, an allowed one (no web page).
  • Who may run an agent. The routes that start a local process need a paired caller: ChatPanel's published Chrome/Edge extension (recognised by its extension id — a browser never lets one extension send another's origin) or the per-install token in ~/.chatpanel/bridge-token (0600; the desktop app and CLIs read it). An extension the bridge does not recognise — including ChatPanel's own Firefox build, whose origin is a per-profile UUID — may still chat, but the run is capped to the conversational tier: no files, no shell, no web, and no working directory, workspace, credential or permission-mode option from the request body. The reply tells the user why.
  • Pairing. chatpanel-bridge pair prints a one-time code (5 minutes, 5 attempts). Enter it in ChatPanel → Settings → Coding Agents and that browser holds the token from then on. A dev build can instead be pinned by id: CHATPANEL_BRIDGE_EXTENSION_IDS=<id>. Ask the bridge what it thinks of you with POST /whoami → { trust, paired }.
  • Claude tools are read-only by default (Read/Grep/Glob/WebFetch). Writes and shell only run when an agent's permission mode is acceptEdits or bypassPermissions.
  • Point each agent at a working directory you trust.

Run as a background service (optional)

macOS (launchd) example — save to ~/Library/LaunchAgents/app.chatpanel.bridge.plist:

<?xml version="1.0" encoding="UTF-8"?>
<plist version="1.0"><dict>
  <key>Label</key><string>app.chatpanel.bridge</string>
  <key>ProgramArguments</key>
  <array><string>/usr/local/bin/node</string><string>/ABSOLUTE/PATH/chatpanel/bridge/src/server.js</string></array>
  <key>RunAtLoad</key><true/>
  <key>KeepAlive</key><true/>
</dict></plist>

Then launchctl load ~/Library/LaunchAgents/app.chatpanel.bridge.plist.

License

PolyForm Shield License 1.0.0 — run and modify it for your own use; you may not use it to provide a product or service that competes with ChatPanel. The npm package and the binaries ship minified. What the bridge does is documented above and bounded by design: it listens on 127.0.0.1 only, drives the CLI agents you already have with your own logins, and sends nothing anywhere itself — every outbound connection you see from it is one of your agents talking to its own vendor. Privacy questions: [email protected]; security reports: [email protected].

Trademarks & brand

The name “ChatPanel”, the logo, and brand assets are trademarks of ChatPanel, not licensed under the terms above — the Shield license covers the code only. Don't redistribute a fork (e.g. to npm) under the ChatPanel name or marks.

版本与发布记录

@chatpanel/bridge 共发布 134 个版本,首次发布于 2026/06/12;过去 12 个月发布了 134 个版本。

版本发布日期距今
0.47.1latest2026/10/3010 天前
0.46.12026/10/051 个月前
0.46.02026/10/041 个月前
0.45.22026/10/031 个月前
0.44.22026/10/021 个月前
0.44.12026/10/021 个月前

关于 @chatpanel/bridge 的常见问题

@chatpanel/bridge 是什么?

Local bridge that exposes the AI coding agents installed on your machine — Claude Code (CLI), Codex (CLI), and Antigravity CLI (formerly Gemini CLI, which remains available for business/enterprise) — to the ChatPanel Chrome extension over a localhost SSE

如何安装 @chatpanel/bridge?

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

@chatpanel/bridge 支持 TypeScript 吗?

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

@chatpanel/bridge 支持 ESM 还是 CommonJS?

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

@chatpanel/bridge 需要什么版本的 Node.js?

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

@chatpanel/bridge 可以商用吗?

@chatpanel/bridge 使用 SEE LICENSE IN LICENSE 许可。许可条款写在包内的独立文件中,请阅读该文件确认可否商用。以上为概括,不构成法律意见,请以许可原文为准。

@chatpanel/bridge 的下载量有多少?

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

@chatpanel/bridge 还在维护吗?

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