@agent-wechat/wechat 0.11.5 → 0.11.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +54 -53
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
OpenClaw channel plugin for WeChat. Connects your OpenClaw bot to WeChat using [agent-wechat](https://github.com/thisnick/agent-wechat).
|
|
4
4
|
|
|
5
|
+
**[Documentation](https://thisnick.github.io/agent-wechat/integrations/openclaw/setup/)**
|
|
6
|
+
|
|
5
7
|
## Prerequisites
|
|
6
8
|
|
|
7
9
|
- **A WeChat account logged in on your phone** — This account will be used by the bot. You must keep it logged in on your phone at all times. If you log out on the phone, the bot loses its connection.
|
|
@@ -14,13 +16,59 @@ OpenClaw channel plugin for WeChat. Connects your OpenClaw bot to WeChat using [
|
|
|
14
16
|
|
|
15
17
|
## Setup
|
|
16
18
|
|
|
17
|
-
### 1.
|
|
19
|
+
### 1. Start the agent-wechat Server
|
|
20
|
+
|
|
21
|
+
If you need to run the server yourself:
|
|
22
|
+
|
|
23
|
+
**Option A: CLI** (quickest for local use)
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
npm install -g @agent-wechat/cli
|
|
27
|
+
wx up
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
**Option B: Docker Compose** (production / networked)
|
|
31
|
+
|
|
32
|
+
```yaml
|
|
33
|
+
services:
|
|
34
|
+
agent-wechat:
|
|
35
|
+
image: ghcr.io/thisnick/agent-wechat:latest
|
|
36
|
+
container_name: agent-wechat
|
|
37
|
+
security_opt:
|
|
38
|
+
- seccomp=unconfined
|
|
39
|
+
cap_add:
|
|
40
|
+
- SYS_PTRACE
|
|
41
|
+
ports:
|
|
42
|
+
- "6174:6174"
|
|
43
|
+
volumes:
|
|
44
|
+
- agent-wechat-data:/data
|
|
45
|
+
- agent-wechat-home:/home/wechat
|
|
46
|
+
- ~/.config/agent-wechat/token:/data/auth-token:ro
|
|
47
|
+
restart: unless-stopped
|
|
48
|
+
|
|
49
|
+
volumes:
|
|
50
|
+
agent-wechat-data:
|
|
51
|
+
agent-wechat-home:
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Generate a token before starting:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
mkdir -p ~/.config/agent-wechat
|
|
58
|
+
openssl rand -hex 32 > ~/.config/agent-wechat/token
|
|
59
|
+
chmod 600 ~/.config/agent-wechat/token
|
|
60
|
+
docker compose up -d
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
If running alongside OpenClaw on the same Docker network, set `serverUrl` to `http://agent-wechat:6174` in the channel config.
|
|
64
|
+
|
|
65
|
+
### 2. Install the extension
|
|
18
66
|
|
|
19
67
|
```bash
|
|
20
68
|
openclaw plugins install @agent-wechat/wechat
|
|
21
69
|
```
|
|
22
70
|
|
|
23
|
-
###
|
|
71
|
+
### 3. Configure the channel
|
|
24
72
|
|
|
25
73
|
```bash
|
|
26
74
|
# Uses defaults (localhost:6174, token from ~/.config/agent-wechat/token)
|
|
@@ -47,7 +95,7 @@ Or edit `~/.openclaw/openclaw.json` directly:
|
|
|
47
95
|
|
|
48
96
|
For local setups, the token is automatically read from `~/.config/agent-wechat/token` (shared with the CLI and container), so you don't need to set it in the config. When connecting to a remote server, add the `token` field.
|
|
49
97
|
|
|
50
|
-
###
|
|
98
|
+
### 4. Restart the gateway
|
|
51
99
|
|
|
52
100
|
Restart your OpenClaw gateway so it picks up the new channel config:
|
|
53
101
|
|
|
@@ -55,7 +103,7 @@ Restart your OpenClaw gateway so it picks up the new channel config:
|
|
|
55
103
|
openclaw gateway restart
|
|
56
104
|
```
|
|
57
105
|
|
|
58
|
-
###
|
|
106
|
+
### 5. Log in to WeChat
|
|
59
107
|
|
|
60
108
|
Ask your bot to log in to WeChat:
|
|
61
109
|
|
|
@@ -67,7 +115,7 @@ Your bot should generate a QR code image. Alternatively, use the CLI:
|
|
|
67
115
|
openclaw channels login --channel wechat
|
|
68
116
|
```
|
|
69
117
|
|
|
70
|
-
###
|
|
118
|
+
### 6. Scan the QR code
|
|
71
119
|
|
|
72
120
|
Display the QR code on a screen separate from the phone running WeChat. WeChat's login QR scanner uses the camera only — it cannot scan from the phone's photo gallery.
|
|
73
121
|
|
|
@@ -75,7 +123,7 @@ Scan the QR code using WeChat's built-in scanner (tap **+** > **Scan**) with the
|
|
|
75
123
|
|
|
76
124
|
You only need to do this once — the session persists across container restarts.
|
|
77
125
|
|
|
78
|
-
###
|
|
126
|
+
### 7. Configure DM and group policies
|
|
79
127
|
|
|
80
128
|
Once connected, configure how the bot handles direct messages and group chats. You can ask your bot to help you, or edit the config directly. See the Configuration Reference below.
|
|
81
129
|
|
|
@@ -87,53 +135,6 @@ Once connected, configure how the bot handles direct messages and group chats. Y
|
|
|
87
135
|
|
|
88
136
|
- **Infrastructure updates disconnect the bot.** If the agent-wechat server restarts or updates, the bot will be disconnected. When this happens, ask your bot to log in again. If the disconnection was brief, you may not need a new QR code scan.
|
|
89
137
|
|
|
90
|
-
## Starting the agent-wechat Server
|
|
91
|
-
|
|
92
|
-
If you need to run the server yourself:
|
|
93
|
-
|
|
94
|
-
**Option A: CLI** (quickest for local use)
|
|
95
|
-
|
|
96
|
-
```bash
|
|
97
|
-
npm install -g @agent-wechat/cli
|
|
98
|
-
wx up
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
**Option B: Docker Compose** (production / networked)
|
|
102
|
-
|
|
103
|
-
```yaml
|
|
104
|
-
services:
|
|
105
|
-
agent-wechat:
|
|
106
|
-
image: ghcr.io/thisnick/agent-wechat:latest
|
|
107
|
-
container_name: agent-wechat
|
|
108
|
-
security_opt:
|
|
109
|
-
- seccomp=unconfined
|
|
110
|
-
cap_add:
|
|
111
|
-
- SYS_PTRACE
|
|
112
|
-
ports:
|
|
113
|
-
- "6174:6174"
|
|
114
|
-
- "127.0.0.1:5900:5900"
|
|
115
|
-
volumes:
|
|
116
|
-
- agent-wechat-data:/data
|
|
117
|
-
- agent-wechat-home:/home/wechat
|
|
118
|
-
- ~/.config/agent-wechat/token:/data/auth-token:ro
|
|
119
|
-
restart: unless-stopped
|
|
120
|
-
|
|
121
|
-
volumes:
|
|
122
|
-
agent-wechat-data:
|
|
123
|
-
agent-wechat-home:
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
Generate a token before starting:
|
|
127
|
-
|
|
128
|
-
```bash
|
|
129
|
-
mkdir -p ~/.config/agent-wechat
|
|
130
|
-
openssl rand -hex 32 > ~/.config/agent-wechat/token
|
|
131
|
-
chmod 600 ~/.config/agent-wechat/token
|
|
132
|
-
docker compose up -d
|
|
133
|
-
```
|
|
134
|
-
|
|
135
|
-
If running alongside OpenClaw on the same Docker network, set `serverUrl` to `http://agent-wechat:6174` in the channel config.
|
|
136
|
-
|
|
137
138
|
## Configuration Reference
|
|
138
139
|
|
|
139
140
|
All config lives under `channels.wechat` in OpenClaw's config file:
|