Weixin OpenClaw Login
name: weixin-openclaw-login
by aqhi · published 2026-04-01
$ claw add gh:aqhi/aqhi-weixin-openclaw-login---
name: weixin-openclaw-login
description: 处理微信个人号接入 OpenClaw 的官方登录流程与排障。用于安装 `@tencent-weixin/openclaw-weixin`、获取新的二维码授权链接、查询扫码状态、修复 `openclaw-weixin` 卡在 `SETUP / no token`、以及整理微信 8.0.70+ 接入 OpenClaw 的说明文档。
---
# Weixin OpenClaw Login
这个 skill 用来安装、排查、记录微信个人号接入 OpenClaw 的官方登录流程。
快速流程
1. 安装或更新插件:
- `npx -y @tencent-weixin/openclaw-weixin-cli install`
2. 如果终端字符二维码不方便扫码,直接抓取原始二维码授权链接。
3. 让用户在电脑上打开二维码页面,用微信扫码。
4. 轮询扫码状态,直到出现 `confirmed` 或 `bot_token`。
5. 用 `openclaw status` 检查渠道状态。
6. 如果腾讯侧已经确认登录,但 OpenClaw 仍显示 `SETUP / no token`,检查本地状态文件 `~/.openclaw/openclaw-weixin/`。
优先使用脚本
优先使用本 skill 自带脚本:
如果只需要快速人工操作,可继续使用下面的命令版步骤。
获取原始授权链接
插件源码表明,登录本质上是调用腾讯 ilink 接口并拿到一个真实的二维码页面 URL。
优先命令:
node scripts/get-login-url.js脚本会打印:
如果不想用脚本,也可以直接执行:
node - <<'NODE'
const url='https://ilinkai.weixin.qq.com/ilink/bot/get_bot_qrcode?bot_type=3';
fetch(url)
.then(r=>r.json())
.then(j=>{
console.log(j.qrcode_img_content || '');
console.log('QRCODE=' + j.qrcode);
});
NODE相比转发终端字符二维码,这种方式通常更稳。
查询扫码状态
推荐脚本:
python3 scripts/poll-login-status.py <qrcode>例如:
python3 scripts/poll-login-status.py 1cf42ee545e62408992daa64b38a37d9如果只想单次查询,也可以用命令方式:
python3 - <<'PY'
import urllib.request, json
qrcode = 'REPLACE_ME'
url = f'https://ilinkai.weixin.qq.com/ilink/bot/get_qrcode_status?qrcode={qrcode}'
req = urllib.request.Request(url, headers={'iLink-App-ClientVersion':'1'})
with urllib.request.urlopen(req, timeout=40) as r:
print(json.loads(r.read().decode()))
PY常见状态:
只要出现 `bot_token`,就可以认定腾讯侧登录已经成功,即使 OpenClaw 本地状态还没立刻刷新。
OpenClaw 本地把微信状态存在哪里
检查这些路径:
一个正常的账号文件通常长这样:
{
"token": "<bot_token>",
"savedAt": "<timestamp>",
"baseUrl": "https://ilinkai.weixin.qq.com"
}账号 id 一般会把 `@` 和 `.` 规范化成 `-`,例如:
验证是否真正完成
执行:
openclaw status成功时通常表现为:
失败时通常表现为:
如果扫码成功了,但 OpenClaw 还显示 `no token`
1. 先确认轮询结果里已经出现 `bot_token`。
2. 再检查 `~/.openclaw/openclaw-weixin/` 下对应文件是否已写入。
3. 如果文件已经存在,重启 gateway:
- `openclaw gateway restart`
4. 再次执行 `openclaw status` 确认状态。
如果需要更底层的实现说明,读取 `references/implementation-notes.md`。
More tools from the same signal band
Order food/drinks (点餐) on an Android device paired as an OpenClaw node. Uses in-app menu and cart; add goods, view cart, submit order (demo, no real payment).
Sign plugins, rotate agent credentials without losing identity, and publicly attest to plugin behavior with verifiable claims and authenticated transfers.
The philosophical layer for AI agents. Maps behavior to Spinoza's 48 affects, calculates persistence scores, and generates geometric self-reports. Give your...