2024-06-04 22:20:13 +00:00
# unhacs
A command line alternative to the "Home Assistant Community Store", aka HACS
2024-06-10 21:26:42 +00:00
## Installation
```bash
pipx install unhacs
```
## Usage
2024-12-18 19:17:02 +00:00
Unhacs provides several commands to manage your Home Assistant packages. It stores installed or requsted packages in a lock file called `unhacs.yaml` . This makes it possible to version control your packages and easily share them with others.
2024-06-10 21:26:42 +00:00
### Add a package
2024-12-18 19:17:02 +00:00
To add a package, use the `add` command followed by the URL of the package. Optionally, you can specify the package name and version. If no version is specified, the latest version will be installed:
2024-06-10 21:26:42 +00:00
```bash
2024-12-18 19:17:02 +00:00
unhacs add < package_url >
2024-07-08 17:38:37 +00:00
unhacs add < package_url > --version < version >
2024-06-10 21:26:42 +00:00
```
If the package already exists, you can update it by adding the `--update` flag:
```bash
2024-07-08 17:38:37 +00:00
unhacs add < package_url > --update
```
2024-12-18 19:17:02 +00:00
If the package is a Lovelace plugins or theme, install it using the appropriate flags:
2024-07-08 17:38:37 +00:00
```bash
unhacs add --plugin < package_url >
2024-12-18 19:17:02 +00:00
unhacs add --theme < package_url >
2024-07-08 17:38:37 +00:00
```
If you already have a list of packages in a file, you can add them all at once using the `--file` flag:
```bash
2024-12-18 19:17:02 +00:00
unhacs add --file ./unhacs.yaml
2024-06-10 21:26:42 +00:00
```
2024-12-18 19:17:02 +00:00
#### Add a component from a forked Home Assistant Core repository
2024-08-18 18:10:49 +00:00
2024-12-18 19:17:02 +00:00
To add a component from a fork of home-assistant/core, use the `--fork-component` flag followed by the name ofthe component and then specify the branch with the `--fork-branch` flag:
2024-08-18 18:10:49 +00:00
```bash
2024-12-18 19:17:02 +00:00
unhacs add --fork-component < component_name > --fork-branch < branch_name > < forked_repo_url >
2024-08-18 18:10:49 +00:00
```
2024-06-10 21:26:42 +00:00
### List packages
To list all installed packages, use the `list` command:
```bash
unhacs list
unhacs list --verbose
```
2024-06-10 23:59:42 +00:00
### List tags
To list all tags for a package, use the `tags` command followed by the name of the package:
```bash
unhacs tags < package_url >
unhacs tags < package_url > --limit 20
```
2024-06-10 21:26:42 +00:00
### Remove a package
To remove a package, use the `remove` command followed by the name of the package:
```bash
unhacs remove < package_name >
```
### Upgrade packages
To upgrade all packages, use the `upgrade` command:
```bash
unhacs upgrade
```
To upgrade specific packages, add their names after the `upgrade` command:
```bash
unhacs upgrade < package_name_1 > < package_name_2 > ...
```
2024-06-10 23:59:42 +00:00
## Use git tags
By default, identification of releases uses the GitHub API. If you want to use git tags instead, you can add the `--git-tags` flag to the base command:
```bash
unhacs --git-tags add < package_url >
```
2024-06-10 21:26:42 +00:00
## License
Unhacs is licensed under the MIT License. See the LICENSE file for more details.
2024-06-04 22:20:13 +00:00
## Original repo
Originally hosted at https://git.iamthefij.com/iamthefij/unhacs.git