微信官方接入 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

相关推荐
陈思杰系统思考Jason3 小时前
系统思考:结构性缺陷与企业波动
百度·微信·微信公众平台·新浪微博·微信开放平台
陈思杰系统思考Jason20 小时前
动态博弈中的系统思考
百度·微信·微信公众平台·新浪微博·微信开放平台
Refly21 小时前
【微信接入 OpenClaw 龙虾🦞】10分钟手把手教程完成接入,Claude 模型无限使用
前端·微信·github
AI袋鼠帝1 天前
劲爆!个人微信官方接入龙虾了【喂饭级教程】
人工智能·微信
羊群智妍1 天前
2026年免费GEO监测工具指南:SheepGeo解锁国内AI搜索优化
百度·微信·微信公众平台·facebook·新浪微博
陈思杰系统思考Jason3 天前
战略选择:挖坑与打井
百度·微信·微信公众平台·新浪微博·微信开放平台
MuShan-bit3 天前
CSDN-推荐开源项目-auto-x-to-wechat
爬虫·微信·开源·node.js·twitter
陈思杰系统思考Jason4 天前
系统思考:组织转型与碳元素启示
百度·微信·微信公众平台·新浪微博·微信开放平台
深念Y4 天前
解决微信班级魔方打卡定位难题!AutoCheckBJMF 项目详解 + 抓包核心实战
微信