JSPM

  • Created
  • Published
  • Downloads 1892
  • Score
    100M100P100Q107149F
  • License MIT

Bridge WeChat to OpenCode

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.

Send Receive

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

No installation required, npx will download and run automatically:

npx wechat-bridge-opencode --agent opencode

Method 2: Global install

npm install -g wechat-bridge-opencode

After installation, use the shorthand command:

wbo --agent opencode

Usage

cd /path/to/your/project
wbo --agent opencode
# or use npx directly:
# npx wechat-bridge-opencode --agent opencode

First run will:

  1. Show QR code in terminal
  2. Save login token to ~/.wechat-bridge-opencode
  3. 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 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

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-wechat tool 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