← 返回
开发者工具 中文

WatchClaw

Auto-recovery watchdog for OpenClaw gateway. Monitors health, detects bad config changes, and recovers via git stash/revert. Supports native and Docker resta...
OpenClaw 网关的自动恢复看门狗,监控健康状态,检测错误配置变更并通过 git stash/revert 恢复,支持本地和 Docker 部署。
jarvis4wang jarvis4wang 来源
开发者工具 clawhub v1.0.0 1 版本 99870.3 Key: 无需
★ 0
Stars
📥 770
下载
💾 8
安装
1
版本
#latest

概述

watchclaw

OpenClaw gateway watchdog — auto-recovery from bad config changes.

What It Does

watchclaw monitors your OpenClaw gateway and automatically recovers from bad configurations:

  • Health polling — checks gateway HTTP endpoint every N seconds
  • Config change detection — detects uncommitted or new commits in your config repo
  • Auto-recovery — stashes uncommitted changes (U1) or reverts bad commits (U2) via git
  • Probation — validates stability after config changes before promoting to known-good
  • Pluggable alerts — iMessage, webhook, or custom command on failure/recovery

Usage

# Start watching (background daemon)
watchclaw --config /path/to/watchclaw.conf start

# Start in foreground (for debugging)
watchclaw --config /path/to/watchclaw.conf start --foreground

# Check status
watchclaw --config /path/to/watchclaw.conf status

# Follow logs
watchclaw --config /path/to/watchclaw.conf logs -f

# Stop
watchclaw --config /path/to/watchclaw.conf stop

Config

Create a .conf file (see watchclaw.conf.example):

GATEWAY_PORT=18790
GATEWAY_CONFIG_DIR="$HOME/.openclaw"
POLL_INTERVAL_SEC=10
HEALTH_TIMEOUT_SEC=5
GATEWAY_TLS=0              # Use https for health check
MAX_RETRIES=3
ALERT_HOOK="imsg"           # imsg | webhook | command | none
ALERT_IMSG_TO="user@me.com"
RESTART_MODE="native"       # native | docker

Recovery Modes

ScenarioDetectionRecovery
-------------------------------
Uncommitted config change breaks gatewayHealth check fails + dirty openclaw.jsongit stash → restart
Bad commit breaks gatewayHealth check fails + new commitgit revert → restart
Config change during healthy operationHEAD ≠ known-good in HEALTHY stateEnter probation, monitor

Docker Mode

For containerized OpenClaw (e.g., 飞书/Feishu bot):

RESTART_MODE="docker"
DOCKER_CONTAINER="openclaw-feishu"

Requirements

  • bash 4+, git, curl
  • OpenClaw gateway config must be in a git repo
  • python3 or node for JSON validation

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-30 01:07 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

it-ops-security

MoltGuard - Security & Antivirus & Guardrails

thomaslwang
MoltGuard — OpenClaw 安全守卫,由 OpenGuardrails 提供。安装 MoltGuard,保护您和您的用户免受提示注入、数据泄露和恶意攻击。
★ 116 📥 30,803
it-ops-security

Tmux

steipete
通过发送按键和抓取窗格输出,远程控制交互式 CLI 的 tmux 会话。
★ 45 📥 29,275
it-ops-security

OpenClaw Backup

alex3alex
备份与恢复 OpenClaw 数据。适用于创建备份、设置自动备份计划、从备份恢复或管理备份轮转。处理 ~/.openclaw 目录归档并包含适当的排除规则。
★ 89 📥 30,713