OpenClaw integration with WeChat
OpenClaw integration with WeChat
OpenClaw (formerly Clawdbot) is an open-source, locally-first AI agent gateway that allows large models to run 24/7 on your computer/server, supporting direct computer operation, web browsing, command execution, and seamless integration with chat platforms like Feishu, Telegram, and Discord.
In this chapter, we will integrate OpenClaw with Feishu to achieve automated scenarios such as message pushing, sending images, receiving files, approval interactions, and data synchronization.
If you have not installed OpenClaw yet, you need to install it first:
Use the npm command to install globally:
npm install -g openclaw@latest --registry=https://registry.npmmirror.com
Or use the pnpm command to install:
pnpm add -g openclaw@latest
For detailed installation instructions for OpenClaw, please refer to: OpenClaw (Clawdbot) tutorial
One-click integration with WeChat (ClawBot plugin, iOS 8.0.70+)
Prerequisites
- WeChat version: iOS 8.0.70 and above
- OpenClaw instance is deployed and running (local/server)
Operation steps
-
Open WeChat → Me → Settings → Plugins.
-
Find the "ClawBot" card, click to enter, and you can see the installation prompt.

-
Copy the terminal installation command (you can also execute this step directly):
npx -y @tencent-weixin/openclaw-weixin-cli@latest install
-
Execute this command in the terminal of the device running OpenClaw:

-
After the command executes, a QR code will be generated; scan it with WeChat to bind:

After successful scanning, it will show a successful connection and restart:

Access the OpenClaw backend, view the channel, and see that WeChat has been deployed:

-
After successful binding, you can directly converse with OpenClaw in the WeChat chat window:

Issues for Windows users
If Windows users use npx, an error might occur: openclaw not found. This is because npx uses the Linux which command to detect openclaw, and Windows does not have which, so it reports "openclaw not found"

The solution is to install it using the openclaw plugin command:
openclaw plugins install "@tencent-weixin/openclaw-weixin"
Enable the plugin:
openclaw config set plugins.entries.openclaw-weixin.enabled true
QR code login:
openclaw channels login --channel openclaw-weixin
A QR code will appear in the terminal; scan it with WeChat on your phone and confirm authorization.
If the plugin still fails to install, you can use the script cli.mjs provided by community user @BaiLingHan, place it in the same directory as package.json and LICENSE, and run the script to continue the installation.
node ./cli.mjs install
Content of cli.mjs file:
!/
usr
/
bin
/
env node
import
{
execSync
,
spawnSync
}
from
"node:child_process"
;
const
PLUGIN_SPEC
=
"@tencent-weixin/openclaw-weixin"
;
const
CHANNEL_ID
=
"openclaw-weixin"
;
// ── helpers ──────────────────────────────────────────────────────────────────
function
log
(
msg
)
{
console.
log
(
`\x1b
[
36m
[
openclaw
weixin
]
\x1b
[
0m $
{
msg
}
`
)
;
}
function
error
(
msg
)
{
console.
error
(
`\x1b
[
31m
[
openclaw
weixin
]
\x1b
[
0m $
{
msg
}
`
)
;
}
function
run
(
cmd
,
{
silent
=
true
}
=
{
}
)
{
const
stdio
=
silent
?
[
"pipe"
,
"pipe"
,
"pipe"
]
:
"inherit"
;
const
result
=
spawnSync
(
cmd
,
{
shell
:
true
,
stdio
}
)
;
if
(
result.
status
!==
0
)
{
const
err
=
new
Error
(
`Command failed with exit code $
{
result.
status
}
:
$
{
cmd
}
`
)
;
err.
stderr
=
silent
?
(
result.
stderr
||
""
)
.
toString
(
)
:
""
;
throw
err
;
}
return
silent
?
(
result.
stdout
||
""
)
.
toString
(
)
.
trim
(
)
:
""
;
}
function
which
(
bin
)
{
try
{
return
execSync
(
`which $
{
bin
}
`
,
{
encoding
:
"utf-8"
,
stdio
:
[
"pipe"
,
"pipe"
,
"pipe"
]
}
)
.
trim
(
)
;
}
catch
{
return
null
;
}
}
// ── commands ─────────────────────────────────────────────────────────────────
function
install
(
)
{
// 1. Check if openclaw is installed
//if (!which("openclaw")) {
// error("openclaw not found, please install first:");
// console.log(" npm install -g openclaw");
// See https://docs.openclaw.ai/install for details
// process.exit(1);
//}
log
(
"openclaw installed locally"
)
;
// 2. Install plugin via openclaw
log
(
"Installing plugin..."
)
;
try
{
const
installOut
=
run
(
`openclaw plugins install
"${PLUGIN_SPEC}"
`
)
;
if
(
installOut
)
log
(
installOut
)
;
}
catch
(
installErr
)
{
if
(
installErr.
stderr
&&
installErr.
stderr
.
includes
(
"already exists"
)
)
{
log
(
"Detected local installation, updating..."
)
;
try
{
const
updateOut
=
run
(
`openclaw plugins update
"${CHANNEL_ID}"
`
)
;
if
(
updateOut
)
log
(
updateOut
)
;
}
catch
(
updateErr
)
{
error
(
"Plugin update failed, please execute manually:"
)
;
if
(
updateErr.
stderr
)
console.
error
(
updateErr.
stderr
)
;
console.
log
(
` openclaw plugins update
"${CHANNEL_ID}"
`
)
;
process.
exit
(
1
)
;
}
}
else
{
error
(
"Plugin installation failed, please perform manually:"
)
;
if
(
installErr.
stderr
)
console.
error
(
installErr.
stderr
)
;
console.
log
(
` openclaw plugins install
"${PLUGIN_SPEC}"
`
)
;
process.
exit
(
1
)
;
}
}
// 3. Login (interactive QR scan)
log
(
"Plugin is ready, starting first connection..."
)
;
try
{
run
(
`openclaw channels login
--
channel $
{
CHANNEL_ID
}
`
,
{
silent
:
false
}
)
;
}
catch
{
console.
log
(
)
;
error
(
"Initial connection failed, please try manually later:"
)
;
console.
log
(
` openclaw channels login
--
channel $
{
CHANNEL_ID
}
`
)
;
}
// 4. Restart gateway so it picks up the new account
log
(
"Restarting OpenClaw Gateway..."
)
;
try
{
run
(
openclaw gateway restart
,
{
silent
:
false
}
)
;
}
catch
{
error
(
"Restart failed, you can execute manually:"
)
;
console.
log
(
openclaw gateway restart
)
;
}
}
function
help
(
)
{
console.
log
(
`
Usage
:
npx
y
@
tencent
weixin
/
openclaw
weixin
cli
<
command
Commands:
install Install the WeChat plugin and scan the code to connect
help Display help information
`
)
;
}
// ── main ─────────────────────────────────────────────────────────────────────
const
command
=
process.
argv
[
2
]
;
switch
(
command
)
{
case
"install"
:
install
(
)
;
break
;
case
"help"
:
case
"--help"
:
case
"-h"
:
help
(
)
;
break
;
default
:
if
(
command
)
{
error
(
Unknown command
:
$
{
command
}
`
)
;
}
help
(
)
;
process.
exit
(
command
?
1
:
0
)
;
}
package.json file:
package.json
{
"name"
:
"@tencent-weixin/openclaw-weixin-cli"
,
"version"
:
"1.0.2"
,
"description"
:
"Lightweight installer for the OpenClaw Weixin channel plugin"
,
"license"
:
"MIT"
,
"author"
:
"Tencent"
,
"type"
:
"module"
,
"bin"
:
{
"weixin-installer"
:
"./cli.mjs"
}
,
"files"
:
[
"cli.mjs"
]
,
"engines"
:
{
"node"
:
">=22"
}
}
LICENSE file code:
MIT License
Copyright (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.
Installation process


