微信官方接入 OpenClaw?我 10 分钟搞定了,但过程中这几个坑你必须知道

微信官方接入 OpenClaw?我 10 分钟搞定了,但过程中这几个坑你必须知道

看到微信官方支持接入 OpenClaw(龙虾),我心想:这不就是一行命令的事?结果...


事情是这样的

作为 OpenClaw 的老用户,我一直在等微信官方接入。看到文档更新那天,我立刻打开终端:

bash 复制代码
npx -y @tencent-weixin/openclaw-weixin-cli@latest install

啪!报错:

csharp 复制代码
[openclaw-weixin] 未找到 openclaw,请先安装...

我愣了一下------openclaw -V 明明能跑啊?

作为资深 Windows 用户,我秒懂:这脚本有 Unix 偏见


坑 1:安装脚本的"Unix 优越感"

扒开脚本源码,检测逻辑是这样的:

javascript 复制代码
function which(bin) {
  try {
    return execSync(`which ${bin}`, { encoding: "utf-8" }).trim();
  } catch {
    return null;  // Windows 用户直接进这里
  }
}

which 是 Linux/Mac 的命令,PowerShell 不认识。脚本直接判定"你没装 OpenClaw"。

解决: 不跟它较劲,手动安装更可控。

bash 复制代码
cd C:\Users\Administrator\.openclaw\extensions
npm init -y
npm install @tencent-weixin/openclaw-weixin-cli
openclaw plugins install "@tencent-weixin/openclaw-weixin"

坑 2:依赖失踪案

插件装完,重启 Gateway,心想稳了。

啪!报错:

lua 复制代码
[plugins] openclaw-weixin failed to load: Error: Cannot find module 'zod'

openclaw plugins install 只拉代码,依赖不管。就像买了电视,遥控器得自己配。

解决:

bash 复制代码
cd C:\Users\Administrator\.openclaw\extensions\openclaw-weixin
npm install

坑 3:路径配置盲区

依赖装完,重启,又报错:

css 复制代码
[plugins] openclaw-weixin failed to load from .openclaw-install-stage-xxx

两个问题:

  1. 临时目录残留------安装时创建的临时目录没删,Gateway 先加载了它
  2. 路径未配置 ------openclaw.jsonplugins.load.paths 没加微信插件路径

解决:

Step 1:清临时目录

powershell 复制代码
Remove-Item -Recurse -Force C:\Users\Administrator\.openclaw\extensions\.openclaw-install-stage-*

Step 2:加加载路径

json 复制代码
{
  "plugins": {
    "load": {
      "paths": [
        "...\\feishu",
        "C:\\Users\\Administrator\\.openclaw\\extensions\\openclaw-weixin"
      ]
    }
  }
}

坑 4:权限配置的隐形门槛

终于!二维码出来了!扫码!登录成功!

我在微信上发了条测试消息,然后...

沉默。

查配置发现:QQ 有 "allowFrom": ["*"],飞书有 "dmPolicy": "open"微信啥都没有

Gateway 的默认策略是拒绝,必须显式配置权限。

解决:

json 复制代码
{
  "channels": {
    "openclaw-weixin": {
      "enabled": true,
      "allowFrom": ["*"]
    }
  }
}

完整流程(Windows 专用)

bash 复制代码
# 1. 进入扩展目录
cd C:\Users\Administrator\.openclaw\extensions

# 2. 安装 CLI 和插件
npm init -y
npm install @tencent-weixin/openclaw-weixin-cli
openclaw plugins install "@tencent-weixin/openclaw-weixin"

# 3. 装依赖(关键!)
cd openclaw-weixin && npm install && cd ..

# 4. 清临时目录
Remove-Item -Recurse -Force .openclaw-install-stage-*

编辑 ~/.openclaw/openclaw.json

json 复制代码
{
  "plugins": {
    "load": {
      "paths": [
        "...",
        "C:\\Users\\Administrator\\.openclaw\\extensions\\openclaw-weixin"
      ]
    }
  },
  "channels": {
    "openclaw-weixin": {
      "enabled": true,
      "allowFrom": ["*"]
    }
  }
}

重启并登录:

bash 复制代码
openclaw gateway restart
openclaw channels login --channel openclaw-weixin
# 扫码,搞定

坑点速查表

症状 原因 解决
坑 1 说找不到 openclaw which 不兼容 Windows 手动安装
坑 2 zod 模块 依赖未自动安装 手动 npm install
坑 3 加载失败/找临时目录 路径未配置+残留目录 加路径+清残留
坑 4 扫码成功但不回复 allowFrom 加通道配置

写在最后

整个过程其实就 10 分钟,但如果不了解这些坑,可能得折腾几小时。

微信官方接入 OpenClaw 是个好消息,希望这篇文章能帮你少走弯路。

你的 AI 助手,现在可以接管微信了。


作者:老石
OpenClaw 资深用户,专注踩坑与填坑
2026-03-22

相关推荐
suirosu9 小时前
痛风高尿酸血症的治疗方法
笔记·其他·微信·新浪微博
AI生成曾小健1 天前
终于把OpenClaw接入微信了,安全可控,详细教程看这篇
安全·微信
SkyWalking中文站2 天前
用 SkyWalking 监控微信和支付宝小程序
微信·微信小程序·支付宝
咬人喵喵3 天前
五一劳动节 SVG 交互图文案例大全
低代码·微信·编辑器·交互·svg
S1998_1997111609•X5 天前
滄集/㞯鎩.赫量被恶意篡改?|\^*仺\~:sall,sql=㶏齾bci.ji.app_sql=-heart{TCP.box}‘雧……㞋
网络·数据库·网络协议·百度·微信
wechatbot8885 天前
企业微信管理系统:企业私域流量自动化运营api接口开发实战指南
运维·微信·自动化·企业微信·ipad
wechatbot8886 天前
极客互动企业微信聚合聊天与接口能力全景展示
汇编·微信·企业微信·ipad
S1998_1997111609•X6 天前
k:file/~*…/code/*iOS/an/app-/log in/ext./-system.API/-(NFV)=sdk.
数据库·网络协议·百度·微信·ssh
wechatbot8888 天前
企业微信 iPad 协议客服机器人自动化管理平台开发指南
java·运维·微信·自动化·企业微信·ipad
Gerardisite8 天前
私域运营新利器:RPA驱动外部群多模态互动
java·人工智能·python·微信·自动化