Bridge personal WeChat to local OpenCode. Send messages from WeChat and have them processed by opencode run --format json in your configured working directory.
- Text conversation with OpenCode through WeChat
- Image attachments via OpenCode
--file - Streaming text updates and tool-call progress from OpenCode JSON events
- Interrupt support by sending a new message while a run is active
- Slash commands for
/help,/clear,/model,/cwd,/prompt,/status,/skills, and more - OpenCode skill discovery from
~/.config/opencode/skills,~/.config/opencode/skill, project.opencode/skills,~/.claude/skills, and~/.agents/skills - Cross-platform daemon manager implemented in Node.js
- Node.js >= 18
- OpenCode CLI installed and authenticated
- Personal WeChat account for QR binding
git clone https://github.com/Wechat-ggGitHub/wechat-opencode.git ~/.config/opencode/skills/wechat-opencode
cd ~/.config/opencode/skills/wechat-opencode
npm installnpm run setup
npm run daemon -- startThen send a message in WeChat.
Use this mode on Linux servers, SSH sessions, or any machine where you want the bridge to keep running without a desktop window.
One-command installer/startup:
chmod +x start.sh
./start.shStop with:
./stop.shReset WeChat login and force QR binding again:
./reset.shreset.sh stops the bridge and removes accounts, sessions, get_updates_buf, and qrcode.png under ~/.wechat-opencode/. It keeps config.env.
First-time setup prints a terminal QR code. If the Linux machine has no GUI, scan the black-and-white QR code directly from the terminal:
npm run setupStart the background bridge:
npm run daemon -- startCheck status:
npm run daemon -- statusView logs:
npm run daemon -- logsStop the bridge:
npm run daemon -- stopRestart after code or config changes:
npm run daemon -- restartThe Node daemon manager is cross-platform, but this mode is the recommended Linux/headless workflow. Data and logs are stored in ~/.wechat-opencode/.
Use this mode on Windows or any GUI machine when you want buttons and a live interaction console.
On Windows, double-click start.vbs from Explorer. It starts the desktop app without showing a console window and writes startup logs to ~/.wechat-opencode/logs/windows-startup.log.
To stop the desktop app and related bridge processes without showing a console window, double-click stop.vbs. Stop logs are written to ~/.wechat-opencode/logs/windows-stop.log.
To switch WeChat accounts, double-click reset.vbs. It stops the bridge, clears WeChat binding/session files, and writes logs to ~/.wechat-opencode/logs/windows-reset.log. It keeps config.env.
For troubleshooting, run the batch file directly so you can see terminal output:
start-windows.cmd
stop-windows.cmd
reset-windows.cmdStart the Electron console:
npm run desktopThe console supports:
- Choosing the OpenCode working directory
- QR-code WeChat setup
- Start/stop buttons for the bridge
- Live logs for inbound WeChat messages, OpenCode text output, tool calls, and outbound WeChat replies
In Electron mode, the bridge runs as a child process of the desktop app. Use the window's Start and Stop buttons. Closing the desktop window stops the bridge process started by that window.
npm run daemon -- status
npm run daemon -- stop
npm run daemon -- restart
npm run daemon -- logs| Command | Description |
|---|---|
/help |
Show available commands |
/clear |
Clear current session |
/reset |
Full reset including working directory |
/model <provider/model> |
Switch OpenCode model |
/permission <mode> |
Switch permission mode |
/prompt [text] |
View or set a system prompt prepended to every run |
/status |
View current session state |
/cwd [path] |
View or switch working directory |
/skills |
List installed OpenCode skills |
/history [n] |
View recent chat messages |
/compact |
Start a new OpenCode session |
/undo [n] |
Remove recent messages from local history |
/<skill> [args] |
Ask OpenCode to use an installed skill |
default: use OpenCode's normal configured permissionsplan: run with--agent planauto: run with--dangerously-skip-permissionsacceptEdits: accepted for command compatibility; currently maps to OpenCode default behavior
WeChat (phone) <-> ilink bot API <-> Node.js daemon <-> opencode run --format json
Data is stored in ~/.wechat-opencode/.

