docs/en/channels/weixin.mdx
Connect CowAgent to your personal WeChat. Simply scan a QR code to log in — no public IP required. Supports text, image, voice, file, and video messages.
Start the program and open the Web console (local access: http://127.0.0.1:9899). Go to the Channels tab, click Connect Channel, select WeChat, and follow the prompts to scan the QR code.
Set channel_type to weixin in your config.json:
{
"channel_type": "weixin"
}
After starting the program, a QR code will be displayed in the terminal. Scan it with WeChat and confirm on your phone to complete login.
<Note> For backward compatibility, setting `channel_type` to `wx` also activates the WeChat channel. </Note>| Parameter | Description | Default |
|---|---|---|
channel_type | Set to weixin or wx | — |
Login credentials are automatically saved to ~/.weixin_cow_credentials.json. To force a re-login, delete this file and restart.
On first startup, a QR code is displayed in the terminal (valid for approximately 2 minutes). Scan it with WeChat and confirm on your phone.
qrcode dependency is already included in requirements.txt, enabling QR code rendering directly in the terminalAfter successful login, credentials are saved to ~/.weixin_cow_credentials.json. Subsequent startups will reuse the saved credentials without requiring a new scan.
To force a re-login, delete the credentials file and restart the program.
When the WeChat session expires (errcode -14), the program automatically clears old credentials and initiates a new QR login — no manual intervention required.
| Feature | Status |
|---|---|
| Direct Messages | ✅ |
| Text Messages | ✅ Send & Receive |
| Image Messages | ✅ Send & Receive |
| File Messages | ✅ Send & Receive |
| Video Messages | ✅ Send & Receive |
| Voice Messages | ✅ Receive |
ilinkai.weixin.qq.com.