YouTip LogoYouTip

Openclaw Weixin

OpenClaw WeChat Integration

\\n

OpenClaw (formerly Clawdbot) is an open-source, local-first AI agent gateway that allows large models to run 7x24 hours on your computer/server. It supports direct computer operation, web browsing, command execution, and seamless integration with chat platforms like Feishu, Telegram, Discord, etc.

\\n

In this chapter, we will integrate OpenClaw with WeChat to implement automation scenarios such as message pushing, sending images, receiving files, approval interactions, and data synchronization.

\\n

If you haven't installed OpenClaw yet, you need to install it first:

\\n

Install globally using npm command:

\\n
npm install -g openclaw@latest --registry=https://registry.npmmirror.com
\\n

Or install using pnpm command:

\\n
pnpm add -g openclaw@latest
\\n

For detailed OpenClaw installation, refer to: OpenClaw (Clawdbot) Tutorial.

\\n
\\n

Personal WeChat One-Click Access (ClawBot Plugin, iOS 8.0.70+)

\\n

Prerequisites

\\n
    \\n
  • WeChat Version: iOS 8.0.70 and above
  • \\n
  • OpenClaw instance deployed and running (local/server is fine)
  • \\n
\\n

Operation Steps

\\n
    \\n
  1. Open WeChat → Me → Settings → Plugins.
  2. \\n
  3. Find the "ClawBot" card, click to enter, and you can see the installation command prompt.
    \\n Image 1
  4. \\n
  5. Copy the terminal installation command (you can also execute this step directly):
    \\n
    npx -y @tencent-weixin/openclaw-weixin-cli@latest install
  6. \\n
  7. Execute this command in the terminal of the device where OpenClaw is located:
    \\n Image 2
  8. \\n
  9. After the command is executed, a QR code will be generated; scan it with WeChat to bind:
    \\n Image 3
  10. \\n
  11. After successful scanning, it will show connection successful and restart:
    \\n Image 4
  12. \\n
  13. Visit the OpenClaw backend, check the channels, and see that WeChat has been deployed:
    \\n Image 5
  14. \\n
  15. After successful binding, you can chat directly with OpenClaw in the WeChat chat window:
    \\n Image 6
  16. \\n
\\n
\\n

Issues for Windows Users

\\n

If Windows users use npx, they might encounter an error: openclaw not found. The reason is that npx uses the Linux which command to detect openclaw. Windows does not have which, so it reports "openclaw not found".

\\n

Image 7

\\n

The solution is that we can use the openclaw plugin command to install:

\\n
openclaw plugins install "@tencent-weixin/openclaw-weixin"
\\n

Enable plugin:

\\n
openclaw config set plugins.entries.openclaw-weixin.enabled true
\\n

QR code login:

\\n
openclaw channels login --channel openclaw-weixin
\\n

A QR code will appear in the terminal, scan it with your mobile WeChat and confirm authorization.

\\n

If the plugin still fails to install, you can use the script cli.mjs provided by netizen @BaiLingLingHan, place it in the same directory as the package.json and LICENSE files. The code is as follows, then execute the script to continue installation.

\\n
node ./cli.mjs install
\\n

cli.mjs file content:

\\n
#!/usr/bin/env node\\n\\nimport{ execSync, spawnSync } from "node:child_process";\\n\\nconst PLUGIN_SPEC ="@tencent-weixin/openclaw-weixin";\\n\\nconst CHANNEL_ID ="openclaw-weixin";\\n\\n// ── helpers ──────────────────────────────────────────────────────────────────\\n\\nfunction log(msg){\\n\\n console.log(`x1b[36mx1b[0m ${msg}`);\\n\\n}\\n\\nfunction error(msg){\\n\\n console.error(`x1b[31mx1b[0m ${msg}`);\\n\\n}\\n\\nfunction run(cmd,{ silent =true}={}){\\n\\nconst stdio = silent ?["pipe","pipe","pipe"]:"inherit";\\n\\nconst result = spawnSync(cmd,{ shell:true, stdio });\\n\\nif(result.status!==0){\\n\\nconst err =new Error(`Command failed with exit code ${result.status}: ${cmd}`);\\n\\n err.stderr= silent ?(result.stderr||"").toString():"";\\n\\nthrow err;\\n\\n}\\n\\nreturn silent ?(result.stdout||"").toString().trim():"";\\n\\n}\\n\\nfunction which(bin){\\n\\ntry{\\n\\nreturn execSync(`which ${bin}`,{ encoding:"utf-8", stdio:["pipe","pipe","pipe"]}).trim();\\n\\n}catch{\\n\\nreturn null;\\n\\n}\\n\\n}\\n\\n// ── commands ─────────────────────────────────────────────────────────────────\\n\\nfunction install(){\\n\\n// 1. Check openclaw is installed\\n\\n//if (!which("openclaw")) {\\n\\n// error("openclaw not found, please install first:");\\n\\n// console.log(" npm install -g openclaw");\\n\\n// console.log(" See details at https://docs.openclaw.ai/install");\\n\\n// process.exit(1);\\n\\n//}\\n\\n log("Local installed openclaw found");\\n\\n// 2. Install plugin via openclaw\\n\\n log("Installing plugin...");\\n\\ntry{\\n\\nconst installOut = run(`openclaw plugins install "${PLUGIN_SPEC}"`);\\n\\nif(installOut) log(installOut);\\n\\n}catch(installErr){\\n\\nif(installErr.stderr&& installErr.stderr.includes("already exists")){\\n\\n log("Detected local installation, updating now...");\\n\\ntry{\\n\\nconst updateOut = run(`openclaw plugins update "${CHANNEL_ID}"`);\\n\\nif(updateOut) log(updateOut);\\n\\n}catch(updateErr){\\n\\n error("Plugin update failed, please execute manually:");\\n\\nif(updateErr.stderr) console.error(updateErr.stderr);\\n\\n console.log(` openclaw plugins update "${CHANNEL_ID}"`);\\n\\n process.exit(1);\\n\\n}\\n\\n}else{\\n\\n error("Plugin installation failed, please execute manually:");\\n\\nif(installErr.stderr) console.error(installErr.stderr);\\n\\n console.log(` openclaw plugins install "${PLUGIN_SPEC}"`);\\n\\n process.exit(1);\\n\\n}\\n\\n}\\n\\n// 3. Login (interactive QR scan)\\n\\n log("Plugin ready, starting first connection...");\\n\\ntry{\\n\\n run(`openclaw channels login --channel ${CHANNEL_ID}`,{ silent:false});\\n\\n}catch{\\n\\n console.log();\\n\\n error("First connection incomplete, can retry manually later:");\\n\\n console.log(` openclaw channels login --channel ${CHANNEL_ID}`);\\n\\n}\\n\\n// 4. Restart gateway so it picks up the new account\\n\\n log("Restarting OpenClaw Gateway...");\\n\\ntry{\\n\\n run(`openclaw gateway restart`,{ silent:false});\\n\\n}catch{\\n\\n error("Restart failed, can execute manually:");\\n\\n console.log(` openclaw gateway restart`);\\n\\n}\\n\\n}\\n\\nfunction help(){\\n\\n console.log(`\\n\\n Usage: npx -y @tencent-weixin/openclaw-weixin-cli \\n\\nCommand:\\n\\n install  Install WeChat plugin and scan code to connect\\n\\n help Show help information\\n\\n `);\\n\\n}\\n\\n// ── main ─────────────────────────────────────────────────────────────────────\\n\\nconst command = process.argv;\\n\\nswitch(command){\\n\\ncase"install":\\n\\n install();\\n\\nbreak;\\n\\ncase"help":\\n\\ncase"--help":\\n\\ncase"-h":\\n\\n help();\\n\\nbreak;\\n\\ndefault:\\n\\nif(command){\\n\\n error(`Unknown Command: ${command}`);\\n\\n}\\n\\n help();\\n\\n process.exit(command ?1:0);\\n\\n}
\\n

package.json file:

\\n

package.json

\\n
{\\n"name":"@tencent-weixin/openclaw-weixin-cli",\\n"version":"1.0.2",\\n"description":"Lightweight installer for the OpenClaw Weixin channel plugin",\\n"license":"MIT",\\n"author":"Tencent",\\n"type":"module",\\n"bin":{\\n"weixin-installer":"./cli.mjs"\\n},\\n"files":[\\n"cli.mjs"\\n],\\n"engines":{\\n"node":">=22"\\n}\\n}
\\n

LICENSE file code:

\\n
MIT LicenseCopyright (c) 2026 Tencent Inc.Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
\\n
\\n

Installation Process

\\n

Image 8

\\n

Image 9

\\n

Image 10

← Pytorch Torch AminmaxClaude Code β†’