Skip to content

Commit d0985b6

Browse files
committed
feat(hass-cli): add hass-cli with zsh autocompletion
1 parent 3b08430 commit d0985b6

File tree

5 files changed

+21
-0
lines changed

5 files changed

+21
-0
lines changed

.config/hass-cli/.placeholder

Whitespace-only changes.

.config/zsh/alias.d/05-home.alias

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
alias ha="hass-cli"

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
.config/asciinema/install-id
22
.config/dotfiles/first_run
33
*.kdbx
4+
.config/hass-cli/token

.local/bin/hass-cli

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/usr/bin/env bash
2+
3+
podman container run \
4+
--rm \
5+
--name hass-cli \
6+
--network=host \
7+
-e HASS_SERVER="https://crazybyte.duckdns.org" \
8+
-e HASS_TOKEN=$(cat ~/.config/hass-cli/token) \
9+
-e _HASS_CLI_COMPLETE \
10+
-e COMP_WORDS \
11+
-e COMP_CWORD \
12+
-e _HASS_CLI_COMPLETE \
13+
localhost/hass-cli:local $*

.zshrc

+6
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,12 @@ autoload -Uz custom_colors # load ~/.config/zsh/dir_colors
176176
custom_colors
177177
######
178178

179+
### hass-cli autocompletion ###
180+
# https://github.com/home-assistant-ecosystem/home-assistant-cli#auto-completion
181+
# Needs to be run after compinit is loaded
182+
eval "$(_HASS_CLI_COMPLETE=zsh_source hass-cli)"
183+
######
184+
179185
### LOAD PLUGINS ###
180186
# zsh-syntax-highlighting
181187
# https://github.com/zsh-users/zsh-syntax-highlighting

0 commit comments

Comments
 (0)