OpenClaw 通过腾讯外部插件 @tencent-weixin/openclaw-weixin 连接微信。状态:外部插件,支持私聊和媒体,不支持群聊。
命名约定
- WeChat — 文档中的用户侧名称
- Weixin — Tencent 包名和插件 ID 使用的名称
openclaw-weixin— OpenClaw channel ID(CLI 命令和配置路径中使用)@tencent-weixin/openclaw-weixin— npm 包名
工作原理
微信代码不在 OpenClaw 核心仓库中,通过外部插件合约接入:
openclaw plugins install安装@tencent-weixin/openclaw-weixin- Gateway 发现插件 manifest 并加载插件入口
- 插件注册 channel ID
openclaw-weixin openclaw channels login --channel openclaw-weixin启动 QR 登录- 插件将账号凭证存储在 OpenClaw 状态目录下
- Gateway 启动时,插件为每个配置的账号启动微信监控
- 入站微信消息通过 channel 合约规范化,路由到 agent,再通过插件出站路径发送
安装
# 快速安装
npx -y @tencent-weixin/openclaw-weixin-cli install
# 手动安装
openclaw plugins install "@tencent-weixin/openclaw-weixin"
openclaw config set plugins.entries.openclaw-weixin.enabled true
# 重启 gateway
openclaw gateway restart登录
openclaw channels login --channel openclaw-weixin用手机微信扫描 QR 码并确认登录。添加多个账号时,建议隔离 DM 会话:
openclaw config set session.dmScope per-account-channel-peer访问控制
openclaw pairing list openclaw-weixin
openclaw pairing approve openclaw-weixin <CODE>版本兼容性
| 插件版本 | OpenClaw 版本 | npm tag |
|---|---|---|
2.x | >=2026.3.22 | latest |
1.x | >=2026.1.0 <2026.3.22 | legacy |
版本过旧时安装 legacy 版本:
openclaw plugins install @tencent-weixin/openclaw-weixin@legacy故障排查
# 检查安装和状态
openclaw plugins list
openclaw channels status --probe
openclaw --version
# 确认插件已启用
openclaw config set plugins.entries.openclaw-weixin.enabled true
openclaw gateway restart若 Gateway 反复重启,更新 OpenClaw 和插件:
openclaw plugins install "@tencent-weixin/openclaw-weixin" --force
openclaw gateway restart相关链接
- channels-index - 所有 channel 列表
- channel-docking - DM 配对流程