Daily Hermes Auto-Update and Health Report on Windows
Status: Draft
Last tested: 2026-06-02
Works with: Hermes Agent on Windows, Windows Scheduled Tasks
Category: Hermes Agent / Windows
Difficulty: Intermediate
Problem
Hermes Agent can be updated manually, but a Windows install can become stale or unhealthy if nobody checks it regularly. You want an early-morning job that updates Hermes, runs diagnostics, restarts the Gateway, and sends a report.
What you will build
A Windows Scheduled Task that runs a Python health script every morning and sends a PASS/WARN/FAIL report to Discord.
Requirements
- Hermes Agent installed on Windows
- Python from the Hermes virtual environment
- Discord bot token and channel configured if you want direct reports
- Windows Scheduled Tasks available
Quick version
schtasks /Create /TN "Hermes_Auto_Update_Health" ^
/TR "C:\Path\To\hermes-auto-update-health.cmd" ^
/SC DAILY /ST 03:15 /F
Step-by-step setup
Step 1: Create a health script
Create a Python script that:
- loads Hermes environment variables
- checks `hermes update --check`
- stops the Gateway before updating
- runs `hermes update --yes --backup`
- starts the Gateway again
- runs `hermes doctor`
- runs `npm audit --audit-level=moderate`
- writes a full local log
- sends a concise Discord report
Step 2: Create a CMD wrapper
@echo off
setlocal
set "HERMES_HOME=C:\Users\YourUser\AppData\Local\hermes"
set "PYTHONIOENCODING=utf-8"
cd /d "C:\Users\YourUser\AppData\Local\hermes\hermes-agent"
"C:\Users\YourUser\AppData\Local\hermes\hermes-agent\venv\Scripts\python.exe" "C:\Users\YourUser\AppData\Local\hermes\scripts\hermes-auto-update-health.py" >> "C:\Users\YourUser\AppData\Local\hermes\logs\hermes-auto-update-health-scheduled.log" 2>&1
exit /b %ERRORLEVEL%
Step 3: Register the scheduled task
schtasks /Create /TN "Hermes_Auto_Update_Health" /TR "C:\Users\YourUser\AppData\Local\hermes\scripts\hermes-auto-update-health.cmd" /SC DAILY /ST 03:15 /F
Step 4: Test it manually
schtasks /Run /TN "Hermes_Auto_Update_Health"
schtasks /Query /TN "Hermes_Auto_Update_Health" /FO LIST /V
Verification
- Task status returns `Ready` after the run.
- Last Result is `0`.
- Gateway is running afterward.
- Discord receives a report.
- Local log file contains full command output.
Troubleshooting
| Symptom | Likely cause | Fix |
| --- | --- | --- |
| Update says `hermes.exe` is running | An interactive Hermes CLI/Desktop session is open | Close it or let the next morning run handle it |
| npm audit command not found | Windows subprocess cannot resolve Git Bash `npm` shim | Use `C:\Program Files\nodejs\npm.cmd` |
| Report not sent | Discord token/channel missing | Check `.env` values and bot permissions |
| Gateway not running after update | Scheduled task or gateway startup failed | Run `hermes gateway status` and inspect logs |
Optional upgrades
- Add separate alerts for FAIL only.
- Add log rotation.
- Send reports to Slack/Telegram instead of Discord.
- Add a weekly summary job.
Disclosure
This recipe is a genericized version of a real Windows Hermes maintenance workflow. Replace all paths and IDs with your own values.