@wu529778790/open-im 1.10.9-beta.20 → 1.10.9-beta.21
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 +21 -94
- package/README.zh-CN.md +18 -91
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -42,16 +42,6 @@ Config: **`~/.open-im/config.json`**
|
|
|
42
42
|
|
|
43
43
|
After `start`, the CLI prints the dashboard URL (default **`http://127.0.0.1:39282`**).
|
|
44
44
|
|
|
45
|
-
## Git co-authors
|
|
46
|
-
|
|
47
|
-
`Co-authored-by` is appended by default on AI-driven commits. **Disable:** set **`OPEN_IM_GIT_COAUTHOR=0`** in the environment and restart the bridge.
|
|
48
|
-
|
|
49
|
-
## Web dashboard
|
|
50
|
-
|
|
51
|
-
`open-im start` and `open-im dashboard` serve the built-in SPA and **`/api/*`** on **`OPEN_IM_WEB_PORT`** (default **39282**). Open **`http://127.0.0.1:39282`** in a browser (same origin as the API). Override the displayed URL with **`OPEN_IM_PUBLIC_WEB_URL`** if behind a proxy.
|
|
52
|
-
|
|
53
|
-
**Remote / LAN:** `export OPEN_IM_WEB_HOST=0.0.0.0` — first access from another host may show a one-time login link. Optional: **`OPEN_IM_ALLOW_REMOTE_API`**, **`OPEN_IM_CORS_ORIGINS`**.
|
|
54
|
-
|
|
55
45
|
## Chat commands
|
|
56
46
|
|
|
57
47
|
| Command | Description |
|
|
@@ -64,15 +54,13 @@ After `start`, the CLI prints the dashboard URL (default **`http://127.0.0.1:392
|
|
|
64
54
|
| `/cd` / `/pwd` | Working directory |
|
|
65
55
|
| `/allow` / `/y`, `/deny` / `/n` | Permission prompts |
|
|
66
56
|
|
|
67
|
-
Session state is stored in **`~/.open-im/data/sessions.json`** (per user, not IM chat logs).
|
|
68
|
-
|
|
69
57
|
## Session continuity
|
|
70
58
|
|
|
71
|
-
open-im and Claude Code CLI share the same session storage.
|
|
59
|
+
open-im and Claude Code CLI share the same session storage. In the same directory, you can seamlessly switch between phone and computer.
|
|
72
60
|
|
|
73
|
-
**Phone → Computer:** open-im
|
|
61
|
+
**Phone → Computer:** open-im auto-resumes the latest CLI session — no configuration needed.
|
|
74
62
|
|
|
75
|
-
**Computer → Phone:** use `claude --continue` (or `claude -c`) to pick up the conversation
|
|
63
|
+
**Computer → Phone:** use `claude --continue` (or `claude -c`) to pick up the phone conversation.
|
|
76
64
|
|
|
77
65
|
```
|
|
78
66
|
# On computer
|
|
@@ -85,33 +73,35 @@ cd /my-project && claude # work as usual, then Ctrl+C
|
|
|
85
73
|
claude -c # continues the phone conversation
|
|
86
74
|
```
|
|
87
75
|
|
|
88
|
-
>
|
|
76
|
+
> Only one side can be active at a time. Exit the CLI before sending messages from the phone, and vice versa.
|
|
89
77
|
|
|
90
|
-
##
|
|
78
|
+
## Git co-authors
|
|
91
79
|
|
|
92
|
-
|
|
80
|
+
`Co-authored-by` is appended by default on AI-driven commits. **Disable:** set **`OPEN_IM_GIT_COAUTHOR=0`** in the environment and restart the bridge.
|
|
93
81
|
|
|
94
|
-
|
|
82
|
+
## Minimal config
|
|
95
83
|
|
|
96
84
|
```json
|
|
97
85
|
{
|
|
86
|
+
"tools": {
|
|
87
|
+
"claude": { "workDir": "/path/to/project", "skipPermissions": true, "timeoutMs": 600000 }
|
|
88
|
+
},
|
|
98
89
|
"platforms": {
|
|
99
|
-
"telegram": { "enabled": true, "
|
|
90
|
+
"telegram": { "enabled": true, "botToken": "YOUR_TELEGRAM_BOT_TOKEN" }
|
|
100
91
|
}
|
|
101
92
|
}
|
|
102
93
|
```
|
|
103
94
|
|
|
104
|
-
|
|
95
|
+
Add other platforms under **`platforms`** as needed. Run **`open-im init`** for a full template.
|
|
105
96
|
|
|
106
|
-
|
|
97
|
+
### Claude (Agent SDK)
|
|
107
98
|
|
|
108
|
-
Third-party / compatible API
|
|
99
|
+
No local `claude` binary required. Third-party / compatible API:
|
|
109
100
|
|
|
110
101
|
```json
|
|
111
102
|
{
|
|
112
103
|
"tools": {
|
|
113
104
|
"claude": {
|
|
114
|
-
"workDir": "/path/to/project",
|
|
115
105
|
"env": {
|
|
116
106
|
"ANTHROPIC_AUTH_TOKEN": "your-token",
|
|
117
107
|
"ANTHROPIC_BASE_URL": "https://your-api-endpoint",
|
|
@@ -122,88 +112,25 @@ Third-party / compatible API example:
|
|
|
122
112
|
}
|
|
123
113
|
```
|
|
124
114
|
|
|
125
|
-
###
|
|
126
|
-
|
|
127
|
-
```bash
|
|
128
|
-
npm install -g @tencent-ai/codebuddy-code
|
|
129
|
-
codebuddy login
|
|
130
|
-
```
|
|
115
|
+
### Per-platform AI
|
|
131
116
|
|
|
132
|
-
|
|
117
|
+
Set **`platforms.<name>.aiCommand`** (`claude` / `codex` / `codebuddy`) per channel. Default: `claude`.
|
|
133
118
|
|
|
134
|
-
|
|
135
|
-
{
|
|
136
|
-
"tools": {
|
|
137
|
-
"claude": { "workDir": "/path/to/project", "skipPermissions": true, "timeoutMs": 600000 }
|
|
138
|
-
},
|
|
139
|
-
"platforms": {
|
|
140
|
-
"telegram": { "enabled": true, "aiCommand": "claude", "botToken": "YOUR_TELEGRAM_BOT_TOKEN" }
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
```
|
|
119
|
+
### Web dashboard
|
|
144
120
|
|
|
145
|
-
|
|
121
|
+
`open-im start` serves the built-in SPA and **`/api/*`** on **`OPEN_IM_WEB_PORT`** (default **39282**). For LAN access: `export OPEN_IM_WEB_HOST=0.0.0.0`.
|
|
146
122
|
|
|
147
123
|
### Environment variables
|
|
148
124
|
|
|
149
|
-
|
|
125
|
+
Typical keys: **`ANTHROPIC_*`** (shell or **`tools.claude.env`**), **`TELEGRAM_BOT_TOKEN`**, **`OPEN_IM_WEB_PORT`**, **`OPEN_IM_WEB_HOST`**, plus platform-specific `*_APP_ID`, `*_SECRET`, `WORKBUDDY_*`, etc.
|
|
150
126
|
|
|
151
127
|
### Privacy
|
|
152
128
|
|
|
153
129
|
**Anonymous** usage information may be collected to improve reliability (no chat or prompt content). To disable: **`OPEN_IM_TELEMETRY=false`** or **`"telemetry": { "enabled": false }`** in **`config.json`**.
|
|
154
130
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
| Platform | Notes |
|
|
158
|
-
| --- | --- |
|
|
159
|
-
| Telegram | [@BotFather](https://t.me/BotFather) |
|
|
160
|
-
| Feishu | [Open Platform](https://open.feishu.cn/) |
|
|
161
|
-
| QQ | [QQ Open Platform](https://bot.q.qq.com/) |
|
|
162
|
-
| DingTalk | Open Platform — bot **Stream Mode**; optional **`cardTemplateId`** for AI assistant cards |
|
|
163
|
-
| WeCom | [Admin](https://work.weixin.qq.com/) |
|
|
164
|
-
| WeChat | **`open-im init`** → WorkBuddy OAuth |
|
|
165
|
-
| ClawBot (WeChat) | QR code login via iLink API; see [ClawBot setup](#clawbot-setup) |
|
|
166
|
-
|
|
167
|
-
### ClawBot setup
|
|
168
|
-
|
|
169
|
-
ClawBot connects to WeChat via the official iLink Bot API (same protocol as `@tencent-weixin/openclaw-weixin`). It supports text, voice, image, file, and video messages.
|
|
170
|
-
|
|
171
|
-
**Setup:**
|
|
172
|
-
|
|
173
|
-
1. Enable in config:
|
|
174
|
-
```json
|
|
175
|
-
{
|
|
176
|
-
"platforms": {
|
|
177
|
-
"clawbot": { "enabled": true }
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
```
|
|
181
|
-
2. Open the Web dashboard → **ClawBot** section → **Scan QR code** with WeChat.
|
|
182
|
-
3. After scanning, `bot_token` and `apiUrl` are saved automatically.
|
|
131
|
+
## Platform setup & troubleshooting
|
|
183
132
|
|
|
184
|
-
**
|
|
185
|
-
|
|
186
|
-
| Field | Default | Description |
|
|
187
|
-
| --- | --- | --- |
|
|
188
|
-
| `apiUrl` | `https://ilinkai.weixin.qq.com` | iLink API base URL |
|
|
189
|
-
| `apiToken` | — | Bot token (auto-set after QR login) |
|
|
190
|
-
| `aiCommand` | `claude` | AI backend override |
|
|
191
|
-
|
|
192
|
-
**Protocol:** POST + JSON body + Bearer token auth. Long-polling via `ilink/bot/getupdates` with `get_updates_buf` cursor.
|
|
193
|
-
|
|
194
|
-
## Troubleshooting
|
|
195
|
-
|
|
196
|
-
| Issue | What to try |
|
|
197
|
-
| --- | --- |
|
|
198
|
-
| Telegram / network | `proxy` or **`TELEGRAM_PROXY`** |
|
|
199
|
-
| QQ | Check **`QQ_BOT_APPID`** / **`QQ_BOT_SECRET`**; update if duplicate replies |
|
|
200
|
-
| Feishu cards | **`/mode ask`** or **`/mode yolo`** without card callbacks |
|
|
201
|
-
| WeCom | Send the bot a message first |
|
|
202
|
-
| DingTalk | Stream Mode + credentials; custom bots may be text-only |
|
|
203
|
-
| Codex disconnect | **`CODEX_PROXY`** or **`tools.codex.proxy`** |
|
|
204
|
-
| CodeBuddy login | **`codebuddy login`** |
|
|
205
|
-
| WorkBuddy | Re-run **`open-im init`** (tokens expire) |
|
|
206
|
-
| ClawBot | QR re-login via Web UI; `apiUrl` defaults to `https://ilinkai.weixin.qq.com` |
|
|
133
|
+
See **[docs/platforms.md](./docs/platforms.md)** for detailed per-platform configuration, credential setup, and troubleshooting.
|
|
207
134
|
|
|
208
135
|
## License
|
|
209
136
|
|
package/README.zh-CN.md
CHANGED
|
@@ -42,16 +42,6 @@ npx @wu529778790/open-im start
|
|
|
42
42
|
|
|
43
43
|
`start` 后会提示控制台地址(默认 **`http://127.0.0.1:39282`**)。
|
|
44
44
|
|
|
45
|
-
## Git 共同作者
|
|
46
|
-
|
|
47
|
-
默认在 AI 发起的提交里追加 `Co-authored-by`。**关闭**:设置环境变量 **`OPEN_IM_GIT_COAUTHOR=0`** 并重启桥接。
|
|
48
|
-
|
|
49
|
-
## Web 控制台
|
|
50
|
-
|
|
51
|
-
`open-im start` / `open-im dashboard` 在 **`OPEN_IM_WEB_PORT`**(默认 **39282**)提供内置页面与 **`/api/*`**。浏览器打开 **`http://127.0.0.1:39282`** 即可(与 API 同源)。反向代理时可设 **`OPEN_IM_PUBLIC_WEB_URL`**。
|
|
52
|
-
|
|
53
|
-
**局域网 / 远程:** `export OPEN_IM_WEB_HOST=0.0.0.0` — 首次外网访问可能需一次性登录链接。可选 **`OPEN_IM_ALLOW_REMOTE_API`**、**`OPEN_IM_CORS_ORIGINS`**。
|
|
54
|
-
|
|
55
45
|
## IM 内命令
|
|
56
46
|
|
|
57
47
|
| 命令 | 说明 |
|
|
@@ -64,8 +54,6 @@ npx @wu529778790/open-im start
|
|
|
64
54
|
| `/cd` / `/pwd` | 工作目录 |
|
|
65
55
|
| `/allow` / `/y`、`/deny` / `/n` | 权限确认 |
|
|
66
56
|
|
|
67
|
-
会话状态保存在 **`~/.open-im/data/sessions.json`**(按用户,与 IM 聊天记录无关)。
|
|
68
|
-
|
|
69
57
|
## 会话接力
|
|
70
58
|
|
|
71
59
|
open-im 和 Claude Code CLI 共享同一份 session 存储。在同一个目录下,手机和电脑可以无缝切换。
|
|
@@ -85,33 +73,35 @@ cd /my-project && claude # 正常工作,退出时 Ctrl+C
|
|
|
85
73
|
claude -c # 接上手机端的对话
|
|
86
74
|
```
|
|
87
75
|
|
|
88
|
-
>
|
|
76
|
+
> 同一时刻只能有一端活跃。从手机发消息前先退出 CLI,反之亦然。
|
|
89
77
|
|
|
90
|
-
##
|
|
78
|
+
## Git 共同作者
|
|
91
79
|
|
|
92
|
-
|
|
80
|
+
默认在 AI 发起的提交里追加 `Co-authored-by`。**关闭**:设置环境变量 **`OPEN_IM_GIT_COAUTHOR=0`** 并重启桥接。
|
|
93
81
|
|
|
94
|
-
|
|
82
|
+
## 最小配置
|
|
95
83
|
|
|
96
84
|
```json
|
|
97
85
|
{
|
|
86
|
+
"tools": {
|
|
87
|
+
"claude": { "workDir": "/path/to/project", "skipPermissions": true, "timeoutMs": 600000 }
|
|
88
|
+
},
|
|
98
89
|
"platforms": {
|
|
99
|
-
"telegram": { "enabled": true, "
|
|
90
|
+
"telegram": { "enabled": true, "botToken": "YOUR_TELEGRAM_BOT_TOKEN" }
|
|
100
91
|
}
|
|
101
92
|
}
|
|
102
93
|
```
|
|
103
94
|
|
|
104
|
-
|
|
95
|
+
在 **`platforms`** 下按需补充其他平台。完整模板请用 **`open-im init`**。
|
|
105
96
|
|
|
106
|
-
|
|
97
|
+
### Claude(Agent SDK)
|
|
107
98
|
|
|
108
|
-
|
|
99
|
+
无需本地 `claude` 可执行文件。第三方兼容接口示例:
|
|
109
100
|
|
|
110
101
|
```json
|
|
111
102
|
{
|
|
112
103
|
"tools": {
|
|
113
104
|
"claude": {
|
|
114
|
-
"workDir": "/path/to/project",
|
|
115
105
|
"env": {
|
|
116
106
|
"ANTHROPIC_AUTH_TOKEN": "your-token",
|
|
117
107
|
"ANTHROPIC_BASE_URL": "https://your-api-endpoint",
|
|
@@ -122,88 +112,25 @@ claude -c # 接上手机端的对话
|
|
|
122
112
|
}
|
|
123
113
|
```
|
|
124
114
|
|
|
125
|
-
###
|
|
126
|
-
|
|
127
|
-
```bash
|
|
128
|
-
npm install -g @tencent-ai/codebuddy-code
|
|
129
|
-
codebuddy login
|
|
130
|
-
```
|
|
115
|
+
### 按平台指定 AI
|
|
131
116
|
|
|
132
|
-
|
|
117
|
+
在每个平台上设置 **`platforms.<name>.aiCommand`**(`claude` / `codex` / `codebuddy`)。默认 `claude`。
|
|
133
118
|
|
|
134
|
-
|
|
135
|
-
{
|
|
136
|
-
"tools": {
|
|
137
|
-
"claude": { "workDir": "/path/to/project", "skipPermissions": true, "timeoutMs": 600000 }
|
|
138
|
-
},
|
|
139
|
-
"platforms": {
|
|
140
|
-
"telegram": { "enabled": true, "aiCommand": "claude", "botToken": "YOUR_TELEGRAM_BOT_TOKEN" }
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
```
|
|
119
|
+
### Web 控制台
|
|
144
120
|
|
|
145
|
-
|
|
121
|
+
`open-im start` 在 **`OPEN_IM_WEB_PORT`**(默认 **39282**)提供内置页面与 **`/api/*`**。局域网访问:`export OPEN_IM_WEB_HOST=0.0.0.0`。
|
|
146
122
|
|
|
147
123
|
### 环境变量
|
|
148
124
|
|
|
149
|
-
|
|
125
|
+
常见:**`ANTHROPIC_*`**(shell 或 **`tools.claude.env`**)、**`TELEGRAM_BOT_TOKEN`**、**`OPEN_IM_WEB_PORT`**、**`OPEN_IM_WEB_HOST`**,以及各平台的 `*_APP_ID`、`*_SECRET`、`WORKBUDDY_*` 等。
|
|
150
126
|
|
|
151
127
|
### 隐私
|
|
152
128
|
|
|
153
129
|
为改进稳定性,可能记录**匿名**运行信息(不含聊天或 prompt 内容)。若需关闭:环境变量 **`OPEN_IM_TELEMETRY=false`**,或 **`config.json`** 中 **`"telemetry": { "enabled": false }`**。
|
|
154
130
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
| 平台 | 说明 |
|
|
158
|
-
| --- | --- |
|
|
159
|
-
| Telegram | [@BotFather](https://t.me/BotFather) |
|
|
160
|
-
| 飞书 | [开放平台](https://open.feishu.cn/) |
|
|
161
|
-
| QQ | [QQ 开放平台](https://bot.q.qq.com/) |
|
|
162
|
-
| 钉钉 | 开放平台创建应用,机器人开 **Stream Mode**;可选 **`cardTemplateId`** 走 AI 助理卡片 |
|
|
163
|
-
| 企业微信 | [管理后台](https://work.weixin.qq.com/) |
|
|
164
|
-
| 微信 | **`open-im init`** → WorkBuddy OAuth |
|
|
165
|
-
| ClawBot(微信) | 扫码登录 iLink API,参见 [ClawBot 配置](#clawbot-配置) |
|
|
166
|
-
|
|
167
|
-
### ClawBot 配置
|
|
168
|
-
|
|
169
|
-
ClawBot 通过官方 iLink Bot API 连接微信(与 `@tencent-weixin/openclaw-weixin` 协议相同)。支持文本、语音、图片、文件和视频消息。
|
|
170
|
-
|
|
171
|
-
**使用方法:**
|
|
172
|
-
|
|
173
|
-
1. 在配置中启用:
|
|
174
|
-
```json
|
|
175
|
-
{
|
|
176
|
-
"platforms": {
|
|
177
|
-
"clawbot": { "enabled": true }
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
```
|
|
181
|
-
2. 打开 Web 控制台 → **ClawBot** 区域 → **扫码登录**(用微信扫码)。
|
|
182
|
-
3. 扫码成功后 `bot_token` 和 `apiUrl` 自动保存。
|
|
131
|
+
## 平台配置与故障排除
|
|
183
132
|
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
| 字段 | 默认值 | 说明 |
|
|
187
|
-
| --- | --- | --- |
|
|
188
|
-
| `apiUrl` | `https://ilinkai.weixin.qq.com` | iLink API 地址 |
|
|
189
|
-
| `apiToken` | — | Bot Token(扫码后自动写入) |
|
|
190
|
-
| `aiCommand` | `claude` | AI 后端覆盖 |
|
|
191
|
-
|
|
192
|
-
**协议:** POST + JSON body + Bearer token 鉴权,通过 `ilink/bot/getupdates` 长轮询 + `get_updates_buf` 游标拉取消息。
|
|
193
|
-
|
|
194
|
-
## 故障排除
|
|
195
|
-
|
|
196
|
-
| 现象 | 处理 |
|
|
197
|
-
| --- | --- |
|
|
198
|
-
| Telegram / 网络 | 配置 `proxy` 或 **`TELEGRAM_PROXY`** |
|
|
199
|
-
| QQ | 核对 **`QQ_BOT_APPID`**、**`QQ_BOT_SECRET`**;重复回复请升级版本 |
|
|
200
|
-
| 飞书卡片 | 未配回调时用 **`/mode ask`** 或 **`/mode yolo`** |
|
|
201
|
-
| 企业微信 | 先给机器人发一条消息 |
|
|
202
|
-
| 钉钉 | 开启 Stream Mode;自定义机器人可能仅纯文本 |
|
|
203
|
-
| Codex 断流 | **`CODEX_PROXY`** 或 **`tools.codex.proxy`** |
|
|
204
|
-
| CodeBuddy 登录 | **`codebuddy login`** |
|
|
205
|
-
| WorkBuddy / 微信 | 重跑 **`open-im init`**(Token 会过期) |
|
|
206
|
-
| ClawBot | Web 控制台重新扫码;`apiUrl` 默认 `https://ilinkai.weixin.qq.com` |
|
|
133
|
+
详见 **[docs/platforms.zh-CN.md](./docs/platforms.zh-CN.md)**。
|
|
207
134
|
|
|
208
135
|
## License
|
|
209
136
|
|