by UNLINEARITY
Bridge WeChat, WeCom & Telegram to local Codex, Claude Code, OpenCode & Pi. Keep the native terminal experience & CLI options with bidirectional interaction, multi-session bridging, CLI switching, file transfer, approvals & status sync. 微信、企业微信与 Telegram 接入本地 Codex、Claude Code、OpenCode 和 Pi,保留原生终端体验与高级启动参数,支持原生双向交互、多会话桥接、多 CLI 切换、文件传输、审批交互与运行状态同步。
# 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. Bridge WeChat, WeCom & Telegram to local Codex, Claude Code, OpenCode & Pi. Keep the native terminal experience & CLI options with bidirectional interaction, multi-session bridging, CLI switching, file transfer, approvals & status sync. 微信、企业微信与 Telegram 接入本地 Codex、Claude Code、OpenCode 和 Pi,保留原生终端体验与高级启动参数,支持原生双向交互、多会话桥接、多 CLI 切换、文件传输、审批交互与运行状态同步。. It has 535 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!
Requires a passing catalog security scan.
⚠️ 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.
命令行工具的微信、企业微信与 Telegram 桥接:本项目将微信、企业微信或 Telegram 消息桥接到本地运行的 Codex、Claude Code、OpenCode 和 Pi,同时把本地输出、审批请求与运行状态同步回对应通道。
项目围绕本地工作流设计,重点是保留本地原生终端体验:你仍然在本地使用原生 CLI 和高级启动参数,微信、企业微信或 Telegram 负责远程输入、结果回流与状态同步。
$codex-bridge skill 与 --attach-current-session,把当前 Codex 会话(0.162+ 共享 daemon 模式)接入微信、企业微信或 Telegram。本项目适合这样的使用场景:
本项目不试图把微信、企业微信或 Telegram 变成新的主工作界面。它的定位是:
>= 22.13.0(建议直接安装官网 LTS 版本)0.149.x–0.161.x;当前会话 attach 需 0.162+ 共享 daemon)1.18.x 与 2.0.x)pi 命令)PATH 中、可直接执行的独立 CLI;不会发现或调用 ChatGPT.app 等桌面应用内部捆绑的私有可执行文件。wechat-setup,企业微信使用 wecom-setup,Telegram 使用 telegram-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> 完成一次性操作者配对;Telegram 使用官方 Bot API 长轮询,不需要公网回调地址,本机需能访问 api.telegram.org。Telegram 从 1.2.3 起提供上述全局命令;源码安装步骤见开发说明。
/newbot,按提示创建机器人并取得 Bot Token(官方创建说明)。telegram-setup,输入 Bot Token。/pair <六位配对码>。配对必须使用你之后操控 CLI 的 Telegram 账号。Telegram operator pairing completed. 即完成;凭据和操作者身份保存到 ~/.cli-bridge/telegram/account.json,下次启动会自动使用。telegram-daemon --adapter codex,或选择下表中的 telegram-* 直接启动命令,然后在机器人私聊中发送任务。telegram-setup # 创建本地配置并完成操作者配对
telegram-setup --check # 检查已配置的 Bot Token 是否有效
同一个 Bot Token 同时只运行一个 bridge/daemon;重新运行 telegram-setup 配对前,先停止正在使用这个机器人的桥接进程。
如果要将 当前 Codex 会话接入 Telegram,在该项目目录中使用:
telegram-codex --attach-current-session
此方式需要 Codex >= 0.162 的共享 daemon 会话;成功输出 Attached Codex daemon thread <id>,不会打开新的可见 CLI。同一目录有多个活会话时可追加 --codex-thread-id <id>,详见 Codex 通道连接说明。
启动 bridge 后,建议先在微信里向 Bot 发送一条消息,例如 hello、你要执行的任务,或任意一句话。这样 bridge 能拿到最新的微信会话 context_token,之后本地终端中的输入、最终回复和审批提示才能稳定同步回微信。
如果冷启动或长时间闲置后直接从本地终端先发消息,bridge 通常仍会捕获这条本地输入并交给 Codex / Claude Code / OpenCode / Pi 处理,但回发到微信时可能因为旧的 context_token 失效而失败。表现是:本地已经有回复,微信暂时收不到;等你先从微信发来一条消息后,后续双向同步就能恢复正常。
先进入需要操作的项目目录:
cd D:\work\your-project
然后选择一个单命令入口:
| 使用的本地 CLI | 微信启动命令 | 企业微信启动命令 | Telegram 启动命令 |
|---|---|---|---|
| Codex | wechat-codex |
wecom-codex |
telegram-codex |
| Claude Code | wechat-claude |
wecom-claude |
telegram-claude |
| OpenCode | wechat-opencode |
wecom-opencode |
telegram-opencode |
| Pi | wechat-pi |
wecom-pi |
telegram-pi |
没有 daemon 时,四个直接命令按单个活动工作区切换器工作:
stopped / error),会自动重启 bridge 再重新打开可见端;如果你希望远程通道连接长期保持在线,并在 Codex / Claude Code / OpenCode / Pi 之间来回切换,可以在项目目录启动统一 daemon:
cd D:\work\your-project
wechat-daemon
企业微信使用同样的 daemon 工作流:
wecom-daemon --adapter claude
Telegram 使用 telegram-daemon --adapter codex,支持同样的 CLI 切换指令。
启动后,在对应远程通道里发送以下指令即可选择当前活动终端:
| 指令 | 行为 |
|---|---|
/codex [prompt] |
切换到 Codex;携带 prompt 时切换后立即转发剩余文本 |
/claude [prompt] |
切换到 Claude Code;携带 prompt 时切换后立即转发剩余文本 |
/opencode [prompt] |
切换到 OpenCode;携带 prompt 时切换后立即转发剩余文本 |
/pi [prompt] |
切换到 Pi;携带 prompt 时切换后立即转发剩余文本 |
daemon 启动后,后续切换都可以直接从对应远程通道发起;如果对应 CLI 还没有可见窗口,daemon 会自动打开或复用它,不需要再手动运行适配器命令。