Skip to content

servas-ai/openclaw-update-scripts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

15 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

OpenClaw

🦞 OpenClaw Update Scripts

Automated package monitoring Β· AI-powered changelogs Β· One-click updates

Never miss a package update again. Get Telegram & Matrix notifications with AI-summarized changelogs and inline update buttons.

Bash 5.0+ Node.js Tests 68 Suites AI Channels License


πŸ’¬ What You Get

A cron job watches your system for package updates. When one is found, you receive a rich notification like this:

πŸ”” Update verfΓΌgbar (14.03.2026 13:02)
━━━━━━━━━━━━━━━━━━━━━━━━━

πŸ“¦ 3 Update(s) gefunden:

β€’ openclaw: 2026.3.2 β†’ 2026.3.11
  πŸ“‹ Neues Plugin-System fΓΌr benutzerdefinierte Erweiterungen
  πŸ“‹ Verbesserte CLI-Performance bei großen Workspaces
  πŸ“‹ Bugfix fΓΌr Matrix-Nachrichtenformatierung

β€’ @anthropic-ai/claude-code: 2.1.74 β†’ 2.1.75
  πŸ“‹ Verbesserter Context-Handling bei großen Dateien
  πŸ“‹ Neuer --resume-Session-Flag
  πŸ“‹ Fehlerbehebung: Workspace-Watch bei Symlinks

β€’ npm: 11.2.0 β†’ 11.3.0
  πŸ“‹ Schnellere Installationen durch parallelen Downloads
  πŸ“‹ Neue `npm query` Selektoren
  πŸ“‹ Sicherheitsfix fΓΌr Paket-SignaturprΓΌfung

━━━━━━━━━━━━━━━━━━━━━━━━━
Soll i updaten?

[βœ… Alle updaten] [❌ Nein, danke]
[πŸ“¦ openclaw] [πŸ“¦ claude-code] [πŸ“¦ npm]

πŸ“‹ The 3 bullet points are AI-generated β€” real changelog content, summarized by an LLM into concise German points.


✨ Features

πŸ”” Smart Notifications

Telegram + Matrix with deduplication β€” repeated checks don't spam. Changed packages trigger re-notification automatically.

πŸ€– AI-Powered Changelogs

Fetches release notes from GitHub Releases and npm, then summarizes into 3 bullet points via OpenClaw AI. Falls back to raw data if AI is unavailable.

πŸ“¦ Auto-Discovery

Detects newly-installed global npm packages automatically. No manual watchlist maintenance needed.

πŸ”„ Multi-Channel

Send to Telegram, Matrix, or both simultaneously.

πŸ›  Auto-Heal

Self-repairs on critical version lookup failures. Triggers update runner automatically with a 6-hour cooldown.

⚑ Performance-Optimized

Single npm ls -g call cached globally β€” avoids spawning 32+ subshells. Batched jq writes, cached timeout checks.

πŸ§ͺ 299 Tests (68 Suites)

Comprehensive mocked E2E tests covering unit, integration, and 15 edge case scenarios β€” from corrupted JSON to AI failover.

πŸ€– AI-Agent Ready

Includes SKILL.md β€” lets AI agents install, configure, and operate the system autonomously.


πŸ”„ How It Works

flowchart LR
    subgraph "⏰ Every 30 min"
        A["πŸ• Cron Trigger"] --> B["πŸ“‘ sync_watchlist_npm\n(auto-discover packages)"]
    end

    subgraph "πŸ” For each package"
        B --> C["πŸ“¦ npm_global_current_version\n(cached)"]
        C --> D["🌐 npm_latest_version\n(registry lookup)"]
        D --> E{"πŸ”€ Update\navailable?"}
    end

    subgraph "πŸ“ Changelog Pipeline"
        E -->|"βœ… Yes"| F["πŸ“š gather_raw_changelog\n(GitHub + npm)"]
        F --> G{"πŸ€– AI\nenabled?"}
        G -->|"Yes"| H["🧠 ai_summarize_changelog\n(3 bullet points)"]
        G -->|"No"| I["πŸ“„ build_raw_points\n(raw extraction)"]
        H -->|"Fail"| I
        H -->|"OK"| J["πŸ”” Build notification"]
        I --> J
    end

    subgraph "πŸ“€ Delivery"
        J --> K{"πŸ” Dedup\ncheck"}
        K -->|"New"| L["πŸ“¨ Send via\nTelegram / Matrix"]
        K -->|"Same"| M["πŸ”‡ Exit silently"]
    end

    E -->|"❌ No"| N["⏭️ Next package"]

    style A fill:#f9f,stroke:#333
    style L fill:#4CAF50,stroke:#333,color:#fff
    style M fill:#9E9E9E,stroke:#333,color:#fff
    style H fill:#7C4DFF,stroke:#333,color:#fff
Loading

Step-by-Step Flow

Step What Happens Code
1 Cron triggers check-updates-notify.sh cron/check-updates-notify.sh
2 Auto-discover new global npm packages sync_watchlist_npm()
3 For each watchlisted package: check current vs. latest version npm_global_current_version() β†’ npm_latest_version()
4 If update found: fetch changelogs from GitHub Releases + npm gather_raw_changelog()
5 Summarize with AI (or fall back to raw extraction) ai_summarize_changelog() β†’ build_raw_points()
6 Build rich notification with inline buttons format_update_message() + build_buttons_json()
7 Dedup: skip if same payload was already sent Compare to STATE_FILE
8 Send via Telegram / Matrix / both send_to_all_channels()

πŸš€ Quick Start

# 1. Clone the repo
git clone https://github.com/servas-ai/openclaw-update-scripts.git
cd openclaw-update-scripts

# 2. Make scripts executable
chmod +x cron/*.sh scripts/*.sh

# 3. Configure your messaging channel
export CHANNEL="telegram"
export CHAT_ID="-1003766760589"
export THREAD_ID="16"

# 4. Dry-run test (prints notification without sending)
DRY_RUN=1 FORCE_NOTIFY=1 bash cron/check-updates-notify.sh

# 5. Run the test suite
bash scripts/e2e-update-check-validation.sh
# Expected: βœ… ALL TESTS PASSED: 299/299

# 6. Set up cron (check every 30 min)
(crontab -l 2>/dev/null; echo "*/30 * * * * cd $(pwd) && bash cron/check-updates-notify.sh") | crontab -

πŸ“¦ Package Types

Type Source Auto-Discovery Example
npm npm ls -g βœ… Automatic openclaw, @anthropic-ai/claude-code
snap snap refresh --list ❌ Manual chromium, snapd
go Binary version check ❌ Manual gt

Watchlist (cron/update-watchlist.json)

{
  "npm": ["openclaw", "@anthropic-ai/claude-code", "npm", "vibe-kanban"],
  "npm_exclude": ["create-better-openclaw"],
  "snap": ["chromium", "snapd"],
  "go": ["gt"]
}

npm_exclude β€” packages that should never be auto-added to the watchlist, even if installed globally.


βš™οΈ Configuration

Environment Variables

Variable Default Description
CHANNEL telegram telegram, matrix, or both
CHAT_ID -1003766760589 Telegram Chat-ID or Matrix Room ID
THREAD_ID 16 Telegram Forum Thread (0 = disabled)
DRY_RUN 0 Print to stdout only β€” no messages sent
FORCE_NOTIFY 0 Send even if nothing changed (bypass dedup)
πŸ”§ Advanced Variables
Variable Default Description
AI_SUMMARIZE auto AI changelogs: auto, 1 (always), 0 (never)
AI_SUMMARIZE_TIMEOUT 30 Max seconds to wait for AI response
SAFE_TIMEOUT_SEC 30 Timeout per npm view lookup
AUTO_HEAL_ENABLED 1 Auto-repair on critical failures
AUTO_HEAL_COOLDOWN_SEC 21600 Min seconds between auto-heals (6h)
TELEGRAM_NOTIFY 1 Send completion report after updates
WATCHLIST_FILE cron/update-watchlist.json Path to watchlist JSON
OPENCLAW_BIN auto-detect Explicit OpenClaw binary path

πŸ€– AI Changelog Summarization

When a package has an update, the system:

  1. Fetches release notes from GitHub Releases API (last 40 releases, filtered to the upgrade range)
  2. Adds npm package description and changelog metadata
  3. Summarizes everything into exactly 3 German bullet points via openclaw agent --local
  4. Falls back to raw changelog extraction if AI is unavailable or too slow

Setup

# Configure any OpenAI-compatible API
openclaw config set models.providers.my-api.baseUrl "https://api.example.com/v1"
openclaw config set models.providers.my-api.apiKey "sk-..."
openclaw config set models.providers.my-api.api "openai-completions"
openclaw config set models.default "my-api/gpt-4o-mini"

No AI? No problem.

Set AI_SUMMARIZE=0 β€” the system will extract raw changelog points from GitHub Releases and npm descriptions instead.


πŸ“ Project Structure

openclaw-update-scripts/
β”‚
β”œβ”€β”€ lib/
β”‚   └── common.sh                  # 🧠 Shared library (730+ lines)
β”‚       β”œβ”€β”€ Version comparison       #    sort -V based comparison
β”‚       β”œβ”€β”€ Safe execution           #    timeout + retry + login shell
β”‚       β”œβ”€β”€ npm cache                #    Global cache, avoids 32+ subshells
β”‚       β”œβ”€β”€ Messaging                #    Telegram / Matrix via OpenClaw CLI
β”‚       β”œβ”€β”€ Changelog pipeline       #    GitHub Releases + npm + AI summary
β”‚       β”œβ”€β”€ Package discovery        #    Auto-detect new global packages
β”‚       β”œβ”€β”€ Watchlist sync           #    Batched jq write (single call)
β”‚       └── Update runner            #    Shared update logic for all runners
β”‚
β”œβ”€β”€ cron/
β”‚   β”œβ”€β”€ check-updates-notify.sh    # πŸ”” Main script: check β†’ notify
β”‚   β”œβ”€β”€ run-all-updates.sh         # πŸ“¦ Update all (via subagent)
β”‚   β”œβ”€β”€ run-all-updates-direct.sh  # πŸ“¦ Update all (direct execution)
β”‚   β”œβ”€β”€ run-all-updates-via-subagent.sh  # πŸ€– Delegates to AI subagent
β”‚   β”œβ”€β”€ auto-update-all.sh         # ⚑ Auto-update core packages
β”‚   └── update-watchlist.json      # πŸ“‹ Package watchlist
β”‚
β”œβ”€β”€ scripts/
β”‚   β”œβ”€β”€ e2e-update-check-validation.sh  # πŸ§ͺ 299 mocked tests (68 suites)
β”‚   β”œβ”€β”€ docker-e2e-test.sh         # 🐳 Docker E2E test (60 assertions)
β”‚   └── run-docker-e2e.sh          # 🐳 Docker test runner
β”‚
β”œβ”€β”€ SKILL.md                       # πŸ€– AI-agent skill instructions
β”œβ”€β”€ INSTALL.md                     # πŸ“– Step-by-step setup guide
β”œβ”€β”€ Dockerfile.e2e                 # 🐳 E2E test container
└── README.md                      # πŸ“„ This file

πŸ§ͺ Testing

Test Commands

# Mocked E2E tests β€” 299 tests across 68 suites, no network
bash scripts/e2e-update-check-validation.sh
# βœ… ALL TESTS PASSED: 299/299

# Docker E2E β€” full environment test
bash scripts/run-docker-e2e.sh
# βœ… ALL TESTS PASSED: 60/60

# Live dry-run β€” real network, no messages sent
DRY_RUN=1 FORCE_NOTIFY=1 bash cron/check-updates-notify.sh

What's Tested

Category Suites Examples
Core Functions 22 version_gt, json_escape, normalize_version, shorten_line
npm Integration 12 Version lookup, cache, discovery, exclude, scoped packages
Messaging 8 send_message, send_message_json, channel routing, buttons
Notification Logic 8 Dedup, force-notify, format_update_message, build_buttons_json
Update Runner 5 update_npm_if_needed (success, current, skip, fail), run_with_retry
Edge Cases 13 Corrupted JSON, malformed npm, AI failover, all-lookups-fail, ...

πŸ›‘οΈ Auto-Heal

When critical version lookups fail (e.g., npm registry unreachable), the system:

  1. Detects the failure and logs it as critical_lookup_failure
  2. Generates a unique signature for the issue (deduplicates triggers)
  3. Cooldown check β€” won't re-trigger within 6 hours for the same issue
  4. Launches either the AI subagent runner or direct fallback runner
  5. Sends a special notification with affected packages and log path
πŸ›  Auto-Heal aktiv (14.03.2026 13:05)
━━━━━━━━━━━━━━━━━━━━━━━━━

Kritischer Version-Lookup-Fehler erkannt.
Reparatur-Task wurde automatisch gestartet.

β€’ Betroffen: openclaw:latest,npm:current
β€’ Status: Auto-Heal gestartet via subagent
β€’ Log: /tmp/openclaw-auto-heal.log

πŸ€– AI Agent Integration

This project includes SKILL.md β€” a machine-readable instruction file for AI agents:

  • πŸ“‹ Prerequisites checklist with verify commands
  • πŸ”§ 9-step installation with βœ… Verify per step
  • πŸ“š 30+ function API reference with signatures
  • πŸ”„ Complete data flow explanation
  • πŸ›  Modification guide (add new package manager, channel, etc.)
  • ⚠️ Troubleshooting table for common issues

AI agents (OpenClaw, Codex, Claude, etc.) should read SKILL.md first for full context.


πŸ“– Full Setup Guide

See INSTALL.md for the complete installation walkthrough:

  • βœ… Verification command after each step
  • πŸ“‹ Prerequisites check/install table
  • πŸ”‘ 3 model provider options (custom proxy, OpenAI, no AI)
  • πŸ€– Custom agent configuration with system prompts
  • ⏰ Cron setup + Matrix integration
  • πŸ”§ Troubleshooting table

πŸ“„ License

MIT β€” see LICENSE for details.

Built with 🦞 by servas-ai

About

Standalone update scripts for OpenClaw workflows

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages