HA GitOps AI Manager is a Home Assistant custom repository that provides controlled GitHub-based versioning, backup, pull/push workflows, rollback safeguards, and AI-agent-friendly configuration management for Home Assistant /config.
For Home Assistant OS/Supervised, the most reliable architecture is: add-on plus custom panel.
- A pure custom integration cannot reliably guarantee git binary access and all filesystem/process privileges on every HA OS deployment.
- The add-on provides a stable execution runtime with git + Python tooling and controlled
/configaccess. - The companion custom component provides native Home Assistant services and a sidebar panel (
GitOps AI) while optionally proxying to add-on APIs.
This repository therefore ships both:
custom_components/ha_gitops_aicompanion integration + panel.addons/ha_gitops_ai_manageradd-on backend runtime.
- Connect private GitHub repo (token or SSH) with branch + commit identity.
- Initialize or attach repo for
/configor selected subfolder. - Status: branch, remote, last commit, dirty state, changed files, ahead/behind.
- Manual actions: status, commit, push, fetch, pull, diff, restore file, rollback.
- Safety actions: backup before pull/rollback, config validation, confirmation gates.
- Scheduler: push/fetch/pull/full-cycle with quiet hours and pause toggle.
- Safe mode/lab mode.
- AI Agent Mode: generate
AGENTS.md, prompt files, issue/pr templates. - Protected file handling with warnings and security-focused defaults.
- Add this repo URL in HACS (Integration category).
- Install HA GitOps AI Manager.
- Restart Home Assistant.
- Add integration from Settings → Devices & Services.
- Open sidebar panel GitOps AI.
- Add this repository as an Add-on repository.
- Install add-on HA GitOps AI Manager Backend.
- Configure add-on options (branch, config path, credential mode).
- Start add-on and enable watchdog/auto-start if desired.
- Overview
- Changes
- History
- Push/Pull
- Schedule
- AI Agent Mode
- Protected Files
- Settings
- Logs
- Never logs raw GitHub token or SSH private key.
- Warns if tracked files include
secrets.yamlor sensitive.storageentries. - No force push/hard reset by default.
- Pull/rollback can require backup + explicit confirmation.
- Dry-run options supported for pull preview.
- Configure repo URL + credentials.
- Initialize git for
/config(or selected subfolder). - Check status and review changed files.
- Commit + push local HA changes.
- Let Codex/AI modify repo remotely via controlled rules.
- Fetch + diff + validate + pull approved changes back into HA.
Use the AI Agent Mode page or service to generate:
AGENTS.md- prompts under
.github/prompts/ - issue templates
- pull request template
These templates enforce HA-safe editing rules (no secret edits, preserve entity IDs, validate YAML, modular dashboards, etc.).
- If
gitcommands fail in integration mode, run via add-on backend mode. - If push fails with auth, rotate token and reconfigure credentials.
- If pull fails validation, inspect diff and run HA config check manually.
- If scheduler is paused unexpectedly, verify quiet-hours window and pause toggle.
- Python backend in
custom_components/ha_gitops_ai/gitops_manager.py. - Frontend panel in
custom_components/ha_gitops_ai/panel/. - Add-on backend in
addons/ha_gitops_ai_manager/rootfs/usr/src/app/.