Package Exports
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (openclaw-install) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
OpenClaw install
Keep your OpenClaw service alive. Automatically.
Get Started
npm install -g openclaw-install
openclaw-install watch -dThat'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.
Core Commands
openclaw-install watch # Start monitoring (foreground)
openclaw-install watch -d # Start monitoring (background)
openclaw-install unwatch # Stop monitoring
openclaw-install status # Quick health checkThese four commands cover 90% of daily use.
Gateway Management
openclaw-install gateway start # Start the OpenClaw gateway
openclaw-install gateway stop # Stop the gateway
openclaw-install gateway restart # Restart the gatewayDiagnostics & Logs
openclaw-install doctor # Full diagnostics (binary, gateway, channels)
openclaw-install logs # View gateway logs
openclaw-install logs --error # View error logs only
openclaw-install logs --doctor # View Doctor's own event logs
openclaw-install dashboard # Web management UI (http://localhost:9090)Install
# npm (recommended)
npm install -g openclaw-install
# or run without installing
npx openclaw-install statusRequires Node >= 22 (same as OpenClaw).
How It Works
Doctor auto-detects your OpenClaw installation:
- Reads
~/.openclaw/openclaw.jsonfor gateway port, channels, agents - Finds the launchd service from
~/Library/LaunchAgents/ - Checks health via
openclaw health --json(real gateway RPC, not HTTP) - Restarts via
launchctl kickstartwhen needed
You don't configure OpenClaw details. Doctor figures them out.
All Commands
| Command | Description |
|---|---|
| Monitoring | |
watch |
Start health monitoring (foreground) |
watch -d |
Start health monitoring (background) |
watch -d --dashboard |
Background monitoring + web dashboard |
unwatch |
Stop monitoring |
| Gateway | |
gateway start |
Start the OpenClaw gateway |
gateway stop |
Stop the gateway |
gateway restart |
Restart the gateway |
| Info | |
status |
Show gateway and channel health |
status --json |
Machine-readable JSON output |
doctor |
Run full diagnostics |
dashboard |
Start web management UI |
logs |
Show gateway logs |
logs --error |
Show error logs only |
logs --doctor |
Show Doctor event logs |
Configuration
Config is stored at ~/.openclaw-doctor/config.json. Created automatically on first run. Only Doctor's own preferences -- no OpenClaw settings needed.
{
"checkInterval": 30,
"failThreshold": 3,
"dashboardPort": 9090,
"maxRestartsPerHour": 5,
"openclawProfile": "default",
"notify": {
"webhook": {
"enabled": false,
"url": "",
"bodyTemplate": "{\"msgtype\":\"text\",\"text\":{\"content\":\"{{message}}\"}}"
},
"system": {
"enabled": true
}
}
}| Field | Description | Default |
|---|---|---|
checkInterval |
Seconds between health checks | 30 |
failThreshold |
Consecutive failures before restart | 3 |
dashboardPort |
Web dashboard port | 9090 |
maxRestartsPerHour |
Restart throttle | 5 |
openclawProfile |
OpenClaw profile to monitor (default, dev, ...) |
default |
notify.webhook.url |
Webhook for notifications | -- |
notify.system.enabled |
macOS native notifications | true |
Notifications
Doctor notifies you across the full lifecycle:
| Event | Example |
|---|---|
| Monitoring started | "Doctor is watching your OpenClaw service" |
| Health degraded | "Service unhealthy (attempt 2/3)" |
| Restarting | "Restarting gateway..." |
| Restart succeeded | "Gateway back online" |
| Restart failed | "Restart failed: [error]" |
| Throttled | "Too many restarts, manual intervention needed" |
| Recovered | "Service recovered on its own" |
| Monitoring stopped | "Doctor stopped" |
Channels: Webhook (DingTalk, Feishu, Slack, etc.) + macOS system notifications.
Skills Integration
Doctor runs as a standalone daemon, callable by OpenClaw or other tools:
openclaw-install status --json # Machine-readable output
openclaw-install watch -d # Idempotent -- safe to call repeatedlyIf the caller crashes, Doctor keeps running.
Architecture
+-----------------+
| Notification |
| (Webhook/OS) |
+--------^--------+
|
+-------------+ CLI +--------+--------+ RPC +-----------+
| OpenClaw | --------> | | ---------> | OpenClaw |
| / Scripts | | openclaw-doctor | | Gateway |
| / Skills | <-------- | (daemon) | <--------- | :18789 |
+-------------+ stdout +--------+--------+ health +-----------+
|
+--------v--------+
| ~/.openclaw/logs |
| (read & analyze) |
+-----------------+Development
git clone https://github.com/openclaw/openclaw-doctor.git
cd openclaw-doctor
npm install
npm run dev -- status # Quick test
npm run dev -- watch # Foreground monitoring
npm run dev -- watch -d # Background daemon
npm run dev -- unwatch # Stop daemon
npm run build # Build for distributionRoadmap
- Health check via
openclaw health --json+ auto-restart with throttling - Auto-detect OpenClaw config (gateway port, channels, agents, launchd)
- Background daemon mode (
watch -d/unwatch) - Gateway management (
gateway start/stop/restart) - Read and display OpenClaw gateway logs
- Web status dashboard
-
--jsonoutput for status - Notification system (Webhook + macOS)
-
logs --tail(real-time follow) -
configcommand (get/set) - Multiple service monitoring
- Linux systemd support
License
Publishing
This repo publishes two npm packages from the same codebase:
openclaw-install— the main package (package.json)openclaw-install— alias package (package.openclaw-install.json)
Both packages share the same version number and dist output.
Release a new version
# 1. Bump version (patch / minor / major)
npm version patch
# 2. Build + publish both packages
npm run releasenpm run release calls scripts/publish.sh, which:
- Builds once (
npm run build) - Publishes
openclaw-installwith the defaultpackage.json - Temporarily swaps in
package.openclaw-install.json, publishesopenclaw-install, then restores
To update the openclaw-install package metadata (description, keywords, bin name, etc.), edit package.openclaw-install.json. Keep version in sync — it's automatically picked up from whichever package.json is active during publish.