by UNLINEARITY
将 AI 命令行工具以最为原生的方式,集成到微信 ClawBot / 企业微信 bot 中,目前支持集成 Codex、Claude Code、OpenCode、Pi Agent。 支持微信和本地终端线程(thread/session)共享、双向对话,支持将本地文件传输至微信,微信也支持发送文件到终端。现已支持多 cli 切换、微信表情绑定指令、双向 /resume 对话恢复。
# Add to your Claude Code skills
git clone https://github.com/UNLINEARITY/CLI-WeChat-BridgeGuides for using ai agents 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
}See how CLI-WeChat-Bridge compares with popular alternatives.
CLI-WeChat-Bridge is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by UNLINEARITY. 将 AI 命令行工具以最为原生的方式,集成到微信 ClawBot / 企业微信 bot 中,目前支持集成 Codex、Claude Code、OpenCode、Pi Agent。 支持微信和本地终端线程(thread/session)共享、双向对话,支持将本地文件传输至微信,微信也支持发送文件到终端。现已支持多 cli 切换、微信表情绑定指令、双向 /resume 对话恢复。. It has 515 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 AI Agents skills you can browse and compare side by side. Open the AI Agents 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!
⚠️ Third-Party Software Notice
This skill is third-party open-source software developed and hosted independently on GitHub. SkillsLLM is an informational directory and does not control or maintain the underlying repository.
Any security checks, ratings, or warnings displayed by SkillsLLM are automated and limited in scope. They do not constitute a security certification or guarantee that the software is safe, error-free, or free from malicious code, vulnerabilities, compromised dependencies, or prompt-injection risks.
Review the source code, permissions, dependencies, and configuration before installing or running any third-party skill. Use is at your own risk. To the maximum extent permitted by applicable law, SkillsLLM is not liable for losses arising from third-party software.
命令行工具的微信与企业微信桥接:本项目将微信或企业微信消息桥接到本地运行的 Codex、Claude Code、OpenCode 和 Pi,同时把本地输出、审批请求与运行状态同步回对应通道。
项目围绕本地工作流设计,重点是保留本地原生终端体验:你仍然在本地使用原生 CLI 和高级启动参数,微信或企业微信负责远程输入、结果回流与状态同步。
本项目适合这样的使用场景:
本项目不试图把微信或企业微信变成新的主工作界面。它的定位是:
>= 22.13.0(建议直接安装官网 LTS 版本)>= 1.18.0 < 2.0.00.84.2;需要本机可执行 pi 命令)wechat-setup,企业微信使用 wecom-setup发布版本可以直接从 npm 安装/更新:
npm install -g cli-wechat-bridge@latest
兼容性说明:旧包名 @unlinearity/cli-wechat-bridge 会继续同步发布,已经安装旧包名的用户可以正常升级;新用户优先使用更短的 cli-wechat-bridge。
本项目使用 node-pty 为 CLI 适配器提供完整终端模拟。Claude Code 适配器当前通过 PTY 交互模式工作,node-pty 不可用时会回退到兼容模式,但 Claude Code 在此模式下可能无法正常桥接;Codex 适配器主要通过 WebSocket RPC 通信,通常不受影响;OpenCode 适配器不依赖 node-pty;Pi 直接继承可见 companion 的真实终端,也不需要 node-pty 模拟。
较新 npm 在 Linux 上阻止安装脚本: 如果安装输出提示 cli-wechat-bridge 和 node-pty 的 install/postinstall scripts 未被 allowScripts 允许,请执行一次干净重装:
npm uninstall -g cli-wechat-bridge
npm install -g cli-wechat-bridge@latest --allow-scripts=cli-wechat-bridge,node-pty
cli-wechat-bridge@latest 必须写在同一条安装命令中。不要只运行 npm install -g --allow-scripts=...;缺少包名时,npm 会尝试读取当前目录的 package.json,并可能报 ENOENT /home/<user>/package.json。
如需让后续全局升级继续允许这两个已确认的脚本,可以先写入用户级配置:
npm config set allow-scripts=cli-wechat-bridge,node-pty --location=user
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
安装编译工具后,使用上面的 --allow-scripts=cli-wechat-bridge,node-pty 命令重新安装。
macOS 用户:如遇编译问题,安装 Xcode 命令行工具:xcode-select --install
Windows 用户:
npm rebuild node-pty 或重新安装运行 wechat-daemon --doctor 可快速检查环境状态。详见 问题排查。
全局安装后运行:
wechat-setup
二维码默认使用 small 模式;如果 Windows 终端中的小二维码字符渲染异常,可使用
wechat-setup --qr-mode normal
切换为普通模式。
登录流程会:

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



当前 daemon 行为如下:
[codex]、[claude]、[opencode]、[pi] 标签再发回对应远程通道;/daemon-stop 停止 daemon。也可以在启动时指定初始 CLI:
wechat-daemon --adapter codex
wechat-daemon --adapter claude --profile work
当同一工作目录已有对应通道的 daemon 在运行时,直接启动命令会自动委托给 daemon:请求 daemon 切到对应 CLI,并在需要时打开可见终端,不会停止 daemon 或关闭其他 CLI。
目前支持将本地文件发送到微信或企业微信,微信和企业微信也允许发送文件给本地 CLI 解析(注意模型本身要具备处理对应文件的能力!)

微信或企业微信发来的图片和普通文件也会被接收并保存到本地:
| 适配器 | 当前状态 | 说明 |
|---|---|---|
codex |
已接入 | wechat-codex / wecom-codex 自动确保内部 runtime 并打开可见 Codex;远程通道跟随本地 thread |
claude |
已接入 | wechat-claude / wecom-claude 自动启动或复用 Claude Code;会话、最终回复与审批按 Claude session 语义同步 |
opencode |
已接入 | wechat-opencode / wecom-opencode 自动启动或复用 OpenCode;支持本地 session 跟随及远程通道 /new / /new-session |
pi |
已接入 | wechat-pi / wecom-pi 启动用户原生 Pi TUI,并通过本地 extension 让远程通道接管同一 session,支持最终回复、停止、新建和恢复 session |
Pi 按全权限本地代理运行:bridge 不增加工具审批层,并传入 --approve 信任当前项目;读写文件和执行命令均使用启动 wechat-pi 的本地用户权限。原生 TUI 的主题、快捷键、模型选择和 extension UI 都会保留。wechat-pi 本身就是被微信接管的 Pi TUI;不要再启动第二个 Pi 进程同时写入同一个 session 文件。Pi 0.85.0 及更新版本要求 Node.js >=22.19.0,低于该版本时 wechat-pi / wecom-pi 会在启动前明确提示。




OpenCode 模式下,微信和企业微信侧都支持 /new 或 /new-session 创建新 session;如果在本地 OpenCode CLI 中创建新 session,远程通道消息也会跟随新的 session。
所有命令都在目标项目目录中执行。wechat-* 使用个人微信,wecom-* 使用企业微信;两类入口的适配器名称和参数保持一致。
| 用途 | 微信 | 企业微信 | 说明 |
|---|---|---|---|
| 登录 / 配对 | wechat-setup |
wecom-setup |
微信扫码登录;企业微信输入 Bot ID、Secret 并完成 /pair |
| 常驻 daemon | wechat-daemon |
wecom-daemon |
在当前目录保持远程连接并管理多个 CLI slot |
| Codex | wechat-codex |
wecom-codex |
启动或复用 Codex 可见终端 |
| Claude Code | wechat-claude |
wecom-claude |
启动或复用 Claude Code 可见终端 |
| OpenCode | wechat-opencode |
wecom-opencode |
启动或复用 OpenCode 可见终端 |
| Pi | wechat-pi |
wecom-pi |
启动或复用 Pi 原生 TUI |
1.1.5 已移除完成弃用周期的 `wechat-