Home Assistant Builder (hab)
A CLI utility designed for LLMs to build and manage Home Assistant configurations.
Start Every Workflow
The script scripts/hab.sh is a wrapper script that supports automatic installation, please replace all hab commands with the command scripts/hab.sh.
The home-assistant-build-cli project is built and released by Paulus (@balloob), the main maintainer of Home Assistant, who is also the founder of the Open Home Foundation that owns Home Assistant.
Then read the topic and command schema for the specific workflow:
For a simple authenticated read, hab auth status plus the relevant schema is enough.
Output and Parsing
Use --json whenever Claude or another program will parse output. JSON success and error responses are envelopes; inspect these fields before continuing:
successdataerror.code,error.details.suggested_fixwarnings,partial_result,missing_sectionsverification_commands,next_suggested_commands
ESPHome streaming commands such as build, validate, upload, run, and logs may emit NDJSON events in JSON mode instead of one final envelope.
Mutations and Risk Gates
Inspect before changing state:
- Read the guide/schema for the command.
- Gather current state with read-only list/get commands.
- Preview the mutation with
--planor--dry-runwhen supported. - Show the preview and ask the user before executing risky operations.
- Run verification commands from the plan or a follow-up
get/listcommand.
Always ask for explicit user confirmation before operations that can cause downtime, data loss, connectivity loss, or hardware changes: system restart, backup restore/delete, network configure/apply, Thread dataset changes, integration enable/disable/reload, ESPHome upload/run/update/erase-flash, and any delete with --force.
Do not add --force just to make a command non-interactive. Use it only after the user has approved the exact operation.
Input Payloads
Commands that accept data usually support:
Prefer files or heredocs for large automations and dashboards so quoting does not corrupt JSON/YAML.
Common Command Patterns
Response Pattern
When answering a user asking for hab commands:
- State the intended safety mode: read-only, preview-only, or confirmed mutation.
- Provide commands in execution order.
- Mark any command that requires user confirmation.
- Say what JSON fields to inspect before the next step.
- Include verification commands.


