claude-codex-wechat 0.1.7 → 0.1.11
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 +56 -104
- package/dist/server/cli.js +176 -173
- package/dist/web/assets/index-BW-_vdVB.js +10 -0
- package/dist/web/index.html +1 -1
- package/package.json +5 -1
- package/dist/web/assets/index-Dxzp2xaC.js +0 -10
package/README.md
CHANGED
|
@@ -52,22 +52,47 @@ npm install -g claude-codex-wechat
|
|
|
52
52
|
pnpm add -g claude-codex-wechat
|
|
53
53
|
```
|
|
54
54
|
|
|
55
|
-
|
|
55
|
+
说明:
|
|
56
|
+
|
|
57
|
+
- 该包依赖 `better-sqlite3`
|
|
58
|
+
- 大多数常见平台会直接下载预编译二进制
|
|
59
|
+
- 少数环境可能需要本地编译工具链
|
|
60
|
+
- Node 版本要求:`>=20`
|
|
61
|
+
|
|
62
|
+
## 快速开始
|
|
63
|
+
|
|
64
|
+
安装后按以下顺序跑通:
|
|
56
65
|
|
|
57
66
|
```bash
|
|
58
|
-
|
|
67
|
+
# 1. 生成默认配置
|
|
59
68
|
claude-codex-wechat init
|
|
69
|
+
|
|
70
|
+
# 2. 编辑 ~/.claude-codex-wechat/config.json,填入微信 token / accountId
|
|
71
|
+
# (配置说明见下方「配置」一节)
|
|
72
|
+
|
|
73
|
+
# 3. 检查环境(配置、前端产物、claude/codex 是否就绪)
|
|
60
74
|
claude-codex-wechat doctor
|
|
75
|
+
|
|
76
|
+
# 4. 后台启动(首次会自动注册为系统服务并守护运行)
|
|
61
77
|
claude-codex-wechat start
|
|
62
|
-
|
|
78
|
+
|
|
79
|
+
# 5. 查看状态 / 日志
|
|
80
|
+
claude-codex-wechat status
|
|
81
|
+
claude-codex-wechat logs
|
|
63
82
|
```
|
|
64
83
|
|
|
65
|
-
|
|
84
|
+
启动后:
|
|
66
85
|
|
|
67
|
-
-
|
|
68
|
-
-
|
|
69
|
-
|
|
70
|
-
|
|
86
|
+
- 管理页:`http://127.0.0.1:8787`
|
|
87
|
+
- 微信侧即可直接给机器人发消息,驱动本机 `Claude Code` / `Codex CLI` 会话
|
|
88
|
+
|
|
89
|
+
停止 / 重启 / 卸载:
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
claude-codex-wechat restart
|
|
93
|
+
claude-codex-wechat stop
|
|
94
|
+
claude-codex-wechat uninstall
|
|
95
|
+
```
|
|
71
96
|
|
|
72
97
|
### 从源码安装
|
|
73
98
|
|
|
@@ -83,11 +108,21 @@ pnpm install
|
|
|
83
108
|
可用命令:
|
|
84
109
|
|
|
85
110
|
- `claude-codex-wechat start`
|
|
86
|
-
-
|
|
87
|
-
- `claude-codex-wechat
|
|
88
|
-
-
|
|
111
|
+
- 后台启动服务(未安装则自动注册系统服务),默认命令
|
|
112
|
+
- `claude-codex-wechat stop`
|
|
113
|
+
- 停止后台服务
|
|
114
|
+
- `claude-codex-wechat restart`
|
|
115
|
+
- 重启后台服务
|
|
116
|
+
- `claude-codex-wechat status`
|
|
117
|
+
- 查看运行状态
|
|
118
|
+
- `claude-codex-wechat logs` / `tail`
|
|
119
|
+
- 打印 / 实时跟随日志
|
|
89
120
|
- `claude-codex-wechat doctor`
|
|
90
121
|
- 检查配置、前端产物、`claude`/`codex` 可执行文件
|
|
122
|
+
- `claude-codex-wechat init`
|
|
123
|
+
- 写默认配置到 `~/.claude-codex-wechat/config.json`
|
|
124
|
+
- `claude-codex-wechat uninstall`
|
|
125
|
+
- 卸载后台服务
|
|
91
126
|
- `claude-codex-wechat print-config`
|
|
92
127
|
- 打印当前配置文件
|
|
93
128
|
- `claude-codex-wechat help`
|
|
@@ -178,35 +213,18 @@ pnpm build
|
|
|
178
213
|
|
|
179
214
|
## 生产运行
|
|
180
215
|
|
|
181
|
-
|
|
216
|
+
首次跑通流程见上方「快速开始」。`start` 会把当前 CLI 注册成操作系统服务并守护拉起。
|
|
182
217
|
|
|
183
|
-
|
|
184
|
-
claude-codex-wechat start
|
|
185
|
-
```
|
|
186
|
-
|
|
187
|
-
注意:
|
|
188
|
-
|
|
189
|
-
- 这是前台进程
|
|
190
|
-
- npm 本身不负责守护
|
|
191
|
-
- 长期常驻建议交给进程管理器
|
|
192
|
-
- 如果默认端口已被本程序的后台服务占用,`start` 会先停掉后台服务,再以前台模式启动
|
|
193
|
-
- 如果端口被别的进程占用,`start` 会直接报出占用 PID 和命令,不会强杀陌生进程
|
|
194
|
-
|
|
195
|
-
### 安装后后台运行
|
|
196
|
-
|
|
197
|
-
参考 `happier` 的方式,这个仓库现在提供 `service` 命令,把当前 CLI 注册成操作系统服务,而不是在 Node 进程里自己 daemonize。
|
|
198
|
-
|
|
199
|
-
常用命令:
|
|
218
|
+
常用管理命令:
|
|
200
219
|
|
|
201
220
|
```bash
|
|
202
|
-
claude-codex-wechat
|
|
203
|
-
claude-codex-wechat
|
|
204
|
-
claude-codex-wechat
|
|
205
|
-
claude-codex-wechat
|
|
206
|
-
claude-codex-wechat
|
|
207
|
-
claude-codex-wechat
|
|
208
|
-
claude-codex-wechat
|
|
209
|
-
claude-codex-wechat service uninstall
|
|
221
|
+
claude-codex-wechat start # 后台启动 / 启动已安装服务
|
|
222
|
+
claude-codex-wechat restart # 重启
|
|
223
|
+
claude-codex-wechat status # 状态
|
|
224
|
+
claude-codex-wechat logs # 最近日志
|
|
225
|
+
claude-codex-wechat tail # 实时日志
|
|
226
|
+
claude-codex-wechat stop # 停止
|
|
227
|
+
claude-codex-wechat uninstall # 卸载服务
|
|
210
228
|
```
|
|
211
229
|
|
|
212
230
|
当前支持:
|
|
@@ -214,73 +232,7 @@ claude-codex-wechat service uninstall
|
|
|
214
232
|
- macOS:`launchd`(`~/Library/LaunchAgents/`)
|
|
215
233
|
- Linux:`systemd --user`(`~/.config/systemd/user/`)
|
|
216
234
|
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
```bash
|
|
220
|
-
claude-codex-wechat init
|
|
221
|
-
claude-codex-wechat service install
|
|
222
|
-
claude-codex-wechat service status
|
|
223
|
-
```
|
|
224
|
-
|
|
225
|
-
### pm2
|
|
226
|
-
|
|
227
|
-
```bash
|
|
228
|
-
npm install -g pm2
|
|
229
|
-
pm2 start claude-codex-wechat --name ccwx -- start
|
|
230
|
-
pm2 logs ccwx
|
|
231
|
-
pm2 restart ccwx
|
|
232
|
-
pm2 startup && pm2 save
|
|
233
|
-
```
|
|
234
|
-
|
|
235
|
-
### systemd
|
|
236
|
-
|
|
237
|
-
示例:
|
|
238
|
-
|
|
239
|
-
```ini
|
|
240
|
-
[Unit]
|
|
241
|
-
Description=claude-codex-wechat bridge daemon
|
|
242
|
-
After=network.target
|
|
243
|
-
|
|
244
|
-
[Service]
|
|
245
|
-
Type=simple
|
|
246
|
-
User=youruser
|
|
247
|
-
Environment=BRIDGE_PORT=8787
|
|
248
|
-
ExecStart=/usr/bin/claude-codex-wechat start
|
|
249
|
-
Restart=on-failure
|
|
250
|
-
RestartSec=5
|
|
251
|
-
|
|
252
|
-
[Install]
|
|
253
|
-
WantedBy=multi-user.target
|
|
254
|
-
```
|
|
255
|
-
|
|
256
|
-
### launchd
|
|
257
|
-
|
|
258
|
-
示例:
|
|
259
|
-
|
|
260
|
-
```xml
|
|
261
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
262
|
-
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
263
|
-
<plist version="1.0">
|
|
264
|
-
<dict>
|
|
265
|
-
<key>Label</key>
|
|
266
|
-
<string>com.claude-codex-wechat</string>
|
|
267
|
-
<key>ProgramArguments</key>
|
|
268
|
-
<array>
|
|
269
|
-
<string>/opt/homebrew/bin/claude-codex-wechat</string>
|
|
270
|
-
<string>start</string>
|
|
271
|
-
</array>
|
|
272
|
-
<key>EnvironmentVariables</key>
|
|
273
|
-
<dict>
|
|
274
|
-
<key>BRIDGE_PORT</key>
|
|
275
|
-
<string>8787</string>
|
|
276
|
-
</dict>
|
|
277
|
-
<key>RunAtLoad</key>
|
|
278
|
-
<true/>
|
|
279
|
-
<key>KeepAlive</key>
|
|
280
|
-
<true/>
|
|
281
|
-
</dict>
|
|
282
|
-
</plist>
|
|
283
|
-
```
|
|
235
|
+
服务会以 `KeepAlive` / `Restart=on-failure` 守护,崩溃后自动拉起,无需额外进程管理器。
|
|
284
236
|
|
|
285
237
|
## 发布 npm 包
|
|
286
238
|
|