← 返回
开发者工具 中文

OpenClaw Guardian by MyClaw.ai

Deploy and manage a Guardian watchdog for OpenClaw Gateway. Auto-monitor every 30s, self-repair via doctor --fix, git-based workspace rollback, daily snapsho...
部署并管理 OpenClaw Gateway 的 Guardian 看门狗。每 30 秒自动监控,使用 doctor --fix 自动修复,基于 Git 的工作区回滚,每日快照。
leoyeai
开发者工具 clawhub v1.0.2 1 版本 100000 Key: 无需
★ 1
Stars
📥 1,067
下载
💾 5
安装
1
版本
#latest

概述

OpenClaw Guardian

A standalone watchdog that keeps your OpenClaw Gateway alive 24/7. Built from MyClaw.ai's production infrastructure and open-sourced for the community.

> Powered by MyClaw.ai — https://myclaw.ai

What It Does

  • Checks Gateway health every 30 seconds (GUARDIAN_CHECK_INTERVAL, default: 30)
  • On failure: runs openclaw doctor --fix up to 3 times (GUARDIAN_MAX_REPAIR, default: 3)
  • If still down: git reset --hard to last stable commit, restart Gateway
  • Daily automatic git commit snapshot of workspace
  • Optional Discord webhook alerts (DISCORD_WEBHOOK_URL)

Environment Variables

All optional — defaults work out of the box:

VariableDefaultDescription
---------
GUARDIAN_WORKSPACE$HOME/.openclaw/workspaceWorkspace path (must be a git repo)
GUARDIAN_LOG/tmp/openclaw-guardian.logLog file path
GUARDIAN_CHECK_INTERVAL30Health check interval (seconds)
GUARDIAN_MAX_REPAIR3Max doctor --fix attempts before rollback
GUARDIAN_COOLDOWN300Cooldown period after all repairs fail (seconds)
OPENCLAW_CMDopenclawOpenClaw CLI command
DISCORD_WEBHOOK_URL_(unset)_Discord webhook URL for alerts (optional)

Required System Tools

  • git — for workspace rollback and daily snapshots
  • pgrep / pkill — for process detection
  • curl — for Discord webhook alerts (only if DISCORD_WEBHOOK_URL is set)
  • openclaw — the OpenClaw CLI

Quick Start

Tell your OpenClaw agent:

> "Help me install openclaw-guardian to harden my gateway"

Or manually:

# 1. Init git in workspace (required for rollback)
cd ~/.openclaw/workspace
git init && git add -A && git commit -m "initial"

# 2. Install
cp scripts/guardian.sh ~/.openclaw/guardian.sh
chmod +x ~/.openclaw/guardian.sh

# 3. Start
nohup ~/.openclaw/guardian.sh >> /tmp/openclaw-guardian.log 2>&1 &

Note: Use repository-level git config, not --global:

git -C ~/.openclaw/workspace config user.email "guardian@example.com"
git -C ~/.openclaw/workspace config user.name "Guardian"

Auto-start on Container Restart

Add to ~/.openclaw/start-gateway.sh before the final exec line:

pkill -f "guardian.sh" 2>/dev/null || true
nohup /home/ubuntu/.openclaw/guardian.sh >> /tmp/openclaw-guardian.log 2>&1 &

Full docs: https://github.com/LeoYeAI/openclaw-guardian

版本历史

共 1 个版本

  • v1.0.2 当前
    2026-03-29 11:34 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

developer-tools

CodeConductor.ai

larsonreever
AI驱动平台,提供快速全栈开发、智能体、工作流自动化及低代码AI集成的可扩展产品创建。
★ 65 📥 179,842
data-analysis

Openclaw Master Skills Clawhub Pkg

leoyeai
精选 1709+ 最优秀的 OpenClaw 技能——AI 工具、效率、营销、前端、移动、后端、DevOps 等。每周由 MyClaw 更新。
★ 4 📥 4,326
developer-tools

Gog

steipete
Google Workspace 命令行工具,支持 Gmail、日历、云端硬盘、通讯录、表格和文档。
★ 920 📥 185,727