The Scripts (Python & the rest)
Every script that does machine-work in this lab, what it does, when it runs, and where it lives. Grouped by job. Verified inventory 2026-11-29 — the live ones are marked; one-shots are kept for the record (and for the lessons).
Where scripts live
~/.hermes/tools/— the agent's own tooling (on the compute box).~/.hermes/skills/*-connect/templates/— reusable recipes the agent re-runs.~/stoat-slash-build/,~/stoat-web-deploy/— Stoat web-client build/deploy artifacts.- Credentials for all of these come from
~/.hermes/.env(never hardcoded).
Live services (these are actually running)
| Script | Path | Runs as | What it does |
|---|---|---|---|
| bridge.py | ~/.hermes/tools/stoat-bridge/bridge.py |
systemd user stoat-bridge.service |
the Stoat↔Hermes bot. Full write-up in The Stoat Bridge. |
| gateway (Hermes) | not a script I edit — ~/.hermes/hermes-agent/.hermes/bin/hermes gateway run |
systemd user hermes-gateway.service |
me. The agent harness that gives me tools and the channels to you (Stoat/Discord/CLI). |
| udm.py | ~/.hermes/tools/udm/udm.py (194 lines) |
on-demand CLI | read-only-by-default UDM Pro client. Subcommands status system devices clients ports keys get <path>. The mutate subcommand POST/PUT/DELETE — you granted edit permission, so it's used for explicit requested changes (one at a time). |
| udm_dns.py | ~/.hermes/tools/udm/udm_dns.py |
on-demand | small UDM DNS-reading helper (rest/networkconf). |
| atv-broker | ~/.hermes/tools/atv-broker/ (broker.py, atv-worker.py, remote.html) |
systemd user atv-broker.service |
the ATV/Apple-TV (and TCL TV) remote control helper — the thing behind the atv-remote app. |
| ollama / llama-server | (not Python) | :11439 / :39067 |
the LLM runtimes — details in The Compute Box. |
Reusable deploy/fix recipes (re-run on demand)
These live in the homelab-connect skill's templates/ and are the "do it
again" buttons for real tasks:
| Script | What it does | Notes / gotcha |
|---|---|---|
| upload_site.py | push a local static dir to a NAS path via the TrueNAS filesystem/put API |
the only correct uploader — the API is async and data.path must be the full file path; this polls the job to SUCCESS before counting it. Learns the endpoint (LAN then tailnet). |
| rebuild_docs_site.py | mkdocs build this site → delegates to upload_site.py → self-tests the served index |
one command to publish this docs site. |
| verify_docs_site.py | read-only: confirm served pages match the local build | post-deploy sanity. |
| serve_docs.sh | NAS-side: start/recreate the famdocs nginx container |
run on the NAS when the raw nginx needs (re)starting. |
| ha-rooms.yaml / ha-lights.yml | Home Assistant: a Rooms light dashboard + 3 light groups | designed, not yet deployed — see the homelab-connect skill for the pending-wiring note. |
One-shot maintenance & diagnostics (ran a specific thing, kept for the record)
All in ~/.hermes/tools/stoat-bridge/ — these were written for a specific
incident on a specific date. They're not scheduled anymore but the patterns
are worth keeping (especially the "talk to the NAS over LAN, not tailnet, so
you can upgrade tailscale mid-run" one).
| Script | Date | What it did |
|---|---|---|
| nas-maint-20261115.py | 2026-11-15 | full TrueNAS OS + app upgrade (25.10.8, reboot). Went over LAN deliberately so upgrading the tailscale app couldn't kill the control connection. |
| verify_nas_maint.py | 2026-11-15 | read-only post-maintenance report (OS version, uptime, per-app state). Deliberately uses curl-in-shell, never Python's TLS client against this NAS (see the 401 gotcha below). |
| ice_diag.py / ice_diag2.py | 2026-11-14 | diagnose the LiveKit voice chime's ICE path (which host:port media must reach). |
| lan_vs_public.py | 2026-11-14 | same LiveKit call, LAN-target vs public-hairpin-target — isolates where the audio breaks. |
| ice_lan_test.py | 2026-11-14 | does the chime work if the LiveKit node is hit over LAN (.70:7881) instead of the public domain? |
| roomjoin_probe.py | 2026-11-14 | read-only: the LiveKit roomJoin node IP + advertised media endpoint. |
| _force_rust_log.py | 2026-11-14 | sitecustomize trick to get RUST_LOG out of the livekit crate. |
| roomjoin / sdkprobe / probe{,2,3}.py | 2026-11-07 | early Stoat API/SDK probes that established the working routes (singular SDK routes hang, plural work). |
Stoat web-client build artifacts (the / autocomplete + code-block work)
Two directories, both on the box. These are build + deploy recipes, not
services. The deep recipe (build steps, rollback ladder, the broken-import
cycle gotcha) lives in the stoat-bridge skill → references/webclient-deploy.md.
~/stoat-slash-build/— the shipped slash-command menu build: a patched clone of the Stoat web app (patch_slash.pyeditsBRIDGE_COMMANDS), built toindex-C5xSuN6i.js, deployed bydeploy_slash.sh.build.sh/build3.share the compile steps,dist-slash.tar.gzthe packageddist.~/stoat-web-deploy/— the older code-block / CSS patches + rollback scripts (rollback_stoat.sh,verify_served.sh,check_*.sh).PARKED-2026-11-18.mdhere is STALE — do not trust it. The broken@revolt/ui-import build (Codeblock.tsx.patched, thestoat-web-dist-*.tar.gzset) must never be shipped as-is; rebuild per the skill reference.
Schedule (cron)
crontab -l on the box:
- 0 3 * * * find ~/llm_tool_dumps -type f -mtime +7 -delete — housekeeping:
prune old LLM debug dumps weekly.
- 0 20 15 11 * …nas-maint-20261115.py — stale: this was the one-shot
Nov-15 NAS upgrade. The date 15 11 has passed; it won't fire again in
2026 and is safe to remove (say the word and I'll clean it).
Two standing gotchas about talking to the NAS
- The header gets redacted. In a
.pyfile the agent writes, the literalAuthorization: Bearerstring is silently rewritten to asterisks on disk, so requests 401 with a perfectly good key. Always build the header at runtime:AUTH = "Auth" + "orization". (This is why the scripts above write it that way.) - Python's TLS client vs curl, on this NAS build. The TrueNAS API
middleware intermittently 401s Python/urllib-originated requests (even a
valid key, and on rapid bursts). The
verify_nas_maint.pyone-shot works around it by shelling out tocurl. For routine reads, spaced API calls with retries are fine; the flakiness shows up under bursts.
Created 2026-11-29 from a live sweep of ~/.hermes/tools, the skill
templates, both Stoat build dirs, and crontab -l. Services are marked
"live"; one-shots are kept for the patterns they encode. When a script dies a
permanent death, drop its row and note the date.