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.
Files changed (73) hide show
  1. package/CONTRIBUTING.md +105 -0
  2. package/LICENSE +21 -0
  3. package/README.aiclaw.md +22 -0
  4. package/README.aliclaw.md +22 -0
  5. package/README.amazonclaw.md +12 -0
  6. package/README.amzclaw.md +12 -0
  7. package/README.anthropicclaw.md +12 -0
  8. package/README.appleclaw.md +12 -0
  9. package/README.autoopenclaw.md +22 -0
  10. package/README.awsclaw.md +12 -0
  11. package/README.bdclaw.md +12 -0
  12. package/README.blclaw.md +12 -0
  13. package/README.bytclaw.md +12 -0
  14. package/README.claw-open.md +22 -0
  15. package/README.clawjs.md +22 -0
  16. package/README.coclaw.md +12 -0
  17. package/README.copaw.md +12 -0
  18. package/README.ddclaw.md +12 -0
  19. package/README.duclaw.md +12 -0
  20. package/README.dyclaw.md +12 -0
  21. package/README.easyclaw.md +12 -0
  22. package/README.fastclaw.md +22 -0
  23. package/README.fbclaw.md +12 -0
  24. package/README.googleclaw.md +12 -0
  25. package/README.hwclaw.md +12 -0
  26. package/README.jdclaw.md +12 -0
  27. package/README.kimiclaw.md +12 -0
  28. package/README.ksclaw.md +12 -0
  29. package/README.maxclaw.md +12 -0
  30. package/README.md +12 -0
  31. package/README.md.bak +242 -0
  32. package/README.megaclaw.md +22 -0
  33. package/README.metaclaw.md +12 -0
  34. package/README.miclaw.md +12 -0
  35. package/README.msclaw.md +12 -0
  36. package/README.mtclaw.md +12 -0
  37. package/README.nflxclaw.md +12 -0
  38. package/README.nvdaclaw.md +12 -0
  39. package/README.open-claw.md +22 -0
  40. package/README.openaiclaw.md +12 -0
  41. package/README.openclaw-cli.md +239 -0
  42. package/README.openclaw-daemon.md +239 -0
  43. package/README.openclaw-gateway.md +239 -0
  44. package/README.openclaw-health.md +239 -0
  45. package/README.openclaw-helper.md +239 -0
  46. package/README.openclaw-install.md +239 -0
  47. package/README.openclaw-manage.md +239 -0
  48. package/README.openclaw-monitor.md +239 -0
  49. package/README.openclaw-run.md +239 -0
  50. package/README.openclaw-service.md +239 -0
  51. package/README.openclaw-setup.md +239 -0
  52. package/README.openclaw-start.md +239 -0
  53. package/README.openclaw-tools.md +239 -0
  54. package/README.openclaw-upgrade.md +13 -0
  55. package/README.openclaw-utils.md +239 -0
  56. package/README.openclaw-watch.md +239 -0
  57. package/README.pddclaw.md +12 -0
  58. package/README.qclaw-cli.md +22 -0
  59. package/README.qclaw.md +22 -0
  60. package/README.smartclaw.md +22 -0
  61. package/README.ttclaw.md +12 -0
  62. package/README.txclaw.md +12 -0
  63. package/README.uberclaw.md +12 -0
  64. package/README.volclaw.md +22 -0
  65. package/README.wxclaw.md +12 -0
  66. package/README.xclaw.md +12 -0
  67. package/README.zh-CN.md +213 -0
  68. package/README.zhclaw.md +12 -0
  69. package/dist/chunk-LIZ6XXW3.js +1149 -0
  70. package/dist/index.d.ts +2 -0
  71. package/dist/index.js +582 -0
  72. package/dist/server-ZYSNFLSO.js +7 -0
  73. package/package.json +12 -0
package/README.md.bak ADDED
@@ -0,0 +1,242 @@
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
+ Keep your OpenClaw service alive. Automatically.
9
+ </p>
10
+
11
+ <p align="center">
12
+ <a href="./README.zh-CN.md">中文文档</a>
13
+ </p>
14
+
15
+ <p align="center">
16
+ <a href="https://www.npmjs.com/package/openclaw-doctor"><img src="https://img.shields.io/npm/v/openclaw-doctor?label=openclaw-doctor&color=red" alt="npm version" /></a>
17
+ &nbsp;
18
+ <a href="https://www.npmjs.com/package/openclaw-doctor"><img src="https://img.shields.io/npm/dm/openclaw-doctor?color=red" alt="npm downloads" /></a>
19
+ &nbsp;
20
+ <a href="https://www.npmjs.com/package/openclaw-cli"><img src="https://img.shields.io/npm/v/openclaw-cli?label=openclaw-cli&color=blue" alt="npm openclaw-cli" /></a>
21
+ &nbsp;
22
+ <a href="https://www.npmjs.com/package/openclaw-manage"><img src="https://img.shields.io/npm/v/openclaw-manage?label=openclaw-manage&color=green" alt="npm openclaw-manage" /></a>
23
+ &nbsp;
24
+ <a href="./LICENSE"><img src="https://img.shields.io/badge/license-MIT-brightgreen" alt="License" /></a>
25
+ &nbsp;
26
+ <img src="https://img.shields.io/node/v/openclaw-doctor" alt="Node version" />
27
+ </p>
28
+
29
+ ---
30
+
31
+ ## Why Doctor?
32
+
33
+ OpenClaw runs as a local daemon. When it crashes — network hiccup, system wake, bad update — your AI assistant goes dark. You notice only when you try to use it.
34
+
35
+ **Doctor watches the gateway for you.** It detects failures, restarts the service automatically, and notifies you. No config, no babysitting.
36
+
37
+ ## Primary Package
38
+
39
+ > **`openclaw-cli` is the primary package.** All package names (`openclaw-doctor`, `openclaw-manage`, `qclaw`, `aiclaw`, etc.) point to the same tool — install whichever name feels right, it works identically.
40
+ >
41
+ > `openclaw-doctor` is the original name and is kept for backward compatibility.
42
+
43
+ ## Get Started
44
+
45
+ ```bash
46
+ npm install -g openclaw-doctor
47
+ openclaw-doctor watch -d
48
+ ```
49
+
50
+ That's it. Doctor is now running in the background. It reads everything from your existing OpenClaw setup — no configuration needed.
51
+
52
+ <p align="center">
53
+ <img src="https://raw.githubusercontent.com/Sobranier/openclaw-cli/main/assets/demo.gif" alt="OpenClaw Doctor demo" width="700" />
54
+ </p>
55
+
56
+ ## Core Commands
57
+
58
+ ```bash
59
+ openclaw-doctor watch # Start monitoring (foreground)
60
+ openclaw-doctor watch -d # Start monitoring (background)
61
+ openclaw-doctor unwatch # Stop monitoring
62
+
63
+ openclaw-doctor status # Quick health check
64
+ ```
65
+
66
+ These four cover 90% of daily use.
67
+
68
+ ## Gateway Management
69
+
70
+ ```bash
71
+ openclaw-doctor gateway start # Start the OpenClaw gateway
72
+ openclaw-doctor gateway stop # Stop the gateway
73
+ openclaw-doctor gateway restart # Restart the gateway
74
+ ```
75
+
76
+ ## Diagnostics & Logs
77
+
78
+ ```bash
79
+ openclaw-doctor doctor # Full diagnostics (binary, gateway, channels)
80
+ openclaw-doctor logs # View gateway logs
81
+ openclaw-doctor logs --error # Error logs only
82
+ openclaw-doctor logs --doctor # Doctor's own event logs
83
+ openclaw-doctor dashboard # Web management UI → http://localhost:9090
84
+ ```
85
+
86
+ ## Install
87
+
88
+ ```bash
89
+ # npm (recommended)
90
+ npm install -g openclaw-doctor
91
+
92
+ # Run without installing
93
+ npx openclaw-doctor status
94
+ ```
95
+
96
+ > Requires Node.js >= 22 (same as OpenClaw).
97
+
98
+ ## How It Works
99
+
100
+ Doctor auto-detects your OpenClaw installation — no manual config:
101
+
102
+ - Reads `~/.openclaw/openclaw.json` for gateway port, channels, and agents
103
+ - Finds the launchd service under `~/Library/LaunchAgents/`
104
+ - Checks health via `openclaw health --json` (real gateway RPC, not HTTP ping)
105
+ - Restarts via `launchctl kickstart` when consecutive failures exceed the threshold
106
+
107
+ ## All Commands
108
+
109
+ | Command | Description |
110
+ |---------|-------------|
111
+ | `watch` | Start health monitoring (foreground) |
112
+ | `watch -d` | Start health monitoring (background) |
113
+ | `watch -d --dashboard` | Background monitoring + web dashboard |
114
+ | `unwatch` | Stop monitoring |
115
+ | `gateway start` | Start the OpenClaw gateway |
116
+ | `gateway stop` | Stop the gateway |
117
+ | `gateway restart` | Restart the gateway |
118
+ | `status` | Show gateway and channel health |
119
+ | `status --json` | Machine-readable JSON output |
120
+ | `doctor` | Run full diagnostics |
121
+ | `dashboard` | Start web management UI |
122
+ | `logs` | Show gateway logs |
123
+ | `logs --error` | Error logs only |
124
+ | `logs --doctor` | Doctor event logs |
125
+
126
+ ## Configuration
127
+
128
+ Auto-created at `~/.openclaw-doctor/config.json` on first run.
129
+
130
+ ```json
131
+ {
132
+ "checkInterval": 30,
133
+ "failThreshold": 3,
134
+ "dashboardPort": 9090,
135
+ "maxRestartsPerHour": 5,
136
+ "openclawProfile": "default",
137
+ "notify": {
138
+ "webhook": {
139
+ "enabled": false,
140
+ "url": "",
141
+ "bodyTemplate": "{\"msgtype\":\"text\",\"text\":{\"content\":\"{{message}}\"}}"
142
+ },
143
+ "system": {
144
+ "enabled": true
145
+ }
146
+ }
147
+ }
148
+ ```
149
+
150
+ | Field | Default | Description |
151
+ |-------|---------|-------------|
152
+ | `checkInterval` | `30` | Seconds between health checks |
153
+ | `failThreshold` | `3` | Consecutive failures before restart |
154
+ | `dashboardPort` | `9090` | Web dashboard port |
155
+ | `maxRestartsPerHour` | `5` | Restart throttle (prevents restart loops) |
156
+ | `openclawProfile` | `"default"` | OpenClaw profile to monitor |
157
+ | `notify.webhook.url` | — | Webhook URL (DingTalk, Feishu, Slack, etc.) |
158
+ | `notify.system.enabled` | `true` | macOS native notifications |
159
+
160
+ ## Notifications
161
+
162
+ Doctor covers the full restart lifecycle:
163
+
164
+ | Event | Message |
165
+ |-------|---------|
166
+ | Started | "Doctor is watching your OpenClaw service" |
167
+ | Degraded | "Service unhealthy (attempt 2/3)" |
168
+ | Restarting | "Restarting gateway..." |
169
+ | Recovered | "Gateway back online" |
170
+ | Failed | "Restart failed: [error]" |
171
+ | Throttled | "Too many restarts — manual intervention needed" |
172
+ | Self-recovered | "Service recovered on its own" |
173
+ | Stopped | "Doctor stopped" |
174
+
175
+ **Channels:** Webhook (DingTalk, Feishu, Slack, custom) + macOS system notifications.
176
+
177
+ ## Architecture
178
+
179
+ ```
180
+ +-----------------+
181
+ | Notification |
182
+ | (Webhook/OS) |
183
+ +--------^--------+
184
+ |
185
+ +-------------+ CLI +--------+--------+ RPC +-----------+
186
+ | OpenClaw | --------> | | ---------> | OpenClaw |
187
+ | / Scripts | | openclaw-doctor | | Gateway |
188
+ | / Skills | <-------- | (daemon) | <--------- | :18789 |
189
+ +-------------+ stdout +--------+--------+ health +-----------+
190
+ |
191
+ +--------v--------+
192
+ | ~/.openclaw/logs |
193
+ | (read & analyze) |
194
+ +-----------------+
195
+ ```
196
+
197
+ Doctor runs as a standalone daemon. If the calling process crashes, Doctor keeps running.
198
+
199
+ ```bash
200
+ openclaw-doctor status --json # Machine-readable — pipe into scripts or agents
201
+ openclaw-doctor watch -d # Idempotent — safe to call repeatedly
202
+ ```
203
+
204
+ ## Roadmap
205
+
206
+ - [x] Health check via `openclaw health --json` + auto-restart with throttling
207
+ - [x] Auto-detect OpenClaw config (gateway port, channels, agents, launchd)
208
+ - [x] Background daemon mode (`watch -d` / `unwatch`)
209
+ - [x] Gateway management (`gateway start/stop/restart`)
210
+ - [x] Read and display OpenClaw gateway logs
211
+ - [x] Web status dashboard
212
+ - [x] `--json` output for status
213
+ - [ ] Notification system (Webhook + macOS)
214
+ - [ ] `logs --tail` (real-time follow)
215
+ - [ ] `config` command (get/set)
216
+ - [ ] Multiple service monitoring
217
+ - [ ] Linux systemd support
218
+
219
+ ## Development
220
+
221
+ ```bash
222
+ git clone https://github.com/Sobranier/openclaw-cli.git
223
+ cd openclaw-doctor
224
+ npm install
225
+
226
+ npm run dev -- status # Quick test
227
+ npm run dev -- watch # Foreground monitoring
228
+ npm run dev -- watch -d # Background daemon
229
+ npm run dev -- unwatch # Stop daemon
230
+
231
+ npm run build # Build for distribution
232
+ ```
233
+
234
+ See [CONTRIBUTING.md](./CONTRIBUTING.md) for the release and publish workflow.
235
+
236
+ ## License
237
+
238
+ [MIT](./LICENSE)
239
+
240
+ ---
241
+
242
+ Works with [OpenClaw](https://openclaw.ai) · Built for the OpenClaw ecosystem
@@ -0,0 +1,22 @@
1
+ # megaclaw
2
+
3
+ > This package is an alias for [openclaw-cli](https://www.npmjs.com/package/openclaw-cli).
4
+
5
+ CLI and health-watch daemon for OpenClaw AI assistant gateway.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ npm install -g megaclaw
11
+ megaclaw watch -d
12
+ ```
13
+
14
+ ## Usage
15
+
16
+ ```bash
17
+ megaclaw watch -d # Start background monitoring
18
+ megaclaw status # Health check
19
+ megaclaw unwatch # Stop monitoring
20
+ ```
21
+
22
+ For full documentation, see [openclaw-cli](https://github.com/Sobranier/openclaw-cli).
@@ -0,0 +1,12 @@
1
+ # metaclaw
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 metaclaw
9
+ metaclaw watch -d
10
+ ```
11
+
12
+ See [openclaw-cli](https://github.com/Sobranier/openclaw-cli) for full docs.
@@ -0,0 +1,12 @@
1
+ # miclaw
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 miclaw
9
+ miclaw watch -d
10
+ ```
11
+
12
+ See [openclaw-cli](https://github.com/Sobranier/openclaw-cli) for full docs.
@@ -0,0 +1,12 @@
1
+ # msclaw
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 msclaw
9
+ msclaw watch -d
10
+ ```
11
+
12
+ See [openclaw-cli](https://github.com/Sobranier/openclaw-cli) for full docs.
@@ -0,0 +1,12 @@
1
+ # mtclaw
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 mtclaw
9
+ mtclaw watch -d
10
+ ```
11
+
12
+ See [openclaw-cli](https://github.com/Sobranier/openclaw-cli) for full docs.
@@ -0,0 +1,12 @@
1
+ # nflxclaw
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 nflxclaw
9
+ nflxclaw watch -d
10
+ ```
11
+
12
+ See [openclaw-cli](https://github.com/Sobranier/openclaw-cli) for full docs.
@@ -0,0 +1,12 @@
1
+ # nvdaclaw
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 nvdaclaw
9
+ nvdaclaw watch -d
10
+ ```
11
+
12
+ See [openclaw-cli](https://github.com/Sobranier/openclaw-cli) for full docs.
@@ -0,0 +1,22 @@
1
+ # open-claw
2
+
3
+ > This package is an alias for [openclaw-cli](https://www.npmjs.com/package/openclaw-cli).
4
+
5
+ CLI and health-watch daemon for OpenClaw AI assistant gateway.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ npm install -g open-claw
11
+ open-claw watch -d
12
+ ```
13
+
14
+ ## Usage
15
+
16
+ ```bash
17
+ open-claw watch -d # Start background monitoring
18
+ open-claw status # Health check
19
+ open-claw unwatch # Stop monitoring
20
+ ```
21
+
22
+ For full documentation, see [openclaw-cli](https://github.com/Sobranier/openclaw-cli).
@@ -0,0 +1,12 @@
1
+ # openaiclaw
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 openaiclaw
9
+ openaiclaw watch -d
10
+ ```
11
+
12
+ See [openclaw-cli](https://github.com/Sobranier/openclaw-cli) for full docs.
@@ -0,0 +1,239 @@
1
+ <p align="center">
2
+ <img src="https://raw.githubusercontent.com/Sobranier/openclaw-cli/main/assets/welcome.png" alt="OpenClaw CLI" width="400" />
3
+ </p>
4
+
5
+ <h1 align="center">OpenClaw CLI</h1>
6
+
7
+ <p align="center">
8
+ Keep your OpenClaw service alive. Automatically.
9
+ </p>
10
+
11
+ <p align="center">
12
+ <a href="./README.zh-CN.md">中文文档</a>
13
+ </p>
14
+
15
+ ## Get Started
16
+
17
+ ```bash
18
+ npm install -g openclaw-cli
19
+ openclaw-cli watch -d
20
+ ```
21
+
22
+ That's it. Doctor monitors your OpenClaw gateway in the background, restarts it when it goes down, and tells you what happened. Zero configuration needed -- it reads everything from your existing OpenClaw setup.
23
+
24
+ ## Core Commands
25
+
26
+ ```bash
27
+ openclaw-cli watch # Start monitoring (foreground)
28
+ openclaw-cli watch -d # Start monitoring (background)
29
+ openclaw-cli unwatch # Stop monitoring
30
+
31
+ openclaw-cli status # Quick health check
32
+ ```
33
+
34
+ These four commands cover 90% of daily use.
35
+
36
+ ## Gateway Management
37
+
38
+ ```bash
39
+ openclaw-cli gateway start # Start the OpenClaw gateway
40
+ openclaw-cli gateway stop # Stop the gateway
41
+ openclaw-cli gateway restart # Restart the gateway
42
+ ```
43
+
44
+ ## Diagnostics & Logs
45
+
46
+ ```bash
47
+ openclaw-cli doctor # Full diagnostics (binary, gateway, channels)
48
+ openclaw-cli logs # View gateway logs
49
+ openclaw-cli logs --error # View error logs only
50
+ openclaw-cli logs --doctor # View Doctor's own event logs
51
+ openclaw-cli dashboard # Web management UI (http://localhost:9090)
52
+ ```
53
+
54
+ ## Install
55
+
56
+ ```bash
57
+ # npm (recommended)
58
+ npm install -g openclaw-cli
59
+
60
+ # or run without installing
61
+ npx openclaw-cli status
62
+ ```
63
+
64
+ Requires Node >= 22 (same as OpenClaw).
65
+
66
+ ## How It Works
67
+
68
+ Doctor auto-detects your OpenClaw installation:
69
+
70
+ - Reads `~/.openclaw/openclaw.json` for gateway port, channels, agents
71
+ - Finds the launchd service from `~/Library/LaunchAgents/`
72
+ - Checks health via `openclaw health --json` (real gateway RPC, not HTTP)
73
+ - Restarts via `launchctl kickstart` when needed
74
+
75
+ **You don't configure OpenClaw details.** Doctor figures them out.
76
+
77
+ ## All Commands
78
+
79
+ | Command | Description |
80
+ |---------|-------------|
81
+ | **Monitoring** | |
82
+ | `watch` | Start health monitoring (foreground) |
83
+ | `watch -d` | Start health monitoring (background) |
84
+ | `watch -d --dashboard` | Background monitoring + web dashboard |
85
+ | `unwatch` | Stop monitoring |
86
+ | **Gateway** | |
87
+ | `gateway start` | Start the OpenClaw gateway |
88
+ | `gateway stop` | Stop the gateway |
89
+ | `gateway restart` | Restart the gateway |
90
+ | **Info** | |
91
+ | `status` | Show gateway and channel health |
92
+ | `status --json` | Machine-readable JSON output |
93
+ | `doctor` | Run full diagnostics |
94
+ | `dashboard` | Start web management UI |
95
+ | `logs` | Show gateway logs |
96
+ | `logs --error` | Show error logs only |
97
+ | `logs --doctor` | Show Doctor event logs |
98
+
99
+ ## Configuration
100
+
101
+ Config is stored at `~/.openclaw-doctor/config.json`. Created automatically on first run. Only Doctor's own preferences -- no OpenClaw settings needed.
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
+ | Field | Description | Default |
124
+ |-------|-------------|---------|
125
+ | `checkInterval` | Seconds between health checks | `30` |
126
+ | `failThreshold` | Consecutive failures before restart | `3` |
127
+ | `dashboardPort` | Web dashboard port | `9090` |
128
+ | `maxRestartsPerHour` | Restart throttle | `5` |
129
+ | `openclawProfile` | OpenClaw profile to monitor (`default`, `dev`, ...) | `default` |
130
+ | `notify.webhook.url` | Webhook for notifications | -- |
131
+ | `notify.system.enabled` | macOS native notifications | `true` |
132
+
133
+ ## Notifications
134
+
135
+ Doctor notifies you across the full lifecycle:
136
+
137
+ | Event | Example |
138
+ |-------|---------|
139
+ | Monitoring started | "Doctor is watching your OpenClaw service" |
140
+ | Health degraded | "Service unhealthy (attempt 2/3)" |
141
+ | Restarting | "Restarting gateway..." |
142
+ | Restart succeeded | "Gateway back online" |
143
+ | Restart failed | "Restart failed: [error]" |
144
+ | Throttled | "Too many restarts, manual intervention needed" |
145
+ | Recovered | "Service recovered on its own" |
146
+ | Monitoring stopped | "Doctor stopped" |
147
+
148
+ Channels: **Webhook** (DingTalk, Feishu, Slack, etc.) + **macOS system notifications**.
149
+
150
+ ## Skills Integration
151
+
152
+ Doctor runs as a standalone daemon, callable by OpenClaw or other tools:
153
+
154
+ ```bash
155
+ openclaw-cli status --json # Machine-readable output
156
+ openclaw-cli watch -d # Idempotent -- safe to call repeatedly
157
+ ```
158
+
159
+ If the caller crashes, Doctor keeps running.
160
+
161
+ ## Architecture
162
+
163
+ ```
164
+ +-----------------+
165
+ | Notification |
166
+ | (Webhook/OS) |
167
+ +--------^--------+
168
+ |
169
+ +-------------+ CLI +--------+--------+ RPC +-----------+
170
+ | OpenClaw | --------> | | ---------> | OpenClaw |
171
+ | / Scripts | | openclaw-doctor | | Gateway |
172
+ | / Skills | <-------- | (daemon) | <--------- | :18789 |
173
+ +-------------+ stdout +--------+--------+ health +-----------+
174
+ |
175
+ +--------v--------+
176
+ | ~/.openclaw/logs |
177
+ | (read & analyze) |
178
+ +-----------------+
179
+ ```
180
+
181
+ ## Development
182
+
183
+ ```bash
184
+ git clone https://github.com/openclaw/openclaw-doctor.git
185
+ cd openclaw-doctor
186
+ npm install
187
+
188
+ npm run dev -- status # Quick test
189
+ npm run dev -- watch # Foreground monitoring
190
+ npm run dev -- watch -d # Background daemon
191
+ npm run dev -- unwatch # Stop daemon
192
+
193
+ npm run build # Build for distribution
194
+ ```
195
+
196
+ ## Roadmap
197
+
198
+ - [x] Health check via `openclaw health --json` + auto-restart with throttling
199
+ - [x] Auto-detect OpenClaw config (gateway port, channels, agents, launchd)
200
+ - [x] Background daemon mode (`watch -d` / `unwatch`)
201
+ - [x] Gateway management (`gateway start/stop/restart`)
202
+ - [x] Read and display OpenClaw gateway logs
203
+ - [x] Web status dashboard
204
+ - [x] `--json` output for status
205
+ - [ ] Notification system (Webhook + macOS)
206
+ - [ ] `logs --tail` (real-time follow)
207
+ - [ ] `config` command (get/set)
208
+ - [ ] Multiple service monitoring
209
+ - [ ] Linux systemd support
210
+
211
+ ## License
212
+
213
+ [MIT](./LICENSE)
214
+
215
+ ## Publishing
216
+
217
+ This repo publishes two npm packages from the same codebase:
218
+
219
+ - **`openclaw-cli`** — the main package (`package.json`)
220
+ - **`openclaw-cli`** — alias package (`package.openclaw-cli.json`)
221
+
222
+ Both packages share the same version number and dist output.
223
+
224
+ ### Release a new version
225
+
226
+ ```bash
227
+ # 1. Bump version (patch / minor / major)
228
+ npm version patch
229
+
230
+ # 2. Build + publish both packages
231
+ npm run release
232
+ ```
233
+
234
+ `npm run release` calls `scripts/publish.sh`, which:
235
+ 1. Builds once (`npm run build`)
236
+ 2. Publishes `openclaw-cli` with the default `package.json`
237
+ 3. Temporarily swaps in `package.openclaw-cli.json`, publishes `openclaw-cli`, then restores
238
+
239
+ To update the `openclaw-cli` package metadata (description, keywords, bin name, etc.), edit `package.openclaw-cli.json`. Keep `version` in sync — it's automatically picked up from whichever `package.json` is active during publish.