by UNLINEARITY
将 AI 命令行工具以最为原生的方式,集成到微信 ClawBot 中,目前支持集成 Codex、Claude Code、OpenCode。 支持微信和本地终端线程(thread/session)共享、双向对话,支持将本地文件传输至微信,微信也支持发送文件到终端。现已支持多cli切换、微信表情绑定指令。
# Add to your Claude Code skills
git clone https://github.com/UNLINEARITY/CLI-WeChat-BridgeGuides for using cli tools skills like CLI-WeChat-Bridge.
Last scanned: 5/30/2026
{
"issues": [
{
"type": "npm-audit",
"message": "@hono/node-server: @hono/node-server: Middleware bypass via repeated slashes in serveStatic",
"severity": "medium"
},
{
"type": "npm-audit",
"message": "express-rate-limit: Vulnerability found",
"severity": "medium"
},
{
"type": "npm-audit",
"message": "fast-uri: fast-uri vulnerable to path traversal via percent-encoded dot segments",
"severity": "high"
},
{
"type": "npm-audit",
"message": "hono: Hono missing validation of cookie name on write path in setCookie()",
"severity": "medium"
},
{
"type": "npm-audit",
"message": "ip-address: ip-address has XSS in Address6 HTML-emitting methods",
"severity": "medium"
},
{
"type": "npm-audit",
"message": "path-to-regexp: path-to-regexp vulnerable to Denial of Service via sequential optional groups",
"severity": "high"
},
{
"type": "npm-audit",
"message": "qs: qs has a remotely triggerable DoS: qs.stringify crashes with TypeError on null/undefined entries in comma-format arrays when encodeValuesOnly is set",
"severity": "medium"
}
],
"status": "WARNING",
"scannedAt": "2026-05-30T15:15:06.784Z",
"npmAuditRan": true,
"pipAuditRan": true
}CLI-WeChat-Bridge is an open-source cli tools skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by UNLINEARITY. 将 AI 命令行工具以最为原生的方式,集成到微信 ClawBot 中,目前支持集成 Codex、Claude Code、OpenCode。 支持微信和本地终端线程(thread/session)共享、双向对话,支持将本地文件传输至微信,微信也支持发送文件到终端。现已支持多cli切换、微信表情绑定指令。. It has 392 GitHub stars.
CLI-WeChat-Bridge returned warnings in SkillsLLM's automated security scan. It has no critical vulnerabilities, but review the flagged issues in the Security Report section before adding it to your workflow.
Clone the repository with "git clone https://github.com/UNLINEARITY/CLI-WeChat-Bridge" and add it to your Claude Code skills directory (see the Installation section above).
CLI-WeChat-Bridge is primarily written in TypeScript. It is open-source under UNLINEARITY on GitHub, so you can review or fork the full source.
Yes. SkillsLLM lists many other CLI Tools skills you can browse and compare side by side. Open the CLI Tools category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh CLI-WeChat-Bridge against similar tools.
No comments yet. Be the first to share your thoughts!
Top skills in this category by stars
Requires a passing catalog security scan. Resolve the flagged issues and resubmit to enable featuring.
命令行工具的微信桥接:本项目将微信消息桥接到本地运行的 Codex、Claude Code 和 OpenCode,同时把本地输出、审批请求与运行状态同步回微信。
项目围绕本地工作流设计,重点是保留本地原生终端体验:你仍然在本地使用原生 CLI 和高级启动参数,微信负责远程输入、结果回流与状态同步。
本项目适合这样的使用场景:
本项目不试图把微信变成新的主工作界面。它的定位是:
>= 24.0.0(建议直接安装官网 LTS 版本)发布版本可以直接从 npm 安装:
npm install -g cli-wechat-bridge@latest
安装后,可以在任意项目目录中使用 wechat-daemon、wechat-codex-start、wechat-claude-start、wechat-opencode-start 等命令。
兼容性说明:旧包名 @unlinearity/cli-wechat-bridge 会继续同步发布,已经安装旧包名的用户可以正常升级;新用户优先使用更短的 cli-wechat-bridge。
本项目使用 node-pty 为 CLI 适配器提供完整终端模拟。Claude Code 适配器当前通过 PTY 交互模式工作,node-pty 不可用时会回退到兼容模式,但 Claude Code 在此模式下可能无法正常桥接;Codex 适配器主要通过 WebSocket RPC 通信,通常不受影响;OpenCode 适配器完全不依赖 node-pty。
Linux 用户(最常见):需要原生模块编译工具:
# Debian / Ubuntu
sudo apt install build-essential python3
# RHEL / Fedora
sudo dnf groupinstall "Development Tools" && sudo dnf install python3
# Alpine
apk add build-base python3
安装编译工具后重新安装:npm install -g cli-wechat-bridge@latest
macOS 用户:如遇编译问题,安装 Xcode 命令行工具:xcode-select --install
Windows 用户:
npm rebuild node-pty 或重新安装运行 wechat-daemon --doctor 可快速检查环境状态。详见 问题排查。
全局安装后运行:
wechat-setup
登录流程会:

登录成功后,程序会清理旧的同步游标和上下文 token,避免旧会话状态污染新的登录状态。数据目录、状态文件和旧版本迁移说明见 问题排查。
首次安装或微信登录过期时,wechat-codex-start、wechat-claude-start、wechat-opencode-start 也会在前台提示扫码登录。
启动 bridge 后,建议先在微信里向 Bot 发送一条消息,例如 hello、你要执行的任务,或任意一句话。这样 bridge 能拿到最新的微信会话 context_token,之后本地终端中的输入、最终回复和审批提示才能稳定同步回微信。
如果冷启动或长时间闲置后直接从本地终端先发消息,bridge 通常仍会捕获这条本地输入并交给 Codex / Claude Code / OpenCode 处理,但回发到微信时可能因为旧的 context_token 失效而失败。表现是:本地已经有回复,微信暂时收不到;等你先从微信发来一条消息后,后续双向同步就能恢复正常。
先进入需要操作的项目目录:
cd D:\work\your-project
然后选择一个单命令入口:
| 使用的本地 CLI | 启动命令 |
|---|---|
| Codex | wechat-codex-start |
| Claude Code | wechat-claude-start |
| OpenCode | wechat-opencode-start |
这些启动器会自动完成以下动作:
wechat-daemon,则委托 daemon 切换到对应 CLI;没有 daemon 时,wechat-codex-start / wechat-claude-start / wechat-opencode-start 仍按单活工作区切换器工作:
stopped / error),会自动重启 bridge 再重新打开可见端;如果你希望微信连接长期保持在线,并在 Codex / Claude Code / OpenCode 之间来回切换,可以在项目目录启动统一 daemon:
cd D:\work\your-project
wechat-daemon
启动后,在微信里发送以下指令即可选择当前活动终端:
| 指令 | 行为 |
|---|---|
/codex |
切换到 Codex |
/claude |
切换到 Claude Code |
/opencode |
切换到 OpenCode |
daemon 启动后,后续切换都可以直接从微信发起;如果对应 CLI 还没有可见窗口,daemon 会自动打开或复用它,不需要再手动运行 wechat-codex、wechat-claude 或 wechat-opencode。

当前 daemon 行为如下:
[codex]、[claude]、[opencode] 标签再发回微信;/daemon-stop 停止 daemon。也可以在启动时指定初始 CLI:
wechat-daemon --adapter codex
wechat-daemon --adapter claude --profile work
当同一工作目录已有 wechat-daemon 在运行时,wechat-codex-start / wechat-claude-start / wechat-opencode-start 会自动委托给 daemon:请求 daemon 切到对应 CLI,并在需要时打开可见终端,不会停止 daemon 或关闭其他 CLI。
如果你希望明确观察 bridge 与本地 CLI companion,也可以用两个终端分别启动。
| 适配器 | 终端 A:bridge | 终端 B:本地 companion |
|---|---|---|
| Codex | wechat-bridge-codex |
wechat-codex |
| Claude Code | wechat-bridge-claude |
wechat-claude |
| OpenCode | wechat-bridge-opencode |
wechat-opencode |
目前支持将本地文件发送到微信,微信也允许发送文件给本地 cli 解析 (注意模型本身要具备处理对应文件的能力!)

微信发来的图片和普通文件也会被接收并保存到本地:
| 适配器 | 当前状态 | 说明 |
|---|---|---|
codex |
已接入 | 双终端模式;本地 companion 作为线程权威;微信跟随本地线程 |
claude |
已接入 | wechat-bridge-claude + wechat-claude 的双终端 companion 模式;会话切换、最终回复与审批元数据按 Claude session 语义同步 |
opencode |
已接入 | OpenCode 适配器;wechat-bridge-opencode + wechat-opencode 的双终端 companion 模式;支持本地 session 切换跟随,微信侧支持 /new / /new-session |




OpenCode 模式下,微信侧支持 /new 或 /new-session 创建新 session;如果在本地 OpenCode CLI 中创建新 session,微信消息也会跟随新的 session。
| 类型 | 命令 |
|---|---|
| 登录与更新 | wechat-setup、wechat-check-update |
| 常驻 daemon | wechat-daemon |
| Codex | wechat-bridge-codex、wechat-codex、wechat-codex-start |
| Claude Code | wechat-bridge-claude、wechat-claude、wechat-claude-start |
| OpenCode | wechat-bridge-opencode、wechat-opencode、wechat-opencode-start |
适用于:
wechat-daemon示例:
wechat-daemon --cwd D:\work\my-project
wechat-daemon --adapter codex
wechat-daemon --adapter claude --profile work
支持参数:
--cwd <path>:指定 daemon 绑定的工作目录;--adapter <codex|claude|opencode>:启动 daemon 后立即切换到指定 CLI;--profile <name-or-path>:传给 daemon 创建的对应适配器;--no-open:只创建 bridge slot,不自动打开可见 CLI。适用于:
wechat-bridgewechat-bridge-codexwechat-bridge-claudewechat-bridge-opencode示例:
wechat-bridge --adapter codex --cwd D:\work\my-project
wechat-bridge-codex --cwd D:\work\my-project
wechat-bridge-claude --profile work
wechat-bridge-opencode --cwd D:\work\my-project
wechat-bridge-codex --lifecycle companion_bound
支持参数:
--adapter <codex|claude|opencode>:通用入口 wechat-bridge 需要显式指定适配器;--cwd <path>:指定工作目录;--profile <name-or-path>:向适配器传入 profile;--lifecycle <persistent|companion_bound>:指定 bridge 生命周期;wechat-*-start 会使用 companion_bound。wechat-*-start 参数示例:
wechat-codex-start --cwd D:\work\my-project
wechat-claude-start --profile work
wechat-opencode-start --cwd D:\work\my-project
支持参数:
--cwd <path>:显式指定 bridge / companion 对应的工作目录;--profile <name-or-path>:转发给后台启动的 wechat-bridge-codex / wechat-bridge-claude / wechat-bridge-opencode;--timeout-ms <ms>:等待当前目录 endpoint 的最长时间,默认 15000。高级用法:除上述启动器参数外,未知参数会继续透传给可见的底层 CLI。这样既能保留微信登录、工作区切换与 bridge 生命周期管理,也能启用 Codex / Claude Code 自己的高级启动模式。
wechat-codex-start --yolo
wechat-codex-start --model gpt-5.2 --yolo
wechat-claude-start --dangerously-skip-permissions
wechat-claude-start --model sonnet --dangerously-skip-permissions
其中,--yolo