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
Method 1: One-click run (Recommended)
No installation required, npx will download and run automatically:
npx wechat-bridge-opencode --agent opencodeMethod 2: Global install
npm install -g wechat-bridge-opencodeAfter installation, use the shorthand command:
wbo --agent opencodeUsage
cd /path/to/your/project
wbo --agent opencode
# or use npx directly:
# 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) |
WeChat Commands
Workspace (/workspace or /ws)
| Command | Description |
|---|---|
/workspace list |
List all directories |
/workspace switch <n|path> |
Switch by index or path (loads most recent session) |
/workspace add /path [name] |
Add directory |
/workspace status |
Show current directory |
Session (/session or /s)
| Command | Description |
|---|---|
/session list |
List recent 10 sessions |
/session list --cwd |
List sessions in current workspace |
/session list <path|n> |
List sessions by workspace path or index |
/session switch <n|slug> |
Switch by index or slug/title |
/session new |
New session (clear context) |
/session status |
Show current session |
Agent (/agent or /a)
| Command | Description |
|---|---|
/agent list |
List available agent modes with index and current marker |
/agent switch <name|n> |
Switch mode by name or index |
/agent status |
Show current agent mode |
Model (/model)
| Command | Description |
|---|---|
/model list |
List all providers with model counts |
/model list <provider> |
List models for a specific provider (with index) |
/model switch <provider/model|n> |
Switch model by full name or index (last queried provider) |
/model status |
Show current model |
Reasoning (/reasoning)
| Command | Description |
|---|---|
/reasoning list |
List available reasoning levels |
/reasoning switch <level> |
Switch reasoning level |
/reasoning status |
Show current reasoning level |
Status (/status)
| Command | Description |
|---|---|
/status |
Show session, workspace, agent, model, reasoning, context usage |
Thinking (/thinking)
| Command | Description |
|---|---|
/thinking on |
Enable thinking & tool display |
/thinking off |
Disable thinking & tool display |
/thinking status |
Show current thinking & tool display settings |
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
Acknowledgment
This project is based on wechat-acp by formulahendry. Thanks for the original work!
License
MIT