diff --git a/.github/workflows/linter-full.yml b/.github/workflows/linter-full.yml index 13baa46..c9d4710 100644 --- a/.github/workflows/linter-full.yml +++ b/.github/workflows/linter-full.yml @@ -6,7 +6,7 @@ on: push: branches: main -permissions: { } +permissions: {} jobs: build: diff --git a/.github/workflows/linter-pr.yml b/.github/workflows/linter-pr.yml index 843b0d5..b571f0d 100644 --- a/.github/workflows/linter-pr.yml +++ b/.github/workflows/linter-pr.yml @@ -6,7 +6,7 @@ on: pull_request: branches: main -permissions: { } +permissions: {} jobs: build: diff --git a/README.md b/README.md index 6050508..758cf29 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ # hctl + hctl is a tool to control your Home Assistant (and maybe more in the future) devices from the command line ## Features @@ -13,16 +14,21 @@ hctl is a tool to control your Home Assistant (and maybe more in the future) dev ## Install ### Go + ```bash go install github.com/xx4h/hctl@latest ``` ## Configuration + Run the init command + ```bash hctl init ``` + or copy the example config from this project + ```bash # Configure Hub hub: @@ -30,13 +36,16 @@ hub: url: https://home-assistant.example.com/api token: YourToken ``` + ensure the folder does already exist and edit with your favorite editor + ```bash mkdir -p ~/.config/hctl $EDITOR ~/.config/hctl/hctl.yaml ``` To really benefit from all features, ensure you've loaded the bash completion + ```bash # Bash (e.g. your ~/.bashrc) type hctl >/dev/null 2>&1 && source <(hctl completion bash) @@ -54,7 +63,9 @@ hctl toggle some_switch ``` ### Completion Short Names + Home Assistant names its entities `domain.name`, like `light.some_light`. + ```bash # Imagine having the following devices/entities light.livingroom_main @@ -73,13 +84,14 @@ hctl off li hclt off light. light.livingroom_main light.livingroom_corner light.livingroom_other ``` + Completion Short Names can be disabled with: + ```bash completion: short_names: false ``` - ### Fuzzy Matching ```bash @@ -92,8 +104,10 @@ switch.livingroom_warp # Turn on device with fuzzy matching (matching "switch.livingroom_warp") hctl on lw ``` + Fuzzy Matching is enabled by default. Fuzzy Matching can be turned off in the config with: + ```bash handling: fuzz: false