infra/docs/adr
Viktor Barzin 48225f2dea homelab CLI v0.7: add ha token + ha ssh for Home Assistant
Mined another devvm user's Claude sessions for repeated, hand-rolled command
patterns worth absorbing into the shared CLI. The dominant signal was Home
Assistant "Sofia" work: a `kubectl | base64 | jq` token-extraction pipeline
re-derived ~420x, and a bespoke non-interactive `ssh -o …` invocation reinvented
~30x — every session. The existing `home-assistant-sofia.py` already covers the
API but goes unused from an arbitrary cwd (needs an env var set + a cwd-relative
path), so agents bypassed it and hand-rolled everything.

Add two verbs covering exactly the gaps the `ha` MCP can't (entity state/control
stays with the MCP):
- `ha token [--instance sofia|london]` (read): resolves the long-lived API token
  live from k8s secret openclaw/openclaw-secrets via the ambient kubeconfig — no
  pre-set env var. Composes as `curl -H "Authorization: Bearer $(homelab ha token)"`.
- `ha ssh [--instance sofia|london] -- <cmd>` (write): deterministic
  non-interactive ssh to the HA host using the invoking user's key.

Also fix the root cause: `home-assistant-sofia.py` now falls back to
`homelab ha token` when its env var is unset (works from any directory), and the
home-assistant skill points agents at these verbs + `homelab metrics query`
instead of hand-rolled curls. README + ADR-0012 + AGENTS.md updated per the
per-verb-group convention.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-20 23:46:09 +00:00
..
0001-android-emulator-in-cluster.md android-emulator: new stack — shared in-cluster Android 16 testing instance 2026-06-11 19:51:57 +00:00
0002-all-image-builds-off-infra-gha-ghcr.md docs: ADR-0002 — all owned image builds move off-infra to GHA + ghcr [ci skip] 2026-06-12 19:55:47 +00:00
0003-keep-forgejo-canonical-complete-mirror.md docs(adr-0003): keep Forgejo canonical, complete the GitHub mirror (reject swap) 2026-06-15 21:32:28 +00:00
0004-homelab-unified-cli.md homelab: v0.1 docs, distribution wiring, and version 2026-06-18 19:25:51 +00:00
0005-homelab-v01-scope.md homelab: v0.1 docs, distribution wiring, and version 2026-06-18 19:25:51 +00:00
0006-homelab-work-and-tf.md homelab: v0.1 docs, distribution wiring, and version 2026-06-18 19:25:51 +00:00
0007-homelab-k8s-verbs.md homelab: v0.2.0 — docs + version for the k8s verb-group 2026-06-18 22:30:41 +00:00
0008-homelab-memory-verbs.md homelab: add memory verb-group (v0.3.0) — direct claude-memory HTTP client 2026-06-19 05:56:25 +00:00
0009-homelab-ci-deploy-verbs.md homelab: v0.4.0 — ci/deploy verbs (watch what you trigger) 2026-06-19 10:59:14 +00:00
0010-homelab-net-obs-verbs.md homelab: v0.5.0 — net/dns/metrics/logs probes (endpoint resolution) 2026-06-19 11:27:31 +00:00
0011-homelab-usage-telemetry.md homelab: v0.6.0 — usage telemetry (usage top), evidence-driven verb prioritization 2026-06-19 22:29:01 +00:00
0012-homelab-ha-verbs.md homelab CLI v0.7: add ha token + ha ssh for Home Assistant 2026-06-20 23:46:09 +00:00