Home Assistant CLI Ops (hass-cli)
Use this skill for direct remote operations against a Home Assistant instance through hass-cli.
This skill is for interactive CLI operations.
- For scripted/bulk plan→apply→rollback workflows, use:
homeassistant-ops/SKILL.md - For automation and YAML design decisions, use:
home-assistant-best-practices/SKILL.md - If task scope is unclear, route first with:
homeassistant-router/SKILL.md
When to Use
Use when you need to:
- Inspect runtime state quickly (
state,entity,device,area) - Trigger or toggle behavior immediately (
service call,state toggle) - Watch events live for debugging (
event watch) - Use API endpoints not covered by high-level commands (
raw get/post/ws)
Do not use this as your only tool for high-risk bulk refactors. Switch to homeassistant-ops for that.
Setup
Prefer environment variables over command-line secrets:
export HASS_SERVER="http://homeassistant.local:8123"
export HASS_TOKEN="<long-lived-access-token>"
Your local alias is expected:
hass-cli --help
Default Safety Workflow (read -> scope -> write -> verify)
- Read first:
info,config release,state list,entity list - Scope tightly: filter by entity/service/domain before changing anything
- Apply one change: one service call / one state toggle / one assignment
- Verify outcome:
state get+event watch <event_type>if needed - Only then batch: repeat in small groups after first success
Command Reference
Use the focused command guide in:
references/command-cheatsheet.md
This keeps SKILL.md short while preserving copy-paste-ready commands for common tasks.
Common Mistakes
- Passing tokens directly via
--tokenin shell history. - Writing first, reading later.
- Running broad
--matchoperations without previewing list output. - Treating
state editas persistent config management (it is runtime state manipulation).
Command Discovery
When unsure, inspect command tree first:
hass-cli --help
hass-cli <command> --help
hass-cli <command> <subcommand> --help
Related Skills
ai/files/packages/platform/skills/homeassistant/homeassistant-ops/SKILL.mdai/files/packages/platform/skills/homeassistant/home-assistant-best-practices/SKILL.md
Upstream Sources
- home-assistant-cli README.rst: https://github.com/home-assistant-ecosystem/home-assistant-cli/blob/dev/README.rst
- home-assistant-cli repository: https://github.com/home-assistant-ecosystem/home-assistant-cli