@wu529778790/open-im 1.9.4-beta.11 → 1.9.4-beta.12
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 +157 -202
- package/README.zh-CN.md +151 -202
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -1,24 +1,25 @@
|
|
|
1
1
|
# open-im
|
|
2
2
|
|
|
3
|
-
[
|
|
3
|
+
[中文文档](./README.zh-CN.md)
|
|
4
4
|
|
|
5
|
-
Multi-platform IM bridge for AI CLI tools. Connect Telegram, Feishu, WeCom, DingTalk, QQ, and WeChat to Claude Code, Codex, and CodeBuddy
|
|
5
|
+
Multi-platform IM bridge for AI CLI tools. Connect Telegram, Feishu, WeCom, DingTalk, QQ, and WeChat to Claude Code, Codex, and CodeBuddy — use your AI coding assistant from any phone or chat window.
|
|
6
6
|
|
|
7
7
|
## Features
|
|
8
8
|
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
- Per-platform AI routing
|
|
12
|
-
- Streaming replies
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
-
|
|
9
|
+
- **6 IM platforms** — Telegram, Feishu, WeCom, DingTalk, QQ, WeChat (WorkBuddy), all can run simultaneously
|
|
10
|
+
- **3 AI backends** — Claude (Agent SDK), Codex, CodeBuddy
|
|
11
|
+
- **Per-platform AI routing** — each IM can use a different AI tool
|
|
12
|
+
- **Streaming replies** — real-time AI output and tool progress (platform-dependent)
|
|
13
|
+
- **Media support** — send images, files, voice, video for AI analysis
|
|
14
|
+
- **Session isolation** — independent sessions per user, `/new` to reset
|
|
15
|
+
- **Web config UI** — graphical dashboard for setup and management
|
|
16
|
+
- **Built-in commands** — `/help`, `/new`, `/cd`, `/pwd`, `/status`, `/allow`, `/deny`
|
|
16
17
|
|
|
17
18
|
## Requirements
|
|
18
19
|
|
|
19
20
|
- Node.js >= 20
|
|
20
21
|
- At least one IM platform configured
|
|
21
|
-
- Authentication
|
|
22
|
+
- Authentication for the AI tool you want to use
|
|
22
23
|
|
|
23
24
|
## Quick Start
|
|
24
25
|
|
|
@@ -33,114 +34,95 @@ npm install -g @wu529778790/open-im
|
|
|
33
34
|
open-im start
|
|
34
35
|
```
|
|
35
36
|
|
|
36
|
-
|
|
37
|
+
Config file: `~/.open-im/config.json`
|
|
37
38
|
|
|
38
39
|
## CLI Commands
|
|
39
40
|
|
|
40
|
-
| Command
|
|
41
|
-
|
|
|
42
|
-
| `open-im init`
|
|
43
|
-
| `open-im start`
|
|
44
|
-
| `open-im stop`
|
|
45
|
-
| `open-im dev`
|
|
46
|
-
| `open-im dashboard` |
|
|
41
|
+
| Command | Description |
|
|
42
|
+
| ------------------- | -------------------------------------- |
|
|
43
|
+
| `open-im init` | Configure without starting the service |
|
|
44
|
+
| `open-im start` | Run as background service |
|
|
45
|
+
| `open-im stop` | Stop background service |
|
|
46
|
+
| `open-im dev` | Run in foreground (debugging) |
|
|
47
|
+
| `open-im dashboard` | Web config UI only (no bridge) |
|
|
47
48
|
|
|
48
|
-
##
|
|
49
|
+
## Web Configuration
|
|
49
50
|
|
|
50
|
-
### Local
|
|
51
|
+
### Local
|
|
51
52
|
|
|
52
|
-
Open
|
|
53
|
+
Open [`http://127.0.0.1:39282`](http://127.0.0.1:39282) after starting. The dashboard includes:
|
|
53
54
|
|
|
54
|
-
- **
|
|
55
|
-
- **Platforms**
|
|
56
|
-
- **AI Tooling**
|
|
57
|
-
- **Service control**
|
|
55
|
+
- **Overview** — platform count, service status
|
|
56
|
+
- **Platforms** — enable and configure each IM (credentials, proxy, AI tool, allowed users)
|
|
57
|
+
- **AI Tooling** — default tool, work directory, per-tool settings (CLI path, timeout, proxy, API keys)
|
|
58
|
+
- **Service control** — validate, save, start/stop bridge
|
|
58
59
|
|
|
59
|
-
WorkBuddy (WeChat) is
|
|
60
|
+
> WorkBuddy (WeChat) is configured via `open-im init` or directly in `~/.open-im/config.json`.
|
|
60
61
|
|
|
61
|
-
|
|
62
|
-
- `open-im dev` opens the page automatically only when setup is incomplete.
|
|
63
|
-
- To open the page when config already exists, you can also run `open-im dashboard` to launch the config UI only (without starting the bridge).
|
|
62
|
+
### Remote Server
|
|
64
63
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
On the server:
|
|
72
|
-
|
|
73
|
-
```bash
|
|
74
|
-
export OPEN_IM_NO_BROWSER=1
|
|
75
|
-
# Optional: bind to all interfaces if you want to open from another device
|
|
76
|
-
# export OPEN_IM_WEB_HOST=0.0.0.0
|
|
77
|
-
open-im dashboard
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
- This starts only the config web UI (no bridge yet).
|
|
81
|
-
- If `OPEN_IM_WEB_HOST` is `0.0.0.0`, the server will print a one-time login URL like:
|
|
64
|
+
```bash
|
|
65
|
+
export OPEN_IM_NO_BROWSER=1
|
|
66
|
+
# Optional: allow access from other devices
|
|
67
|
+
# export OPEN_IM_WEB_HOST=0.0.0.0
|
|
68
|
+
open-im dashboard
|
|
69
|
+
```
|
|
82
70
|
|
|
83
|
-
|
|
84
|
-
http://your-server-ip:39282/?login_token=xxxx
|
|
85
|
-
```
|
|
71
|
+
If `OPEN_IM_WEB_HOST=0.0.0.0`, the server prints a one-time login URL:
|
|
86
72
|
|
|
87
|
-
|
|
73
|
+
```
|
|
74
|
+
http://your-server-ip:39282/?login_token=xxxx
|
|
75
|
+
```
|
|
88
76
|
|
|
89
|
-
|
|
77
|
+
Complete setup in the browser, then start the bridge:
|
|
90
78
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
79
|
+
```bash
|
|
80
|
+
open-im start
|
|
81
|
+
```
|
|
94
82
|
|
|
95
|
-
|
|
96
|
-
open-im start
|
|
97
|
-
```
|
|
83
|
+
## IM Commands
|
|
98
84
|
|
|
99
|
-
|
|
85
|
+
| Command | Description |
|
|
86
|
+
| ------------- | ------------------------------------ |
|
|
87
|
+
| `/help` | Show help |
|
|
88
|
+
| `/new` | Start a new AI session |
|
|
89
|
+
| `/status` | Show AI tool, version, session info |
|
|
90
|
+
| `/cd <path>` | Change session working directory |
|
|
91
|
+
| `/pwd` | Show current working directory |
|
|
92
|
+
| `/allow` `/y` | Approve a permission request |
|
|
93
|
+
| `/deny` `/n` | Reject a permission request |
|
|
100
94
|
|
|
101
95
|
## Session Behavior
|
|
102
96
|
|
|
103
|
-
|
|
97
|
+
Sessions are stored locally in `~/.open-im/data/sessions.json`, separate from IM chat history. Each user gets an independent session directory. `/new` resets the AI session.
|
|
104
98
|
|
|
105
99
|
## Configuration
|
|
106
100
|
|
|
107
|
-
|
|
101
|
+
### Per-Platform AI Routing
|
|
108
102
|
|
|
109
|
-
|
|
103
|
+
The root-level `aiCommand` is the default AI tool. Override per-platform with `platforms.<name>.aiCommand`:
|
|
110
104
|
|
|
111
105
|
```json
|
|
112
106
|
{
|
|
113
107
|
"aiCommand": "claude",
|
|
114
108
|
"platforms": {
|
|
115
|
-
"telegram": {
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
},
|
|
119
|
-
"feishu": {
|
|
120
|
-
"enabled": true,
|
|
121
|
-
"aiCommand": "codex"
|
|
122
|
-
},
|
|
123
|
-
"qq": {
|
|
124
|
-
"enabled": true,
|
|
125
|
-
"aiCommand": "codebuddy"
|
|
126
|
-
}
|
|
109
|
+
"telegram": { "enabled": true, "aiCommand": "codex" },
|
|
110
|
+
"feishu": { "enabled": true, "aiCommand": "codex" },
|
|
111
|
+
"qq": { "enabled": true, "aiCommand": "codebuddy" }
|
|
127
112
|
}
|
|
128
113
|
}
|
|
129
114
|
```
|
|
130
115
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
### Claude
|
|
116
|
+
### Claude (Agent SDK)
|
|
134
117
|
|
|
135
|
-
Claude uses the Agent SDK by default
|
|
136
|
-
|
|
137
|
-
Load order:
|
|
118
|
+
Claude uses the Agent SDK by default — no local `claude` executable needed. Provide API credentials:
|
|
138
119
|
|
|
120
|
+
Credential load order:
|
|
139
121
|
1. Environment variables
|
|
140
122
|
2. `env` in `~/.open-im/config.json`
|
|
141
123
|
3. `~/.claude/settings.json` or `~/.claude.json`
|
|
142
124
|
|
|
143
|
-
|
|
125
|
+
Compatible with third-party endpoints:
|
|
144
126
|
|
|
145
127
|
```json
|
|
146
128
|
{
|
|
@@ -152,47 +134,41 @@ Both the official API and compatible third-party endpoints are supported:
|
|
|
152
134
|
}
|
|
153
135
|
```
|
|
154
136
|
|
|
137
|
+
Claude automatically inherits plugins and settings from your local `~/.claude/settings.json`.
|
|
138
|
+
|
|
155
139
|
### CodeBuddy
|
|
156
140
|
|
|
157
|
-
|
|
141
|
+
Install the CLI and log in:
|
|
158
142
|
|
|
159
143
|
```bash
|
|
160
144
|
npm install -g @tencent-ai/codebuddy-code
|
|
161
|
-
codebuddy --version
|
|
162
145
|
codebuddy login
|
|
163
146
|
```
|
|
164
147
|
|
|
165
|
-
|
|
148
|
+
Config keys:
|
|
149
|
+
- `tools.codebuddy.cliPath` — CLI path (default: `codebuddy`)
|
|
150
|
+
- `tools.codebuddy.skipPermissions` — skip permission prompts (default: `true`)
|
|
151
|
+
- `tools.codebuddy.timeoutMs` — execution timeout (default: `600000`)
|
|
166
152
|
|
|
167
|
-
|
|
168
|
-
- `tools.codebuddy.skipPermissions`: whether to skip permission confirmation, defaults to `true`
|
|
169
|
-
- `tools.codebuddy.timeoutMs`: total execution timeout, defaults to `600000`
|
|
170
|
-
- `platforms.<platform>.aiCommand`: set to `codebuddy` if that IM platform should use CodeBuddy
|
|
153
|
+
On Windows, if `cliPath` is `codebuddy`, open-im also checks `AppData\Roaming\npm\codebuddy.cmd`.
|
|
171
154
|
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
### Example Config File
|
|
175
|
-
|
|
176
|
-
The following is valid JSON and can be saved directly as `~/.open-im/config.json`:
|
|
155
|
+
### Example Config
|
|
177
156
|
|
|
178
157
|
```json
|
|
179
158
|
{
|
|
180
159
|
"aiCommand": "claude",
|
|
181
160
|
"tools": {
|
|
182
161
|
"claude": {
|
|
183
|
-
"
|
|
184
|
-
"workDir": "D:/coding/open-im",
|
|
162
|
+
"workDir": "/path/to/project",
|
|
185
163
|
"skipPermissions": true,
|
|
186
164
|
"timeoutMs": 600000
|
|
187
165
|
},
|
|
188
166
|
"codex": {
|
|
189
|
-
"
|
|
190
|
-
"workDir": "D:/coding/open-im",
|
|
167
|
+
"workDir": "/path/to/project",
|
|
191
168
|
"skipPermissions": true,
|
|
192
169
|
"proxy": "http://127.0.0.1:7890"
|
|
193
170
|
},
|
|
194
171
|
"codebuddy": {
|
|
195
|
-
"cliPath": "codebuddy",
|
|
196
172
|
"skipPermissions": true,
|
|
197
173
|
"timeoutMs": 600000
|
|
198
174
|
}
|
|
@@ -200,44 +176,31 @@ The following is valid JSON and can be saved directly as `~/.open-im/config.json
|
|
|
200
176
|
"platforms": {
|
|
201
177
|
"telegram": {
|
|
202
178
|
"enabled": true,
|
|
203
|
-
"aiCommand": "codex",
|
|
204
|
-
"proxy": "http://127.0.0.1:7890",
|
|
205
|
-
"allowedUserIds": [],
|
|
206
179
|
"botToken": "YOUR_TELEGRAM_BOT_TOKEN"
|
|
207
180
|
},
|
|
208
181
|
"feishu": {
|
|
209
182
|
"enabled": false,
|
|
210
|
-
"aiCommand": "codex",
|
|
211
|
-
"allowedUserIds": [],
|
|
212
183
|
"appId": "YOUR_FEISHU_APP_ID",
|
|
213
184
|
"appSecret": "YOUR_FEISHU_APP_SECRET"
|
|
214
185
|
},
|
|
215
186
|
"qq": {
|
|
216
187
|
"enabled": false,
|
|
217
|
-
"aiCommand": "codebuddy",
|
|
218
|
-
"allowedUserIds": [],
|
|
219
188
|
"appId": "YOUR_QQ_APP_ID",
|
|
220
189
|
"secret": "YOUR_QQ_APP_SECRET"
|
|
221
190
|
},
|
|
222
191
|
"wework": {
|
|
223
192
|
"enabled": false,
|
|
224
|
-
"aiCommand": "claude",
|
|
225
|
-
"allowedUserIds": [],
|
|
226
193
|
"corpId": "YOUR_WEWORK_CORP_ID",
|
|
227
194
|
"secret": "YOUR_WEWORK_SECRET"
|
|
228
195
|
},
|
|
229
196
|
"dingtalk": {
|
|
230
197
|
"enabled": false,
|
|
231
|
-
"aiCommand": "claude",
|
|
232
|
-
"allowedUserIds": [],
|
|
233
198
|
"clientId": "YOUR_DINGTALK_CLIENT_ID",
|
|
234
199
|
"clientSecret": "YOUR_DINGTALK_CLIENT_SECRET",
|
|
235
200
|
"cardTemplateId": "YOUR_DINGTALK_AI_CARD_TEMPLATE_ID"
|
|
236
201
|
},
|
|
237
202
|
"workbuddy": {
|
|
238
203
|
"enabled": false,
|
|
239
|
-
"aiCommand": "claude",
|
|
240
|
-
"allowedUserIds": [],
|
|
241
204
|
"accessToken": "",
|
|
242
205
|
"refreshToken": "",
|
|
243
206
|
"userId": ""
|
|
@@ -246,101 +209,93 @@ The following is valid JSON and can be saved directly as `~/.open-im/config.json
|
|
|
246
209
|
}
|
|
247
210
|
```
|
|
248
211
|
|
|
249
|
-
###
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
|
254
|
-
|
|
|
255
|
-
| `
|
|
256
|
-
| `
|
|
257
|
-
| `
|
|
258
|
-
| `
|
|
259
|
-
| `
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
|
264
|
-
|
|
|
265
|
-
| `
|
|
266
|
-
| `
|
|
267
|
-
| `
|
|
268
|
-
| `
|
|
269
|
-
| `
|
|
270
|
-
| `
|
|
271
|
-
| `
|
|
272
|
-
| `
|
|
273
|
-
| `
|
|
274
|
-
| `
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
|
279
|
-
|
|
|
280
|
-
| `
|
|
281
|
-
| `
|
|
282
|
-
| `
|
|
283
|
-
| `
|
|
284
|
-
| `
|
|
285
|
-
| `
|
|
286
|
-
| `
|
|
287
|
-
| `
|
|
288
|
-
| `
|
|
289
|
-
| `
|
|
290
|
-
| `
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
|
312
|
-
|
|
|
313
|
-
|
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
212
|
+
### Environment Variables
|
|
213
|
+
|
|
214
|
+
#### General
|
|
215
|
+
|
|
216
|
+
| Variable | Description |
|
|
217
|
+
| ------------------- | ---------------------------------------------- |
|
|
218
|
+
| `AI_COMMAND` | Default AI tool (`claude` / `codex` / `codebuddy`) |
|
|
219
|
+
| `CLAUDE_WORK_DIR` | Default session working directory |
|
|
220
|
+
| `LOG_DIR` | Log directory |
|
|
221
|
+
| `LOG_LEVEL` | Log level |
|
|
222
|
+
| `HOOK_PORT` | Permission service port |
|
|
223
|
+
|
|
224
|
+
#### AI Tool Credentials
|
|
225
|
+
|
|
226
|
+
| Variable | Description |
|
|
227
|
+
| ---------------------------- | ------------------------------------------ |
|
|
228
|
+
| `ANTHROPIC_API_KEY` | Claude API key |
|
|
229
|
+
| `ANTHROPIC_AUTH_TOKEN` | Claude OAuth token |
|
|
230
|
+
| `ANTHROPIC_BASE_URL` | Claude API base URL |
|
|
231
|
+
| `ANTHROPIC_MODEL` | Claude model name |
|
|
232
|
+
| `OPENAI_API_KEY` | Codex API key |
|
|
233
|
+
| `CODEX_PROXY` | Codex proxy for `chatgpt.com` |
|
|
234
|
+
| `CODEBUDDY_CLI_PATH` | CodeBuddy CLI path |
|
|
235
|
+
| `CODEBUDDY_TIMEOUT_MS` | CodeBuddy timeout |
|
|
236
|
+
| `CODEBUDDY_API_KEY` | CodeBuddy API key |
|
|
237
|
+
| `CODEBUDDY_AUTH_TOKEN` | CodeBuddy auth token |
|
|
238
|
+
|
|
239
|
+
#### Platform Credentials
|
|
240
|
+
|
|
241
|
+
| Variable | Description |
|
|
242
|
+
| ---------------------------- | ------------------------------------------ |
|
|
243
|
+
| `TELEGRAM_BOT_TOKEN` | Telegram bot token |
|
|
244
|
+
| `TELEGRAM_PROXY` | Telegram proxy URL |
|
|
245
|
+
| `TELEGRAM_ALLOWED_USER_IDS` | Telegram allowed user IDs |
|
|
246
|
+
| `FEISHU_APP_ID` | Feishu app ID |
|
|
247
|
+
| `FEISHU_APP_SECRET` | Feishu app secret |
|
|
248
|
+
| `FEISHU_ALLOWED_USER_IDS` | Feishu allowed user IDs |
|
|
249
|
+
| `QQ_BOT_APPID` | QQ bot app ID |
|
|
250
|
+
| `QQ_BOT_SECRET` | QQ bot app secret |
|
|
251
|
+
| `QQ_BOT_SANDBOX` | QQ sandbox mode (`1` / `true`) |
|
|
252
|
+
| `QQ_ALLOWED_USER_IDS` | QQ allowed user IDs |
|
|
253
|
+
| `DINGTALK_CLIENT_ID` | DingTalk client ID / AppKey |
|
|
254
|
+
| `DINGTALK_CLIENT_SECRET` | DingTalk client secret / AppSecret |
|
|
255
|
+
| `DINGTALK_CARD_TEMPLATE_ID` | DingTalk AI card template ID |
|
|
256
|
+
| `DINGTALK_ALLOWED_USER_IDS` | DingTalk allowed user IDs |
|
|
257
|
+
| `WEWORK_CORP_ID` | WeCom bot ID |
|
|
258
|
+
| `WEWORK_SECRET` | WeCom secret |
|
|
259
|
+
| `WEWORK_WS_URL` | WeCom WebSocket URL |
|
|
260
|
+
| `WEWORK_ALLOWED_USER_IDS` | WeCom allowed user IDs |
|
|
261
|
+
| `WORKBUDDY_ACCESS_TOKEN` | WorkBuddy OAuth access token |
|
|
262
|
+
| `WORKBUDDY_REFRESH_TOKEN` | WorkBuddy OAuth refresh token |
|
|
263
|
+
| `WORKBUDDY_USER_ID` | WorkBuddy user ID |
|
|
264
|
+
| `WORKBUDDY_BASE_URL` | WorkBuddy API base URL |
|
|
265
|
+
| `WORKBUDDY_ALLOWED_USER_IDS` | WorkBuddy allowed user IDs |
|
|
266
|
+
|
|
267
|
+
### Platform Setup
|
|
268
|
+
|
|
269
|
+
| Platform | Setup source |
|
|
270
|
+
| --------- | --------------------------------------------------------------- |
|
|
271
|
+
| Telegram | [@BotFather](https://t.me/BotFather) |
|
|
272
|
+
| Feishu | [Feishu Open Platform](https://open.feishu.cn/) |
|
|
273
|
+
| QQ | [QQ Open Platform](https://bot.q.qq.com/) |
|
|
274
|
+
| DingTalk | DingTalk Open Platform — enable bot Stream Mode |
|
|
275
|
+
| WeCom | [WeCom admin console](https://work.weixin.qq.com/) |
|
|
276
|
+
| WeChat | Run `open-im init` and select "WorkBuddy" for OAuth + binding |
|
|
277
|
+
|
|
278
|
+
**DingTalk notes:**
|
|
279
|
+
- Uses Stream Mode (receive) + OpenAPI (send)
|
|
280
|
+
- With `cardTemplateId`: AI assistant streaming cards; falls back to plain text on failure
|
|
281
|
+
- Custom bots and regular groups only support single text replies
|
|
282
|
+
- Startup/shutdown notifications are not sent to DingTalk
|
|
320
283
|
|
|
321
284
|
## Troubleshooting
|
|
322
285
|
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
**Codex shows `stream disconnected` or `error sending request`**: `chatgpt.com` is not reachable. Configure `tools.codex.proxy` or set `CODEX_PROXY`.
|
|
338
|
-
|
|
339
|
-
**CodeBuddy prompts for login**: run `codebuddy login` first. `open-im` does not read CodeBuddy login state from `~/.open-im/config.json`.
|
|
340
|
-
|
|
341
|
-
**WorkBuddy cannot connect**: run `open-im init` to re-authenticate. Tokens may expire — the client will attempt auto-reconnect, but if the refresh token is invalid, a fresh login is required.
|
|
342
|
-
|
|
343
|
-
**WorkBuddy WeChat KF not receiving messages**: ensure the WeChat KF binding was completed during `open-im init`. You can re-run init to generate a new binding link.
|
|
286
|
+
| Issue | Solution |
|
|
287
|
+
| ----- | -------- |
|
|
288
|
+
| Telegram not responding | Check network, add `proxy` or set `TELEGRAM_PROXY` |
|
|
289
|
+
| QQ cannot connect | Verify bot is created and `QQ_BOT_APPID` / `QQ_BOT_SECRET` are correct |
|
|
290
|
+
| QQ duplicate replies | Update to latest version |
|
|
291
|
+
| Feishu card errors | Use `/mode ask` or `/mode yolo` without card callbacks |
|
|
292
|
+
| WeCom no notifications | Send at least one message to the bot first |
|
|
293
|
+
| DingTalk cannot reply | Verify Stream Mode is enabled and credentials are correct |
|
|
294
|
+
| DingTalk no streaming | Custom bots only support plain text; configure `cardTemplateId` for AI assistant streaming |
|
|
295
|
+
| Codex `stream disconnected` | Configure `tools.codex.proxy` or `CODEX_PROXY` for `chatgpt.com` access |
|
|
296
|
+
| CodeBuddy asks for login | Run `codebuddy login` first |
|
|
297
|
+
| WorkBuddy cannot connect | Run `open-im init` to re-authenticate; tokens may expire |
|
|
298
|
+
| WorkBuddy WeChat not receiving | Re-run `open-im init` to generate new WeChat KF binding link |
|
|
344
299
|
|
|
345
300
|
## License
|
|
346
301
|
|
package/README.zh-CN.md
CHANGED
|
@@ -2,17 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
[English](./README.md)
|
|
4
4
|
|
|
5
|
-
多平台 IM 桥接工具,把 Telegram、飞书、企业微信、钉钉、QQ、微信接到 AI CLI 工具(Claude Code、Codex、CodeBuddy
|
|
5
|
+
多平台 IM 桥接工具,把 Telegram、飞书、企业微信、钉钉、QQ、微信接到 AI CLI 工具(Claude Code、Codex、CodeBuddy),在手机或聊天窗口远程使用 AI 编程助手。
|
|
6
6
|
|
|
7
7
|
## 功能特性
|
|
8
8
|
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
-
|
|
9
|
+
- **6 个 IM 平台** — Telegram、飞书、企业微信、钉钉、QQ、微信(WorkBuddy),可同时启用
|
|
10
|
+
- **3 种 AI 后端** — Claude(Agent SDK)、Codex、CodeBuddy
|
|
11
|
+
- **按平台分配 AI** — 每个 IM 平台可以使用不同的 AI 工具
|
|
12
|
+
- **流式输出** — 实时回传 AI 回复与工具执行进度(因平台而异)
|
|
13
|
+
- **多媒体支持** — 支持发送图片、文件、语音、视频进行 AI 分析
|
|
14
|
+
- **会话隔离** — 每个用户独立维护本地会话,`/new` 可重置
|
|
15
|
+
- **Web 配置页面** — 图形化仪表板,在线管理配置
|
|
16
|
+
- **内置命令** — `/help`、`/new`、`/cd`、`/pwd`、`/status`、`/allow`、`/deny`
|
|
16
17
|
|
|
17
18
|
## 环境要求
|
|
18
19
|
|
|
@@ -33,120 +34,95 @@ npm install -g @wu529778790/open-im
|
|
|
33
34
|
open-im start
|
|
34
35
|
```
|
|
35
36
|
|
|
36
|
-
|
|
37
|
+
配置文件:`~/.open-im/config.json`
|
|
37
38
|
|
|
38
39
|
## CLI 命令
|
|
39
40
|
|
|
40
|
-
| 命令
|
|
41
|
-
|
|
|
42
|
-
| `open-im init`
|
|
43
|
-
| `open-im start`
|
|
44
|
-
| `open-im stop`
|
|
45
|
-
| `open-im dev`
|
|
46
|
-
| `open-im dashboard` | 仅启动 Web
|
|
41
|
+
| 命令 | 说明 |
|
|
42
|
+
| ------------------- | ------------------------------ |
|
|
43
|
+
| `open-im init` | 配置平台和 AI 工具,不启动服务 |
|
|
44
|
+
| `open-im start` | 后台运行服务 |
|
|
45
|
+
| `open-im stop` | 停止后台服务 |
|
|
46
|
+
| `open-im dev` | 前台运行(调试模式) |
|
|
47
|
+
| `open-im dashboard` | 仅启动 Web 配置页(不启动桥接)|
|
|
47
48
|
|
|
48
|
-
##
|
|
49
|
+
## Web 配置页面
|
|
49
50
|
|
|
50
|
-
###
|
|
51
|
+
### 本机使用
|
|
51
52
|
|
|
52
|
-
|
|
53
|
+
启动后打开 [`http://127.0.0.1:39282`](http://127.0.0.1:39282),页面包括:
|
|
53
54
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
然后在浏览器中打开 [`http://127.0.0.1:39282`](http://127.0.0.1:39282)(或命令行里提示的地址),页面结构如下:
|
|
59
|
-
|
|
60
|
-
- **概览** – 已配置/已启用平台数量、服务状态(未启动或运行中)
|
|
61
|
-
- **平台配置** – 启用并填写 Telegram、飞书、QQ、企业微信、钉钉的凭证(Bot Token/App ID/Secret、代理、该平台使用的 AI 工具、白名单用户 ID)。每个平台提供「校验配置」按钮
|
|
62
|
-
- **AI 工具配置** – **公共**:默认 AI 工具(Claude / Codex / CodeBuddy)、工作目录、Hook 端口、日志级别。**分工具**:Claude(CLI 路径、超时、代理、配置路径、ANTHROPIC\_\* 等)、Codex(CLI 路径、超时、代理)、CodeBuddy(CLI 路径、超时)
|
|
63
|
-
- **服务控制** – 校验配置、保存、启动桥接、停止桥接
|
|
64
|
-
|
|
65
|
-
WorkBuddy(微信)暂不在网页中配置,如需使用请在 `~/.open-im/config.json` 中手动配置或通过 `open-im init` 引导。
|
|
55
|
+
- **概览** — 已配置/已启用平台数量、服务状态
|
|
56
|
+
- **平台配置** — 启用并填写各 IM 的凭证(Token/App ID/Secret、代理、AI 工具、白名单)
|
|
57
|
+
- **AI 工具配置** — 默认 AI 工具、工作目录、各工具单独设置(CLI 路径、超时、代理、API Key)
|
|
58
|
+
- **服务控制** — 校验配置、保存、启动/停止桥接
|
|
66
59
|
|
|
67
|
-
|
|
68
|
-
- `open-im dev` 仅在未完成配置时自动打开页面。
|
|
69
|
-
- 已有配置但想单独打开配置页时,可以使用 `open-im dashboard` 启动仅 Web 配置服务。
|
|
60
|
+
> WorkBuddy(微信)通过 `open-im init` 或直接编辑 `~/.open-im/config.json` 配置。
|
|
70
61
|
|
|
71
|
-
###
|
|
62
|
+
### 远程服务器
|
|
72
63
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
```bash
|
|
80
|
-
export OPEN_IM_NO_BROWSER=1
|
|
81
|
-
# 可选:如果希望从其他设备访问配置页,可以绑定到所有网卡
|
|
82
|
-
# export OPEN_IM_WEB_HOST=0.0.0.0
|
|
83
|
-
open-im dashboard
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
- 这只会启动 Web 配置页,不会同时启动桥接服务。
|
|
87
|
-
- 若设置了 `OPEN_IM_WEB_HOST=0.0.0.0`,服务端会输出一次性登录链接,例如:
|
|
64
|
+
```bash
|
|
65
|
+
export OPEN_IM_NO_BROWSER=1
|
|
66
|
+
# 可选:允许从其他设备访问配置页
|
|
67
|
+
# export OPEN_IM_WEB_HOST=0.0.0.0
|
|
68
|
+
open-im dashboard
|
|
69
|
+
```
|
|
88
70
|
|
|
89
|
-
|
|
90
|
-
http://your-server-ip:39282/?login_token=xxxx
|
|
91
|
-
```
|
|
71
|
+
若设置了 `OPEN_IM_WEB_HOST=0.0.0.0`,服务端会输出一次性登录链接:
|
|
92
72
|
|
|
93
|
-
|
|
73
|
+
```
|
|
74
|
+
http://your-server-ip:39282/?login_token=xxxx
|
|
75
|
+
```
|
|
94
76
|
|
|
95
|
-
|
|
77
|
+
在浏览器中完成配置后,启动桥接服务:
|
|
96
78
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
79
|
+
```bash
|
|
80
|
+
open-im start
|
|
81
|
+
```
|
|
100
82
|
|
|
101
|
-
|
|
102
|
-
open-im start
|
|
103
|
-
```
|
|
83
|
+
## IM 内命令
|
|
104
84
|
|
|
105
|
-
|
|
85
|
+
| 命令 | 说明 |
|
|
86
|
+
| ------------- | ---------------------- |
|
|
87
|
+
| `/help` | 显示帮助 |
|
|
88
|
+
| `/new` | 开始新的 AI 会话 |
|
|
89
|
+
| `/status` | 显示 AI 工具和会话信息 |
|
|
90
|
+
| `/cd <路径>` | 切换会话目录 |
|
|
91
|
+
| `/pwd` | 显示当前会话目录 |
|
|
92
|
+
| `/allow` `/y` | 允许权限请求 |
|
|
93
|
+
| `/deny` `/n` | 拒绝权限请求 |
|
|
106
94
|
|
|
107
95
|
## 会话说明
|
|
108
96
|
|
|
109
|
-
|
|
97
|
+
会话保存在本地 `~/.open-im/data/sessions.json`,与 IM 聊天记录无关。每个用户有独立的会话目录。`/new` 重置当前 AI 会话。
|
|
110
98
|
|
|
111
99
|
## 配置说明
|
|
112
100
|
|
|
113
|
-
|
|
101
|
+
### 按平台分配 AI 工具
|
|
114
102
|
|
|
115
|
-
|
|
103
|
+
根级 `aiCommand` 是默认 AI 工具,可通过 `platforms.<name>.aiCommand` 为不同 IM 单独指定:
|
|
116
104
|
|
|
117
105
|
```json
|
|
118
106
|
{
|
|
119
107
|
"aiCommand": "claude",
|
|
120
108
|
"platforms": {
|
|
121
|
-
"telegram": {
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
},
|
|
125
|
-
"feishu": {
|
|
126
|
-
"enabled": true,
|
|
127
|
-
"aiCommand": "codex"
|
|
128
|
-
},
|
|
129
|
-
"qq": {
|
|
130
|
-
"enabled": true,
|
|
131
|
-
"aiCommand": "codebuddy"
|
|
132
|
-
}
|
|
109
|
+
"telegram": { "enabled": true, "aiCommand": "codex" },
|
|
110
|
+
"feishu": { "enabled": true, "aiCommand": "codex" },
|
|
111
|
+
"qq": { "enabled": true, "aiCommand": "codebuddy" }
|
|
133
112
|
}
|
|
134
113
|
}
|
|
135
114
|
```
|
|
136
115
|
|
|
137
|
-
|
|
116
|
+
### Claude(Agent SDK)
|
|
138
117
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
Claude 默认使用 Agent SDK,不依赖本地 `claude` 可执行文件;通常只需要配置 API 凭证。
|
|
142
|
-
|
|
143
|
-
自动加载顺序:
|
|
118
|
+
Claude 默认使用 Agent SDK,不需要本地 `claude` 可执行文件,只需配置 API 凭证。
|
|
144
119
|
|
|
120
|
+
凭证加载顺序:
|
|
145
121
|
1. 环境变量
|
|
146
122
|
2. `~/.open-im/config.json` 的 `env`
|
|
147
123
|
3. `~/.claude/settings.json` 或 `~/.claude.json`
|
|
148
124
|
|
|
149
|
-
|
|
125
|
+
支持第三方兼容接口:
|
|
150
126
|
|
|
151
127
|
```json
|
|
152
128
|
{
|
|
@@ -158,47 +134,41 @@ Claude 默认使用 Agent SDK,不依赖本地 `claude` 可执行文件;通
|
|
|
158
134
|
}
|
|
159
135
|
```
|
|
160
136
|
|
|
137
|
+
Claude 会自动继承本地 `~/.claude/settings.json` 中的插件和配置。
|
|
138
|
+
|
|
161
139
|
### CodeBuddy
|
|
162
140
|
|
|
163
|
-
|
|
141
|
+
安装 CLI 并登录:
|
|
164
142
|
|
|
165
143
|
```bash
|
|
166
144
|
npm install -g @tencent-ai/codebuddy-code
|
|
167
|
-
codebuddy --version
|
|
168
145
|
codebuddy login
|
|
169
146
|
```
|
|
170
147
|
|
|
171
|
-
|
|
148
|
+
配置项:
|
|
149
|
+
- `tools.codebuddy.cliPath` — CLI 路径(默认:`codebuddy`)
|
|
150
|
+
- `tools.codebuddy.skipPermissions` — 跳过权限确认(默认:`true`)
|
|
151
|
+
- `tools.codebuddy.timeoutMs` — 执行超时(默认:`600000`)
|
|
172
152
|
|
|
173
|
-
|
|
174
|
-
- `tools.codebuddy.skipPermissions`:是否跳过权限确认,默认 `true`
|
|
175
|
-
- `tools.codebuddy.timeoutMs`:总执行超时,默认 `600000`
|
|
176
|
-
- `platforms.<platform>.aiCommand`:若某个平台要走 CodeBuddy,可设为 `codebuddy`
|
|
177
|
-
|
|
178
|
-
在 Windows 上,如果 `cliPath` 仍然是 `codebuddy`,open-im 还会自动尝试 `AppData\\Roaming\\npm\\codebuddy.cmd` 等常见全局安装路径。
|
|
153
|
+
Windows 上若 `cliPath` 为 `codebuddy`,会自动尝试 `AppData\Roaming\npm\codebuddy.cmd`。
|
|
179
154
|
|
|
180
155
|
### 配置文件示例
|
|
181
156
|
|
|
182
|
-
下面示例是合法 JSON,可直接保存为 `~/.open-im/config.json`:
|
|
183
|
-
|
|
184
157
|
```json
|
|
185
158
|
{
|
|
186
159
|
"aiCommand": "claude",
|
|
187
160
|
"tools": {
|
|
188
161
|
"claude": {
|
|
189
|
-
"
|
|
190
|
-
"workDir": "D:/coding/open-im",
|
|
162
|
+
"workDir": "/path/to/project",
|
|
191
163
|
"skipPermissions": true,
|
|
192
164
|
"timeoutMs": 600000
|
|
193
165
|
},
|
|
194
166
|
"codex": {
|
|
195
|
-
"
|
|
196
|
-
"workDir": "D:/coding/open-im",
|
|
167
|
+
"workDir": "/path/to/project",
|
|
197
168
|
"skipPermissions": true,
|
|
198
169
|
"proxy": "http://127.0.0.1:7890"
|
|
199
170
|
},
|
|
200
171
|
"codebuddy": {
|
|
201
|
-
"cliPath": "codebuddy",
|
|
202
172
|
"skipPermissions": true,
|
|
203
173
|
"timeoutMs": 600000
|
|
204
174
|
}
|
|
@@ -206,44 +176,31 @@ codebuddy login
|
|
|
206
176
|
"platforms": {
|
|
207
177
|
"telegram": {
|
|
208
178
|
"enabled": true,
|
|
209
|
-
"aiCommand": "codex",
|
|
210
|
-
"proxy": "http://127.0.0.1:7890",
|
|
211
|
-
"allowedUserIds": [],
|
|
212
179
|
"botToken": "YOUR_TELEGRAM_BOT_TOKEN"
|
|
213
180
|
},
|
|
214
181
|
"feishu": {
|
|
215
182
|
"enabled": false,
|
|
216
|
-
"aiCommand": "codex",
|
|
217
|
-
"allowedUserIds": [],
|
|
218
183
|
"appId": "YOUR_FEISHU_APP_ID",
|
|
219
184
|
"appSecret": "YOUR_FEISHU_APP_SECRET"
|
|
220
185
|
},
|
|
221
186
|
"qq": {
|
|
222
187
|
"enabled": false,
|
|
223
|
-
"aiCommand": "codebuddy",
|
|
224
|
-
"allowedUserIds": [],
|
|
225
188
|
"appId": "YOUR_QQ_APP_ID",
|
|
226
189
|
"secret": "YOUR_QQ_APP_SECRET"
|
|
227
190
|
},
|
|
228
191
|
"wework": {
|
|
229
192
|
"enabled": false,
|
|
230
|
-
"aiCommand": "claude",
|
|
231
|
-
"allowedUserIds": [],
|
|
232
193
|
"corpId": "YOUR_WEWORK_CORP_ID",
|
|
233
194
|
"secret": "YOUR_WEWORK_SECRET"
|
|
234
195
|
},
|
|
235
196
|
"dingtalk": {
|
|
236
197
|
"enabled": false,
|
|
237
|
-
"aiCommand": "claude",
|
|
238
|
-
"allowedUserIds": [],
|
|
239
198
|
"clientId": "YOUR_DINGTALK_CLIENT_ID",
|
|
240
199
|
"clientSecret": "YOUR_DINGTALK_CLIENT_SECRET",
|
|
241
200
|
"cardTemplateId": "YOUR_DINGTALK_AI_CARD_TEMPLATE_ID"
|
|
242
201
|
},
|
|
243
202
|
"workbuddy": {
|
|
244
203
|
"enabled": false,
|
|
245
|
-
"aiCommand": "claude",
|
|
246
|
-
"allowedUserIds": [],
|
|
247
204
|
"accessToken": "",
|
|
248
205
|
"refreshToken": "",
|
|
249
206
|
"userId": ""
|
|
@@ -252,101 +209,93 @@ codebuddy login
|
|
|
252
209
|
}
|
|
253
210
|
```
|
|
254
211
|
|
|
255
|
-
###
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
|
260
|
-
|
|
|
261
|
-
| `
|
|
262
|
-
| `
|
|
263
|
-
| `
|
|
264
|
-
| `
|
|
265
|
-
| `
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
|
270
|
-
|
|
|
271
|
-
| `
|
|
272
|
-
| `
|
|
273
|
-
| `
|
|
274
|
-
| `
|
|
275
|
-
| `
|
|
276
|
-
| `
|
|
277
|
-
| `
|
|
278
|
-
| `
|
|
279
|
-
| `
|
|
280
|
-
| `
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
|
285
|
-
|
|
|
286
|
-
| `
|
|
287
|
-
| `
|
|
288
|
-
| `
|
|
289
|
-
| `
|
|
290
|
-
| `
|
|
291
|
-
| `
|
|
292
|
-
| `
|
|
293
|
-
| `
|
|
294
|
-
| `
|
|
295
|
-
| `
|
|
296
|
-
| `
|
|
212
|
+
### 环境变量
|
|
213
|
+
|
|
214
|
+
#### 通用
|
|
215
|
+
|
|
216
|
+
| 变量 | 说明 |
|
|
217
|
+
| ----------------- | ------------------------------------------ |
|
|
218
|
+
| `AI_COMMAND` | 默认 AI 工具(`claude` / `codex` / `codebuddy`)|
|
|
219
|
+
| `CLAUDE_WORK_DIR` | 默认会话工作目录 |
|
|
220
|
+
| `LOG_DIR` | 日志目录 |
|
|
221
|
+
| `LOG_LEVEL` | 日志级别 |
|
|
222
|
+
| `HOOK_PORT` | 权限服务端口 |
|
|
223
|
+
|
|
224
|
+
#### AI 工具凭证
|
|
225
|
+
|
|
226
|
+
| 变量 | 说明 |
|
|
227
|
+
| ---------------------------- | ----------------------------- |
|
|
228
|
+
| `ANTHROPIC_API_KEY` | Claude API Key |
|
|
229
|
+
| `ANTHROPIC_AUTH_TOKEN` | Claude OAuth Token |
|
|
230
|
+
| `ANTHROPIC_BASE_URL` | Claude API 地址 |
|
|
231
|
+
| `ANTHROPIC_MODEL` | Claude 模型名称 |
|
|
232
|
+
| `OPENAI_API_KEY` | Codex API Key |
|
|
233
|
+
| `CODEX_PROXY` | Codex 访问 `chatgpt.com` 的代理|
|
|
234
|
+
| `CODEBUDDY_CLI_PATH` | CodeBuddy CLI 路径 |
|
|
235
|
+
| `CODEBUDDY_TIMEOUT_MS` | CodeBuddy 超时 |
|
|
236
|
+
| `CODEBUDDY_API_KEY` | CodeBuddy API Key |
|
|
237
|
+
| `CODEBUDDY_AUTH_TOKEN` | CodeBuddy Auth Token |
|
|
238
|
+
|
|
239
|
+
#### 平台凭证
|
|
240
|
+
|
|
241
|
+
| 变量 | 说明 |
|
|
242
|
+
| ---------------------------- | ----------------------------- |
|
|
243
|
+
| `TELEGRAM_BOT_TOKEN` | Telegram Bot Token |
|
|
244
|
+
| `TELEGRAM_PROXY` | Telegram 代理地址 |
|
|
245
|
+
| `TELEGRAM_ALLOWED_USER_IDS` | Telegram 白名单 |
|
|
246
|
+
| `FEISHU_APP_ID` | 飞书 App ID |
|
|
247
|
+
| `FEISHU_APP_SECRET` | 飞书 App Secret |
|
|
248
|
+
| `FEISHU_ALLOWED_USER_IDS` | 飞书白名单 |
|
|
249
|
+
| `QQ_BOT_APPID` | QQ 机器人 App ID |
|
|
250
|
+
| `QQ_BOT_SECRET` | QQ 机器人 App Secret |
|
|
251
|
+
| `QQ_BOT_SANDBOX` | QQ 沙箱模式(`1`/`true`) |
|
|
252
|
+
| `QQ_ALLOWED_USER_IDS` | QQ 白名单 |
|
|
253
|
+
| `DINGTALK_CLIENT_ID` | 钉钉应用 Client ID / AppKey |
|
|
254
|
+
| `DINGTALK_CLIENT_SECRET` | 钉钉应用 Client Secret |
|
|
255
|
+
| `DINGTALK_CARD_TEMPLATE_ID` | 钉钉 AI 卡片模板 ID |
|
|
256
|
+
| `DINGTALK_ALLOWED_USER_IDS` | 钉钉白名单 |
|
|
257
|
+
| `WEWORK_CORP_ID` | 企业微信 Bot ID |
|
|
258
|
+
| `WEWORK_SECRET` | 企业微信 Secret |
|
|
259
|
+
| `WEWORK_WS_URL` | 企业微信 WebSocket 地址 |
|
|
260
|
+
| `WEWORK_ALLOWED_USER_IDS` | 企业微信白名单 |
|
|
261
|
+
| `WORKBUDDY_ACCESS_TOKEN` | WorkBuddy OAuth 访问令牌 |
|
|
262
|
+
| `WORKBUDDY_REFRESH_TOKEN` | WorkBuddy OAuth 刷新令牌 |
|
|
263
|
+
| `WORKBUDDY_USER_ID` | WorkBuddy 用户 ID |
|
|
264
|
+
| `WORKBUDDY_BASE_URL` | WorkBuddy API 地址 |
|
|
265
|
+
| `WORKBUDDY_ALLOWED_USER_IDS` | WorkBuddy 白名单 |
|
|
297
266
|
|
|
298
267
|
### 平台配置来源
|
|
299
268
|
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
-
|
|
311
|
-
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
## IM 内命令
|
|
316
|
-
|
|
317
|
-
| 命令 | 说明 |
|
|
318
|
-
| ------------- | ------------------------------------- |
|
|
319
|
-
| `/help` | 显示帮助 |
|
|
320
|
-
| `/new` | 开始新会话 |
|
|
321
|
-
| `/status` | 显示 AI 工具、版本、会话目录、会话 ID |
|
|
322
|
-
| `/cd <路径>` | 切换会话目录 |
|
|
323
|
-
| `/pwd` | 显示当前会话目录 |
|
|
324
|
-
| `/allow` `/y` | 允许权限请求 |
|
|
325
|
-
| `/deny` `/n` | 拒绝权限请求 |
|
|
269
|
+
| 平台 | 配置来源 |
|
|
270
|
+
| -------- | --------------------------------------------------------------- |
|
|
271
|
+
| Telegram | 从 [@BotFather](https://t.me/BotFather) 获取 Bot Token |
|
|
272
|
+
| 飞书 | 从 [飞书开放平台](https://open.feishu.cn/) 创建应用并启用机器人 |
|
|
273
|
+
| QQ | 从 [QQ 开放平台](https://bot.q.qq.com/) 创建机器人 |
|
|
274
|
+
| 钉钉 | 从钉钉开放平台创建应用,启用机器人 Stream Mode |
|
|
275
|
+
| 企业微信 | 从 [企业微信管理后台](https://work.weixin.qq.com/) 获取凭证 |
|
|
276
|
+
| 微信 | 运行 `open-im init` 并选择 "WorkBuddy" 完成 OAuth 登录和绑定 |
|
|
277
|
+
|
|
278
|
+
**钉钉说明:**
|
|
279
|
+
- 采用 Stream Mode 收消息 + OpenAPI 发消息的混合模式
|
|
280
|
+
- 配置 `cardTemplateId` 后启用 AI 助理流式卡片,失败时回退为纯文本
|
|
281
|
+
- 自定义机器人和普通群仅支持单条文本回复
|
|
282
|
+
- 启动/关闭通知不会发送到钉钉
|
|
326
283
|
|
|
327
284
|
## 故障排除
|
|
328
285
|
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
**Codex 报 `stream disconnected` / `error sending request`**:无法访问 `chatgpt.com`,请配置 `tools.codex.proxy` 或环境变量 `CODEX_PROXY`。
|
|
344
|
-
|
|
345
|
-
**CodeBuddy 提示需要登录**:先执行 `codebuddy login`。`open-im` 不会从 `~/.open-im/config.json` 读取 CodeBuddy 的登录态。
|
|
346
|
-
|
|
347
|
-
**WorkBuddy 无法连接**:重新运行 `open-im init` 登录。Token 可能过期——客户端会尝试自动重连,但如果 refresh token 失效,需要重新登录。
|
|
348
|
-
|
|
349
|
-
**WorkBuddy 微信客服收不到消息**:确认在 `open-im init` 中完成了微信客服绑定。可重新运行 init 生成新的绑定链接。
|
|
286
|
+
| 问题 | 解决方案 |
|
|
287
|
+
| ------------------------ | ---------------------------------------------------------------- |
|
|
288
|
+
| Telegram 无响应 | 检查网络,添加 `proxy` 或设置 `TELEGRAM_PROXY` |
|
|
289
|
+
| QQ 无法连接 | 确认机器人已创建,检查 `QQ_BOT_APPID` / `QQ_BOT_SECRET` |
|
|
290
|
+
| QQ 重复回复 | 更新到最新版本 |
|
|
291
|
+
| 飞书卡片报错 | 未配置卡片回调时使用 `/mode ask` 或 `/mode yolo` |
|
|
292
|
+
| 企业微信收不到通知 | 先给机器人发一条消息 |
|
|
293
|
+
| 钉钉无法回复 | 确认 Stream Mode 已启用,检查凭证配置 |
|
|
294
|
+
| 钉钉没有流式更新 | 自定义机器人仅支持纯文本;配置 `cardTemplateId` 启用流式卡片 |
|
|
295
|
+
| Codex `stream disconnected` | 配置 `tools.codex.proxy` 或 `CODEX_PROXY` |
|
|
296
|
+
| CodeBuddy 需要登录 | 先执行 `codebuddy login` |
|
|
297
|
+
| WorkBuddy 无法连接 | 运行 `open-im init` 重新登录,Token 可能已过期 |
|
|
298
|
+
| WorkBuddy 微信收不到消息 | 重新运行 `open-im init` 生成新的微信客服绑定链接 |
|
|
350
299
|
|
|
351
300
|
## License
|
|
352
301
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wu529778790/open-im",
|
|
3
|
-
"version": "1.9.4-beta.
|
|
3
|
+
"version": "1.9.4-beta.12",
|
|
4
4
|
"description": "Multi-platform IM bridge for AI CLI tools (Claude, Codex, CodeBuddy)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -47,11 +47,11 @@
|
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"@anthropic-ai/claude-agent-sdk": "^0.2.92",
|
|
49
49
|
"@larksuiteoapi/node-sdk": "^1.59.0",
|
|
50
|
-
"centrifuge": "^5.3
|
|
50
|
+
"centrifuge": "^5.5.3",
|
|
51
51
|
"dingtalk-stream": "^2.1.4",
|
|
52
52
|
"prompts": "^2.4.2",
|
|
53
53
|
"telegraf": "^4.16.3",
|
|
54
|
-
"ws": "^8.
|
|
54
|
+
"ws": "^8.20.0"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"@eslint/js": "^9.15.0",
|
|
@@ -63,8 +63,8 @@
|
|
|
63
63
|
"globals": "^15.12.0",
|
|
64
64
|
"tsx": "^4.0.0",
|
|
65
65
|
"typescript": "^5.0.0",
|
|
66
|
-
"typescript-eslint": "^8.
|
|
67
|
-
"vitest": "^4.1.
|
|
66
|
+
"typescript-eslint": "^8.58.0",
|
|
67
|
+
"vitest": "^4.1.2"
|
|
68
68
|
},
|
|
69
69
|
"engines": {
|
|
70
70
|
"node": ">=20"
|