smartclaw 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.autoopenclaw.md +22 -0
- package/README.claw-open.md +22 -0
- package/README.clawjs.md +22 -0
- package/README.fastclaw.md +22 -0
- package/README.md +22 -0
- package/README.md.bak +242 -0
- package/README.megaclaw.md +22 -0
- package/README.open-claw.md +22 -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.qclaw-cli.md +22 -0
- package/README.qclaw.md +22 -0
- package/README.smartclaw.md +22 -0
- package/README.volclaw.md +22 -0
- package/README.zh-CN.md +213 -0
- package/app-dist/main.js +300 -0
- package/app-dist/package.json +3 -0
- package/app-dist/server-process.js +95 -0
- package/assets/demo.gif +0 -0
- package/assets/welcome.png +0 -0
- package/demo.tape +28 -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/homebrew/README.md +37 -0
- package/homebrew/openclaw-cli.rb +22 -0
- package/homebrew/openclaw-doctor.rb +26 -0
- package/package.aiclaw.json +25 -0
- package/package.aliclaw.json +25 -0
- package/package.autoopenclaw.json +25 -0
- package/package.claw-open.json +25 -0
- package/package.clawjs.json +25 -0
- package/package.fastclaw.json +25 -0
- package/package.json +25 -0
- package/package.json.bak +51 -0
- package/package.megaclaw.json +25 -0
- package/package.open-claw.json +25 -0
- package/package.openclaw-cli.json +51 -0
- package/package.openclaw-daemon.json +51 -0
- package/package.openclaw-gateway.json +51 -0
- package/package.openclaw-health.json +51 -0
- package/package.openclaw-helper.json +51 -0
- package/package.openclaw-install.json +51 -0
- package/package.openclaw-manage.json +51 -0
- package/package.openclaw-monitor.json +51 -0
- package/package.openclaw-run.json +51 -0
- package/package.openclaw-service.json +51 -0
- package/package.openclaw-setup.json +51 -0
- package/package.openclaw-start.json +51 -0
- package/package.openclaw-tools.json +51 -0
- package/package.openclaw-upgrade.json +50 -0
- package/package.openclaw-utils.json +51 -0
- package/package.openclaw-watch.json +51 -0
- package/package.qclaw-cli.json +25 -0
- package/package.qclaw.json +25 -0
- package/package.smartclaw.json +25 -0
- package/package.volclaw.json +25 -0
- package/scripts/post-app-compile.cjs +3 -0
- package/scripts/post-app-compile.js +7 -0
- package/scripts/publish.sh +120 -0
- package/scripts/publish.sh.bak +63 -0
package/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# Contributing to OpenClaw Doctor
|
|
2
|
+
|
|
3
|
+
Thanks for taking the time to contribute!
|
|
4
|
+
|
|
5
|
+
## Development Setup
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
git clone https://github.com/Sobranier/openclaw-doctor.git
|
|
9
|
+
cd openclaw-doctor
|
|
10
|
+
npm install
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
### Running locally
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm run dev -- status # Quick health check
|
|
17
|
+
npm run dev -- watch # Foreground monitoring
|
|
18
|
+
npm run dev -- watch -d # Background daemon
|
|
19
|
+
npm run dev -- unwatch # Stop daemon
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
### Building
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
npm run build
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Output goes to `dist/`.
|
|
29
|
+
|
|
30
|
+
## Project Structure
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
src/
|
|
34
|
+
commands/ # CLI command handlers (watch, status, gateway, logs, ...)
|
|
35
|
+
core/ # Health check, restart logic, daemon management
|
|
36
|
+
dashboard/ # Web UI (Express + static assets)
|
|
37
|
+
notify/ # Notification channels (webhook, macOS system)
|
|
38
|
+
utils/ # OpenClaw config auto-detection, launchd helpers
|
|
39
|
+
scripts/
|
|
40
|
+
publish.sh # Multi-package publish script
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Making Changes
|
|
44
|
+
|
|
45
|
+
1. Fork the repo and create a branch from `main`:
|
|
46
|
+
```bash
|
|
47
|
+
git checkout -b fix/your-change
|
|
48
|
+
```
|
|
49
|
+
2. Make your changes and test locally with `npm run dev`.
|
|
50
|
+
3. Build to make sure nothing is broken:
|
|
51
|
+
```bash
|
|
52
|
+
npm run build
|
|
53
|
+
```
|
|
54
|
+
4. Open a Pull Request against `main`.
|
|
55
|
+
|
|
56
|
+
## Release Workflow
|
|
57
|
+
|
|
58
|
+
This repo publishes multiple npm packages from the same codebase. **Do not publish manually.**
|
|
59
|
+
|
|
60
|
+
### Packages
|
|
61
|
+
|
|
62
|
+
| Package | Config |
|
|
63
|
+
|---------|--------|
|
|
64
|
+
| `openclaw-doctor` | `package.json` |
|
|
65
|
+
| `openclaw-cli` | `package.openclaw-cli.json` |
|
|
66
|
+
| `openclaw-manage` | `package.openclaw-manage.json` |
|
|
67
|
+
| _(and others)_ | `package.openclaw-*.json` |
|
|
68
|
+
|
|
69
|
+
All packages share the same version number and `dist/` output.
|
|
70
|
+
|
|
71
|
+
### Cutting a release
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
# 1. Pull latest
|
|
75
|
+
git pull origin main
|
|
76
|
+
|
|
77
|
+
# 2. Bump version (patch / minor / major)
|
|
78
|
+
npm version patch # e.g. 0.3.0 → 0.3.1
|
|
79
|
+
|
|
80
|
+
# 3. Build + publish all packages
|
|
81
|
+
npm run release
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
`npm run release` calls `scripts/publish.sh`, which:
|
|
85
|
+
1. Builds once (`npm run build`)
|
|
86
|
+
2. Publishes `openclaw-doctor` with `package.json`
|
|
87
|
+
3. For each `package.openclaw-*.json`: temporarily swaps it in as `package.json`, publishes, then restores
|
|
88
|
+
|
|
89
|
+
### Version sync
|
|
90
|
+
|
|
91
|
+
All `package.openclaw-*.json` files must stay in sync with `package.json`. The publish script reads whichever `package.json` is active — keep `version` consistent across all of them.
|
|
92
|
+
|
|
93
|
+
To update a sub-package metadata (description, keywords, bin), edit its `package.openclaw-*.json` directly.
|
|
94
|
+
|
|
95
|
+
## Reporting Issues
|
|
96
|
+
|
|
97
|
+
Open an issue on GitHub with:
|
|
98
|
+
- Your OpenClaw version (`openclaw --version`)
|
|
99
|
+
- Your OS and Node.js version
|
|
100
|
+
- The output of `openclaw-doctor doctor`
|
|
101
|
+
- What you expected vs. what happened
|
|
102
|
+
|
|
103
|
+
## License
|
|
104
|
+
|
|
105
|
+
By contributing, you agree that your contributions will be licensed under the [MIT License](./LICENSE).
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 OpenClaw
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.aiclaw.md
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# aiclaw
|
|
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 aiclaw
|
|
11
|
+
aiclaw watch -d
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Usage
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
aiclaw watch -d # Start background monitoring
|
|
18
|
+
aiclaw status # Health check
|
|
19
|
+
aiclaw unwatch # Stop monitoring
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
For full documentation, see [openclaw-cli](https://github.com/Sobranier/openclaw-doctor).
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# aliclaw
|
|
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 aliclaw
|
|
11
|
+
aliclaw watch -d
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Usage
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
aliclaw watch -d # Start background monitoring
|
|
18
|
+
aliclaw status # Health check
|
|
19
|
+
aliclaw unwatch # Stop monitoring
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
For full documentation, see [openclaw-cli](https://github.com/Sobranier/openclaw-doctor).
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# autoopenclaw
|
|
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 autoopenclaw
|
|
11
|
+
autoopenclaw watch -d
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Usage
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
autoopenclaw watch -d # Start background monitoring
|
|
18
|
+
autoopenclaw status # Health check
|
|
19
|
+
autoopenclaw unwatch # Stop monitoring
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
For full documentation, see [openclaw-cli](https://github.com/Sobranier/openclaw-doctor).
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# claw-open
|
|
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 claw-open
|
|
11
|
+
claw-open watch -d
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Usage
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
claw-open watch -d # Start background monitoring
|
|
18
|
+
claw-open status # Health check
|
|
19
|
+
claw-open unwatch # Stop monitoring
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
For full documentation, see [openclaw-cli](https://github.com/Sobranier/openclaw-doctor).
|
package/README.clawjs.md
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# clawjs
|
|
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 clawjs
|
|
11
|
+
clawjs watch -d
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Usage
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
clawjs watch -d # Start background monitoring
|
|
18
|
+
clawjs status # Health check
|
|
19
|
+
clawjs unwatch # Stop monitoring
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
For full documentation, see [openclaw-cli](https://github.com/Sobranier/openclaw-doctor).
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# fastclaw
|
|
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 fastclaw
|
|
11
|
+
fastclaw watch -d
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Usage
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
fastclaw watch -d # Start background monitoring
|
|
18
|
+
fastclaw status # Health check
|
|
19
|
+
fastclaw unwatch # Stop monitoring
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
For full documentation, see [openclaw-cli](https://github.com/Sobranier/openclaw-doctor).
|
package/README.md
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# smartclaw
|
|
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 smartclaw
|
|
11
|
+
smartclaw watch -d
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Usage
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
smartclaw watch -d # Start background monitoring
|
|
18
|
+
smartclaw status # Health check
|
|
19
|
+
smartclaw unwatch # Stop monitoring
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
For full documentation, see [openclaw-cli](https://github.com/Sobranier/openclaw-doctor).
|
package/README.md.bak
ADDED
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="https://raw.githubusercontent.com/Sobranier/openclaw-doctor/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
|
+
|
|
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
|
+
|
|
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
|
+
|
|
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
|
+
|
|
24
|
+
<a href="./LICENSE"><img src="https://img.shields.io/badge/license-MIT-brightgreen" alt="License" /></a>
|
|
25
|
+
|
|
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-doctor/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-doctor.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-doctor).
|
|
@@ -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-doctor).
|