Skip to content

Home Assistant Terminal Assistant: A lightweight CLI tool that lets you interact with your Home Assistant voice-pipeline directly from the terminal. Use the global ha command to send intents or chat interactively with your home automation setup.

Notifications You must be signed in to change notification settings

orangecoding/ha-terminal-assistant

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Home Assistant Terminal Assistant 🤖

Talk to your Home Assistant from your Terminal. This tiny CLI lets you connect to your Voice pipeline of Home Assistant, send intents, and chat interactively, right from the command line. Once registered, the ha command is available everywhere on your machine.

To be able to chat with your Home Assistant, you first have to set up a working voice pipeline in Home Assistant itself. There is plenty of documentation on official Home Assistant website.

Demo

Demo

Getting started

Prerequisites:

  • Node.js (v22 or higher)
  • A working voice assistant pipeline in Home Assistant

Follow these steps:

  1. Clone the repo
git clone https://github.com/orangecoding/ha-terminal-assistant.git cd ha-terminal-assistant 
  1. Configure your environment
  • Copy the example file and edit the values:
cp .env.example .env 
  • Open .env and set your details:
# Required HATOKEN=your-long-lived-access-token HAURL=192.168.123.45:8123 # host:port of your Home Assistant # Optional: choose your package manager (auto-detects if omitted) # One of: pnpm | yarn | npm RUNTIME=pnpm 
  1. Register the CLI globally Use whichever package manager you prefer (or have installed). Any of these will work:
# Using pnpm pnpm run register # Using npm npm run register # Using yarn yarn run register 

This does two things:

  • Exposes the ha command globally
  • Stores your project root path so ha knows where to run from
  1. Use it from anywhere From any directory on your machine, run:
ha connect 

You can also pass a one‑off prompt directly:

ha connect "turn on the living room light" 

Or stay in interactive mode and just type away. exit quits.

Notes & Tips

  • Token safety: your HATOKEN grants API access — keep .env private.
  • Runtime choice: set RUNTIME in .env to lock to pnpm, yarn, or npm. If not set, the tool auto‑detects (pnpm → yarn → npm).
  • Yarn v1 users: if you’re on Yarn classic, register handles the global install using an absolute file: path to avoid version quirks.
  • Need to re‑register? Just run the relevant run register command again.

Troubleshooting

  • “Project root variable is not set” when running ha:
    • Run the register step again (pnpm/npm/yarn run register). Restart your shell (or source ~/.zshrc) if needed.
  • “Runtime Not Found” block:
    • Install one of: pnpm, yarn, or npm, or set RUNTIME in your .env to one that you have installed.

Built with ❤️ by Christian Kellner

About

Home Assistant Terminal Assistant: A lightweight CLI tool that lets you interact with your Home Assistant voice-pipeline directly from the terminal. Use the global ha command to send intents or chat interactively with your home automation setup.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published