Self Updater
⭐ The ONLY OpenClaw updater with Cron-aware + Idle detection!
Intelligent auto-updater that checks for updates while respecting your scheduled tasks.
Why This Skill?
| Feature | Other Updaters | This Skill |
|---|
| Cron-aware | ❌ | ✅ Avoids your scheduled tasks |
| Idle detection |
❌ | ✅ Waits for system idle |
| AI Risk Assessment | ❌ | ✅ Evaluates update impact |
| User Approval | ❌ | ✅ Confirms High-risk updates |
| Smart Notifications | ⚠️ Basic | ✅ Concise, channel-aware |
Features
- - 🔒 Cron-aware: Reads ~/.openclaw/cron/jobs.json to avoid disrupting your scheduled tasks
- ⏳ Idle detection: Waits for system idle before updating (no interruption!)
- 🧠 AI Impact Assessment: Evaluates risk score (Low/Medium/High) before updating
- ✅ User Approval: Pauses and asks before High-risk updates
- 📲 Smart Notifications: Auto-detects Telegram/Feishu, sends concise reports
- 🔄 Dual Updates: Updates both OpenClaw core AND installed skills
- 🛡️ Auto-restart: Ensures gateway comes back up after updates
- 🌐 Port Auto-detect: Reads gateway port from config automatically
Quick Start
CODEBLOCK0
AI Risk Assessment
Evaluates 5 factors to calculate risk score:
| Factor | Weight | Description |
|---|
| Version Impact | 30% | Major/Minor/Patch |
| Skills Count |
25% | Number of skills to update |
| Gateway Restart | 20% | Restart impact |
| Time Since Update | 15% | Hours since last update |
| Cron Proximity | 10% | Distance to next task |
Risk Levels:
- - 🟢 Low (Score <50): Auto-update
- 🟡 Medium (Score 50-74): Warning but auto-update
- 🔴 High (Score ≥75): Requires YOUR approval
User Approval Flow
When risk is High:
- 1. Shows warning with assessment details
- Waits for your confirmation (60s timeout)
- If approved → proceeds with update
- If rejected/skipped → cancels gracefully
Use -AutoApprove for unattended runs.
Smart Notifications
Pre-update (concise):
CODEBLOCK1
Post-update:
CODEBLOCK2
Auto-detects: Telegram, Feishu
Use Cases
- - ✅ Weekly maintenance automation
- ✅ Keep OpenClaw always up-to-date
- ✅ Never interrupt scheduled crawler tasks
- ✅ Get notified of updates
- ✅ Safe auto-updates with risk control
Parameters
| Parameter | Default | Description |
|---|
| AutoUpdate | false | Apply updates automatically |
| SmartTiming |
false | Wait for idle + check cron |
| AutoApprove | false | Skip approval (for cron) |
| NoNotify | false | Skip notifications |
| UpdateSkillsOnly | false | Update skills only |
| Port | auto | Gateway port |
| IdleThreshold | 5 | Minutes of idle to wait |
| CronLookAhead | 60 | Minutes to look ahead for tasks |
| MaxWait | 30 | Max wait time (minutes) |
Requirements
- - PowerShell 5.1+ (pwsh)
- npm + clawhub CLI
- Windows (idle detection)
- Reads:
~/.openclaw/openclaw.json (port only), INLINECODE2
Optional Environment Variables
| Variable | Description |
|---|
| INLINECODE3 | Telegram bot token for notifications |
| INLINECODE4 |
Feishu app ID for notifications |
|
FEISHU_APP_SECRET | Feishu app secret for notifications |
Note: This skill only reads the gateway.port from config. No credentials are transmitted externally.
Tags
auto-update, maintenance, cron, smart-schedule, skills, gateway, restart, healthcheck, monitoring, ops, openclaw, updater, self-maintenance, ai-assessment, user-approval, notification
自更新器
⭐ 唯一支持Cron感知+空闲检测的OpenClaw更新器!
智能自动更新器,在检查更新的同时尊重您的计划任务。
为什么选择此技能?
| 功能 | 其他更新器 | 本技能 |
|---|
| Cron感知 | ❌ | ✅ 避开您的计划任务 |
| 空闲检测 |
❌ | ✅ 等待系统空闲 |
| AI风险评估 | ❌ | ✅ 评估更新影响 |
| 用户审批 | ❌ | ✅ 确认高风险更新 |
| 智能通知 | ⚠️ 基础 | ✅ 简洁,渠道感知 |
功能特性
- - 🔒 Cron感知:读取 ~/.openclaw/cron/jobs.json 以避免干扰您的计划任务
- ⏳ 空闲检测:在更新前等待系统空闲(无中断!)
- 🧠 AI影响评估:在更新前评估风险等级(低/中/高)
- ✅ 用户审批:高风险更新前暂停并询问
- 📲 智能通知:自动检测Telegram/飞书,发送简洁报告
- 🔄 双重更新:同时更新OpenClaw核心和已安装技能
- 🛡️ 自动重启:确保网关在更新后恢复正常运行
- 🌐 端口自动检测:自动从配置中读取网关端口
快速开始
powershell
检查更新
powershell -ExecutionPolicy Bypass -File scripts/self-updater.ps1
智能定时自动更新
powershell -ExecutionPolicy Bypass -File scripts/self-updater.ps1 -AutoUpdate -SmartTiming
全自动化(用于cron)
powershell -ExecutionPolicy Bypass -File scripts/self-updater.ps1 -AutoUpdate -SmartTiming -AutoApprove -Quiet
AI风险评估
评估5个因素以计算风险评分:
| 因素 | 权重 | 描述 |
|---|
| 版本影响 | 30% | 主版本/次版本/补丁 |
| 技能数量 |
25% | 需要更新的技能数 |
| 网关重启 | 20% | 重启影响 |
| 距上次更新时间 | 15% | 距上次更新的小时数 |
| Cron接近度 | 10% | 距下一个任务的间隔 |
风险等级:
- - 🟢 低(评分<50):自动更新
- 🟡 中(评分50-74):警告但自动更新
- 🔴 高(评分≥75):需要您的批准
用户审批流程
当风险为高时:
- 1. 显示包含评估详情的警告
- 等待您的确认(60秒超时)
- 如果批准 → 继续更新
- 如果拒绝/跳过 → 优雅取消
使用 -AutoApprove 进行无人值守运行。
智能通知
更新前(简洁):
🔄 OpenClaw 更新检查
• 核心:1.2.3 → 1.3.0(次版本)
• 技能:3个待更新
• 风险:🟡 中
更新后:
✅ OpenClaw 已更新
• 核心:v1.3.0
• 技能:3个已更新
• 网关:✅ 正常
自动检测:Telegram、飞书
使用场景
- - ✅ 每周维护自动化
- ✅ 保持OpenClaw始终最新
- ✅ 永不中断计划爬虫任务
- ✅ 获取更新通知
- ✅ 带风险控制的安全自动更新
参数
| 参数 | 默认值 | 描述 |
|---|
| AutoUpdate | false | 自动应用更新 |
| SmartTiming |
false | 等待空闲 + 检查cron |
| AutoApprove | false | 跳过审批(用于cron) |
| NoNotify | false | 跳过通知 |
| UpdateSkillsOnly | false | 仅更新技能 |
| Port | auto | 网关端口 |
| IdleThreshold | 5 | 等待空闲的分钟数 |
| CronLookAhead | 60 | 向前检查任务的分钟数 |
| MaxWait | 30 | 最大等待时间(分钟) |
系统要求
- - PowerShell 5.1+(pwsh)
- npm + clawhub CLI
- Windows(空闲检测)
- 读取:~/.openclaw/openclaw.json(仅端口)、~/.openclaw/cron/jobs.json
可选环境变量
| 变量 | 描述 |
|---|
| TELEGRAMBOTTOKEN | 用于通知的Telegram机器人令牌 |
| FEISHUAPPID |
用于通知的飞书应用ID |
| FEISHU
APPSECRET | 用于通知的飞书应用密钥 |
注意: 此技能仅从配置中读取 gateway.port。不会向外部传输任何凭据。
标签
自动更新、维护、cron、智能调度、技能、网关、重启、健康检查、监控、运维、openclaw、更新器、自我维护、AI评估、用户审批、通知