← Back to tools

Home Assistant CLI

Command-line tool for Home Assistant

smart-home linuxmacoswindows Python Apache-2.0

Description

Home Assistant CLI (hass-cli) is a command-line tool for interacting with local or remote Home Assistant instances. It enables management of entities, services, events, devices, and areas directly from the terminal. Supports multiple output formats including JSON, YAML, table, and NDJSON, with shell autocompletion and custom column definitions for tabular output.

Install

pippip install homeassistant-cli
homebrewbrew install homeassistant-cli
dnfsudo dnf -y install home-assistant-cli
nixnix-env -iA nixos.home-assistant-cli

AI Summary

Command-line interface for managing Home Assistant instances, including entity state management, service calls, event monitoring, and device/area registry operations.

Capabilities

  • + List, get, edit, and track history of entity states
  • + Discover and call Home Assistant services
  • + Subscribe to and monitor events
  • + Manage device and area registries
  • + Render Jinja2 templates (server-side and client-side)
  • + Interact with Home Assistant Supervisor
  • + Configurable output formats (JSON, YAML, table, NDJSON)

Use When

  • You want to manage Home Assistant from the terminal
  • You need to script Home Assistant automation tasks
  • You want to quickly check entity states or trigger services
  • You need to integrate Home Assistant into shell pipelines

Avoid When

  • x You need the full Home Assistant dashboard experience
  • x You don't have a Home Assistant instance running

Usage Patterns

List all entities

hass-cli state list

Lists all entity states from your Home Assistant instance

Get a specific entity state

hass-cli state get light.living_room

Retrieves the current state of a specific entity

Call a service

hass-cli service call light.turn_on --arguments entity_id=light.living_room

Calls a Home Assistant service with arguments

View AGENTS.md for Home Assistant CLI