maxclaw 0.3.1
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/CONTRIBUTING.md +105 -0
- package/LICENSE +21 -0
- package/README.aiclaw.md +22 -0
- package/README.aliclaw.md +22 -0
- package/README.amazonclaw.md +12 -0
- package/README.amzclaw.md +12 -0
- package/README.anthropicclaw.md +12 -0
- package/README.appleclaw.md +12 -0
- package/README.autoopenclaw.md +22 -0
- package/README.awsclaw.md +12 -0
- package/README.bdclaw.md +12 -0
- package/README.blclaw.md +12 -0
- package/README.bytclaw.md +12 -0
- package/README.claw-open.md +22 -0
- package/README.clawjs.md +22 -0
- package/README.coclaw.md +12 -0
- package/README.copaw.md +12 -0
- package/README.ddclaw.md +12 -0
- package/README.duclaw.md +12 -0
- package/README.dyclaw.md +12 -0
- package/README.easyclaw.md +12 -0
- package/README.fastclaw.md +22 -0
- package/README.fbclaw.md +12 -0
- package/README.googleclaw.md +12 -0
- package/README.hwclaw.md +12 -0
- package/README.jdclaw.md +12 -0
- package/README.kimiclaw.md +12 -0
- package/README.ksclaw.md +12 -0
- package/README.maxclaw.md +12 -0
- package/README.md +12 -0
- package/README.md.bak +242 -0
- package/README.megaclaw.md +22 -0
- package/README.metaclaw.md +12 -0
- package/README.miclaw.md +12 -0
- package/README.msclaw.md +12 -0
- package/README.mtclaw.md +12 -0
- package/README.nflxclaw.md +12 -0
- package/README.nvdaclaw.md +12 -0
- package/README.open-claw.md +22 -0
- package/README.openaiclaw.md +12 -0
- package/README.openclaw-cli.md +239 -0
- package/README.openclaw-daemon.md +239 -0
- package/README.openclaw-gateway.md +239 -0
- package/README.openclaw-health.md +239 -0
- package/README.openclaw-helper.md +239 -0
- package/README.openclaw-install.md +239 -0
- package/README.openclaw-manage.md +239 -0
- package/README.openclaw-monitor.md +239 -0
- package/README.openclaw-run.md +239 -0
- package/README.openclaw-service.md +239 -0
- package/README.openclaw-setup.md +239 -0
- package/README.openclaw-start.md +239 -0
- package/README.openclaw-tools.md +239 -0
- package/README.openclaw-upgrade.md +13 -0
- package/README.openclaw-utils.md +239 -0
- package/README.openclaw-watch.md +239 -0
- package/README.pddclaw.md +12 -0
- package/README.qclaw-cli.md +22 -0
- package/README.qclaw.md +22 -0
- package/README.smartclaw.md +22 -0
- package/README.ttclaw.md +12 -0
- package/README.txclaw.md +12 -0
- package/README.uberclaw.md +12 -0
- package/README.volclaw.md +22 -0
- package/README.wxclaw.md +12 -0
- package/README.xclaw.md +12 -0
- package/README.zh-CN.md +213 -0
- package/README.zhclaw.md +12 -0
- package/dist/chunk-LIZ6XXW3.js +1149 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +582 -0
- package/dist/server-ZYSNFLSO.js +7 -0
- package/package.json +12 -0
package/README.zh-CN.md
ADDED
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="https://raw.githubusercontent.com/Sobranier/openclaw-cli/main/assets/welcome.png" alt="OpenClaw Doctor" width="400" />
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<h1 align="center">OpenClaw Doctor</h1>
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
让你的 OpenClaw 服务永不宕机。
|
|
9
|
+
</p>
|
|
10
|
+
|
|
11
|
+
<p align="center">
|
|
12
|
+
<a href="./README.md">English</a>
|
|
13
|
+
</p>
|
|
14
|
+
|
|
15
|
+
## 开始使用
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm install -g openclaw-doctor
|
|
19
|
+
openclaw-doctor watch -d
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
就这样。Doctor 在后台监控你的 OpenClaw 网关,挂了自动重启,全程通知你。无需任何配置——它会自动读取你现有的 OpenClaw 设置。
|
|
23
|
+
|
|
24
|
+
## 核心命令
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
openclaw-doctor watch # 开始监控(前台)
|
|
28
|
+
openclaw-doctor watch -d # 开始监控(后台)
|
|
29
|
+
openclaw-doctor unwatch # 停止监控
|
|
30
|
+
|
|
31
|
+
openclaw-doctor status # 快速健康检查
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
这四个命令覆盖日常 90% 的使用场景。
|
|
35
|
+
|
|
36
|
+
## 网关管理
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
openclaw-doctor gateway start # 启动 OpenClaw 网关
|
|
40
|
+
openclaw-doctor gateway stop # 停止网关
|
|
41
|
+
openclaw-doctor gateway restart # 重启网关
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## 诊断和日志
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
openclaw-doctor doctor # 完整诊断(二进制、网关、通道)
|
|
48
|
+
openclaw-doctor logs # 查看网关日志
|
|
49
|
+
openclaw-doctor logs --error # 只看错误日志
|
|
50
|
+
openclaw-doctor logs --doctor # 查看 Doctor 自身事件日志
|
|
51
|
+
openclaw-doctor dashboard # Web 管理面板(http://localhost:9090)
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## 安装
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
# npm(推荐)
|
|
58
|
+
npm install -g openclaw-doctor
|
|
59
|
+
|
|
60
|
+
# 或免安装直接跑
|
|
61
|
+
npx openclaw-doctor status
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
需要 Node >= 22(和 OpenClaw 一致)。
|
|
65
|
+
|
|
66
|
+
## 工作原理
|
|
67
|
+
|
|
68
|
+
Doctor 自动探测你的 OpenClaw 安装:
|
|
69
|
+
|
|
70
|
+
- 读取 `~/.openclaw/openclaw.json` 获取网关端口、通道、Agent 信息
|
|
71
|
+
- 扫描 `~/Library/LaunchAgents/` 找到 launchd 服务
|
|
72
|
+
- 通过 `openclaw health --json` 检查健康(真正的网关 RPC,不是 HTTP 探测)
|
|
73
|
+
- 需要时通过 `launchctl kickstart` 重启
|
|
74
|
+
|
|
75
|
+
**你不需要配置 OpenClaw 的任何信息。** Doctor 会自动搞定。
|
|
76
|
+
|
|
77
|
+
## 完整命令
|
|
78
|
+
|
|
79
|
+
| 命令 | 说明 |
|
|
80
|
+
|------|------|
|
|
81
|
+
| **监控** | |
|
|
82
|
+
| `watch` | 开始健康监控(前台) |
|
|
83
|
+
| `watch -d` | 开始健康监控(后台) |
|
|
84
|
+
| `watch -d --dashboard` | 后台监控 + Web 面板 |
|
|
85
|
+
| `unwatch` | 停止监控 |
|
|
86
|
+
| **网关** | |
|
|
87
|
+
| `gateway start` | 启动 OpenClaw 网关 |
|
|
88
|
+
| `gateway stop` | 停止网关 |
|
|
89
|
+
| `gateway restart` | 重启网关 |
|
|
90
|
+
| **信息** | |
|
|
91
|
+
| `status` | 显示网关和通道健康状态 |
|
|
92
|
+
| `status --json` | 机器可读的 JSON 输出 |
|
|
93
|
+
| `doctor` | 运行完整诊断 |
|
|
94
|
+
| `dashboard` | 启动 Web 管理面板 |
|
|
95
|
+
| `logs` | 查看网关日志 |
|
|
96
|
+
| `logs --error` | 只看错误日志 |
|
|
97
|
+
| `logs --doctor` | 查看 Doctor 事件日志 |
|
|
98
|
+
|
|
99
|
+
## 配置
|
|
100
|
+
|
|
101
|
+
配置文件位于 `~/.openclaw-doctor/config.json`,首次运行时自动创建。只包含 Doctor 自身的偏好——无需配置 OpenClaw 的信息。
|
|
102
|
+
|
|
103
|
+
```json
|
|
104
|
+
{
|
|
105
|
+
"checkInterval": 30,
|
|
106
|
+
"failThreshold": 3,
|
|
107
|
+
"dashboardPort": 9090,
|
|
108
|
+
"maxRestartsPerHour": 5,
|
|
109
|
+
"openclawProfile": "default",
|
|
110
|
+
"notify": {
|
|
111
|
+
"webhook": {
|
|
112
|
+
"enabled": false,
|
|
113
|
+
"url": "",
|
|
114
|
+
"bodyTemplate": "{\"msgtype\":\"text\",\"text\":{\"content\":\"{{message}}\"}}"
|
|
115
|
+
},
|
|
116
|
+
"system": {
|
|
117
|
+
"enabled": true
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
| 字段 | 说明 | 默认值 |
|
|
124
|
+
|------|------|--------|
|
|
125
|
+
| `checkInterval` | 健康检查间隔(秒) | `30` |
|
|
126
|
+
| `failThreshold` | 连续失败几次后重启 | `3` |
|
|
127
|
+
| `dashboardPort` | Web 面板端口 | `9090` |
|
|
128
|
+
| `maxRestartsPerHour` | 每小时最多重启次数 | `5` |
|
|
129
|
+
| `openclawProfile` | 监控的 OpenClaw 配置(`default`、`dev`...) | `default` |
|
|
130
|
+
| `notify.webhook.url` | Webhook 通知地址 | -- |
|
|
131
|
+
| `notify.system.enabled` | macOS 系统通知 | `true` |
|
|
132
|
+
|
|
133
|
+
## 通知系统
|
|
134
|
+
|
|
135
|
+
Doctor 在整个生命周期都会通知你:
|
|
136
|
+
|
|
137
|
+
| 事件 | 示例消息 |
|
|
138
|
+
|------|----------|
|
|
139
|
+
| 开始监控 | "Doctor 正在守护你的 OpenClaw 服务" |
|
|
140
|
+
| 状态异常 | "服务异常(第 2/3 次检测)" |
|
|
141
|
+
| 准备重启 | "正在重启网关..." |
|
|
142
|
+
| 重启成功 | "网关已恢复上线" |
|
|
143
|
+
| 重启失败 | "重启失败:[错误详情]" |
|
|
144
|
+
| 重启受限 | "重启次数过多,需要人工介入" |
|
|
145
|
+
| 自行恢复 | "服务自行恢复,无需重启" |
|
|
146
|
+
| 停止监控 | "Doctor 已停止" |
|
|
147
|
+
|
|
148
|
+
支持渠道:**Webhook**(钉钉、飞书、Slack、企业微信等)+ **macOS 系统通知**。
|
|
149
|
+
|
|
150
|
+
## Skills 集成
|
|
151
|
+
|
|
152
|
+
Doctor 作为独立守护进程运行,可被 OpenClaw 或其他工具调用:
|
|
153
|
+
|
|
154
|
+
```bash
|
|
155
|
+
openclaw-doctor status --json # 机器可读输出
|
|
156
|
+
openclaw-doctor watch -d # 幂等——重复调用安全
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
即使调用方崩溃,Doctor 继续运行。
|
|
160
|
+
|
|
161
|
+
## 架构
|
|
162
|
+
|
|
163
|
+
```
|
|
164
|
+
+-----------------+
|
|
165
|
+
| 通知系统 |
|
|
166
|
+
| (Webhook/OS) |
|
|
167
|
+
+--------^--------+
|
|
168
|
+
|
|
|
169
|
+
+-------------+ CLI +--------+--------+ RPC +-----------+
|
|
170
|
+
| OpenClaw | --------> | | ---------> | OpenClaw |
|
|
171
|
+
| / 脚本 | | openclaw-doctor | | 网关 |
|
|
172
|
+
| / Skills | <-------- | (守护进程) | <--------- | :18789 |
|
|
173
|
+
+-------------+ stdout +--------+--------+ health +-----------+
|
|
174
|
+
|
|
|
175
|
+
+--------v--------+
|
|
176
|
+
| ~/.openclaw/logs |
|
|
177
|
+
| (读取并分析) |
|
|
178
|
+
+-----------------+
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
## 开发
|
|
182
|
+
|
|
183
|
+
```bash
|
|
184
|
+
git clone https://github.com/Sobranier/openclaw-cli.git
|
|
185
|
+
cd openclaw-doctor
|
|
186
|
+
npm install
|
|
187
|
+
|
|
188
|
+
npm run dev -- status # 快速测试
|
|
189
|
+
npm run dev -- watch # 前台监控
|
|
190
|
+
npm run dev -- watch -d # 后台守护
|
|
191
|
+
npm run dev -- unwatch # 停止守护
|
|
192
|
+
|
|
193
|
+
npm run build # 构建发布版本
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
## 路线图
|
|
197
|
+
|
|
198
|
+
- [x] 通过 `openclaw health --json` 检查健康 + 自动重启(含频率限制)
|
|
199
|
+
- [x] 自动探测 OpenClaw 配置(网关端口、通道、Agent、launchd)
|
|
200
|
+
- [x] 后台守护模式(`watch -d` / `unwatch`)
|
|
201
|
+
- [x] 网关管理(`gateway start/stop/restart`)
|
|
202
|
+
- [x] 读取并展示 OpenClaw 网关日志
|
|
203
|
+
- [x] Web 状态面板
|
|
204
|
+
- [x] `status --json` 输出
|
|
205
|
+
- [ ] 通知系统(Webhook + macOS)
|
|
206
|
+
- [ ] `logs --tail`(实时跟踪)
|
|
207
|
+
- [ ] `config` 命令(get/set)
|
|
208
|
+
- [ ] 多服务监控
|
|
209
|
+
- [ ] Linux systemd 支持
|
|
210
|
+
|
|
211
|
+
## 协议
|
|
212
|
+
|
|
213
|
+
[MIT](./LICENSE)
|
package/README.zhclaw.md
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# zhclaw
|
|
2
|
+
|
|
3
|
+
> Alias for [openclaw-cli](https://www.npmjs.com/package/openclaw-cli).
|
|
4
|
+
|
|
5
|
+
Watchdog daemon for OpenClaw AI assistant gateway.
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install -g zhclaw
|
|
9
|
+
zhclaw watch -d
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
See [openclaw-cli](https://github.com/Sobranier/openclaw-cli) for full docs.
|