Package Exports
- wechat-bridge-opencode
Readme
WeChat OpenCode
π¨π³ δΈζ | π¬π§ English
Bridge WeChat direct messages to OpenCode, with full bidirectional support for text, images, files, audio, and video.

Features
- Text β Send/receive messages between WeChat and OpenCode
- Images β Send/receive images with WeChat CDN support
- Files β Send/receive files of any type
- Audio/Video β Full audio and video message support
- QR Login β Terminal QR code rendering for WeChat login
- One Session Per User β Dedicated ACP session for each WeChat user
- Daemon Mode β Run in background with
--daemon - send-wechat Tool β Agents can send files/images back to WeChat
Install
npx wechat-bridge-opencode --agent opencodeOr install globally:
npm install -g wechat-bridge-opencode
wbo --agent opencodeUsage
cd /path/to/your/project
npx wechat-bridge-opencode --agent opencodeFirst run will:
- Show QR code in terminal
- Save login token to
~/.wechat-bridge-opencode - Start polling WeChat DMs
Options
| Flag | Description |
|---|---|
--agent <preset|cmd> |
Built-in preset or raw command |
--cwd <dir> |
Working directory |
--login |
Force re-login |
--daemon |
Run in background |
--config <file> |
JSON config file |
--idle-timeout <min> |
Session idle timeout (default: 1440, 0 = unlimited) |
--max-sessions <count> |
Max concurrent sessions (default: 10) |
--show-thoughts |
Forward agent thinking to WeChat |
WeChat Commands
Workspace (/workspace or /ws)
| Command | Description |
|---|---|
/workspace list |
List all directories |
/workspace switch <n|path> |
Switch directory |
/workspace add /path [name] |
Add directory |
/workspace status |
Show current directory |
Session (/session or /s)
| Command | Description |
|---|---|
/session list |
List recent 10 sessions |
/session switch <n|slug> |
Switch session |
/session new |
New session (clear context) |
/session status |
Show current session |
Requirements
- Node.js 20+
- WeChat iLink bot API access
- OpenCode installed locally or via npx
Storage
Runtime data stored in ~/.wechat-bridge-opencode:
- Login token
- Auth tokens
- Temp files (downloaded media)
- Daemon PID / log
- Bridge state (
.wechat-bridge-state.json)
Notes
- Direct messages only (group chats ignored)
- Permission requests are auto-approved
send-wechattool auto-installed to~/.config/opencode/tools/send-wechat.ts
License
MIT