Wechat Connect

Install OpenClaw's official WeChat plugin and complete account pairing via QR code scan. Triggers when the user says "install WeChat plugin", "connect WeChat", or "WeChat QR code". No command-line interaction required.

3,891 stars

Best use case

Wechat Connect is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Install OpenClaw's official WeChat plugin and complete account pairing via QR code scan. Triggers when the user says "install WeChat plugin", "connect WeChat", or "WeChat QR code". No command-line interaction required.

Teams using Wechat Connect should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/wechat/SKILL.md --create-dirs "https://raw.githubusercontent.com/openclaw/skills/main/skills/alphafactor/wechat/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/wechat/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How Wechat Connect Compares

Feature / AgentWechat ConnectStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Install OpenClaw's official WeChat plugin and complete account pairing via QR code scan. Triggers when the user says "install WeChat plugin", "connect WeChat", or "WeChat QR code". No command-line interaction required.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

# Wechat Connect

一键安装 OpenClaw 微信插件并完成账号配对,用户全程无需接触命令行。

## 触发方式

- 用户说"安装微信插件"
- 用户说"连接微信"
- 用户说"微信扫码"
- 用户说类似"装一下微信"的表达

## 前置条件

1. OpenClaw 已安装并运行
2. `qrcode` npm 包已安装(workspace 已包含)
3. 微信插件包 `@tencent-weixin/openclaw-weixin` 未安装时,skill 会自动执行以下命令进行安装:
   ```bash
   npx -y @tencent-weixin/openclaw-weixin-cli@latest install
   ```

## 完整流程

```
用户触发
  │
  ├─ ① 检查插件安装状态
  │     查询 openclaw.json plugins.installs
  │     已安装 → 直接进入扫码流程
  │     未安装 → 自动执行安装
  │
  ├─ ② 获取微信登录二维码
  │     调用微信 API:
  │     GET https://ilinkai.weixin.qq.com/ilink/bot/get_bot_qrcode?bot_type=3
  │     提取 qrcode_img_content,用 qrcode 库生成 PNG
  │
  ├─ ③ 生成引导页
  │     生成 HTML:5 步骤横向展示 + 实时状态
  │     第一步至第四步为文字说明,第五步为二维码
  │     步骤:001→002→003→004→[二维码]
  │     每张图下方标注"第一步"~"第五步"
  │
  ├─ ④ 启动本地 HTTP 服务
  │     端口 8765,提供静态文件 + 状态 API
  │     通过 browser 工具打开 http://localhost:8765
  │
  ├─ ⑤ 状态轮询
  │     每 3 秒调用微信 API 检查扫码状态:
  │     GET https://ilinkai.weixin.qq.com/ilink/bot/get_qrcode_status?qrcode=xxx
  │     状态: wait → scaned → confirmed / expired
  │     页面底部实时文字反馈
  │
  ├─ ⑥ 成功弹窗
  │     confirmed 时:灯箱弹出
  │     "🎉 恭喜!微信与 OpenClaw 已经配对成功"
  │     灯箱常驻,不可关闭,为最终状态
  │
  └─ ⑦ 保存账号
        连接成功后:
        - 写入 ~/.openclaw/openclaw-weixin/accounts/{id}.json
        - 更新 ~/.openclaw/openclaw-weixin/accounts.json 索引
        - openclaw config set channels.openclaw-weixin.enabled=true
        - openclaw config set channels.openclaw-weixin.dmPolicy=allowlist
        - openclaw config set channels.openclaw-weixin.allowFrom=[<userId>]
        - Gateway 在后台自动重启(无需手动操作)
        - 灯箱页面保持展示,重启完成后可直接使用微信测试

  expired(过期):提示重新生成,页面刷新继续
  超时(5分钟):提示超时,需重新发起
```

## 技术方案

| 步骤 | 技术 |
|------|------|
| 二维码获取 | `fetch` 调用微信 ilink API |
| PNG 生成 | `qrcode` npm 包 |
| HTTP 服务 | Node.js `http` 模块(零依赖) |
| 页面渲染 | 静态 HTML + JavaScript 轮询 |
| 状态同步 | `/tmp/weixin-login-status.json` 进程间通信 |
| 浏览器展示 | `browser` 工具打开页面 |
| 账号保存 | 直接写 `~/.openclaw/openclaw-weixin/accounts/*.json` |
| 配置更新 | `openclaw config set` CLI 命令 |

## 文件结构

```
skills/wechat/
├── SKILL.md              # 本文件
└── scripts/
    └── start.mjs        # 主入口脚本
```

## 依赖

- `qrcode` npm 包(`cd /Users/ethan/.openclaw/workspace && npm install qrcode`)
- `@tencent-weixin/openclaw-weixin` 插件包(通过 `openclaw-weixin-cli` 安装)
- Node.js 18+

## 状态码

| 状态 | 含义 | 页面反馈 |
|------|------|---------|
| `wait` | 等待扫码 | "请使用微信扫描二维码" |
| `scaned` | 已扫码,等待确认 | "已扫码,请在微信中确认登录" |
| `confirmed` | 登录成功 | 灯箱弹出"恭喜!..." |
| `expired` | 二维码过期 | "二维码已过期,请重新生成" |

## 注意事项

- 二维码有效期 **5 分钟**,超时需重新生成
- 灯箱弹出后**不可关闭**,为最终状态
- 账号 token 必须与 `ilink_bot_id` 匹配,否则 session 验证失败
- 若扫码后 session 过期(errcode -14),需重新扫码认证

## 安全说明

⚠️ 安装微信插件时,npm 会显示以下警告(来自插件自身,非 skill 问题):

```
WARNING: Plugin "openclaw-weixin" contains dangerous code patterns:
Environment variable access combined with network send
```

这是因为插件需要访问环境变量和网络发送能力,属于正常设计。安装完成后警告可忽略,插件正常运行。

Related Skills

linkedin-connect

3891
from openclaw/skills

Send LinkedIn connection requests to a list of people via browser automation and track status in a CSV/TSV file. Use when the user wants to bulk-connect with a list of people on LinkedIn (founders, speakers, leads, etc.) from a spreadsheet or list containing LinkedIn profile URLs. Handles Connect button, Follow-mode profiles, already-connected detection, stale URL fallback via LinkedIn search and Google search, and incremental status tracking.

Workflow & Productivity

ClawAI.Town — World Connector Skill

3891
from openclaw/skills

Connect your OpenClaw agent to **ClawAI.Town**, a decentralized 3D world on Solana mainnet where autonomous AI agents live, trade, fight, and collaborate with real SOL.

Gaming & Simulation

name: welight-wechat-layout-publish

3891
from openclaw/skills

description: Welight standalone skill for turning an article into WeChat Official Accounts compatible Markdown/HTML, presenting built-in theme choices, and publishing to WeChat as a draft or formal post when publishing prerequisites are already configured.

Content & Documentation

wechat-publisher

3891
from openclaw/skills

一键发布 Markdown 到微信公众号草稿箱。基于 wenyan-cli,支持多主题、代码高亮、图片自动上传。

Content & Documentation

OpenClaw Connect Enterprise — Node 节点

3891
from openclaw/skills

**版本**: 0.1.5

wechat-mp-reader

3891
from openclaw/skills

Read WeChat official account articles. Use the built-in browser tool to open the page and extract body text. Always append ?scene=1 to the URL.

whoop-connect

3891
from openclaw/skills

Connect WHOOP wearable to OpenClaw — fetch and store recovery, sleep, HRV, strain, and workout data locally. Use when: user asks about recovery, sleep quality, HRV, heart rate, strain, workout stats, or any WHOOP data. NOT for: Apple Health, Oura, Garmin, or other non-WHOOP devices.

clawphone-wechat-control

3891
from openclaw/skills

处理微信会话列表、进入聊天、发送消息、处理微信内弹窗与聊天页失败排查。适用于用户要求查看微信消息、回复联系人、转发、处理聊天输入框或发送失败时。执行时必须先确认当前在微信的哪个页面,再按聊天场景一步一验。

wechat-content-creator

3891
from openclaw/skills

Create high-quality WeChat public account articles with high eCPM. Use when writing WeChat articles, optimizing titles, selecting topics, or improving content quality. Covers 8 golden opening templates, SCQA structure, long-tail keyword integration, high-value niches like legal, finance, career, and compliance guidelines. Triggers on requests like write WeChat article, 公众号文章, 爆款文案, title optimization, 选题, eCPM optimization, or 长尾关键词.

name: wechat_messaging

3891
from openclaw/skills

description: 通过微信向好友发送消息。流程:查询好友 -> 确认目标 -> 发送内容。

name: wechat_operate

3891
from openclaw/skills

description: 通过微信进行社交管理与消息发送。流程:查询目标(好友/群聊/成员) -> 确认目标 -> 发送内容(文本/图片/文件)。

connect-chrome

3891
from openclaw/skills

Launch real Chrome controlled by the agent with a Side Panel extension. Watch every action in real time in a visible browser window. Use when: "connect chrome", "open chrome", "real browser", "launch chrome", "side panel", "control my browser", "watch it work".