add shell completion scripts

add Shell Completion section to README

add pdm script completion

add pre-commit config
This commit is contained in:
2026-03-24 00:40:05 +00:00
parent 58a8b96603
commit cab4299b17
7 changed files with 195 additions and 2 deletions

View File

@@ -16,6 +16,7 @@ For an outline of past/future changes refer to: [CHANGELOG](CHANGELOG.md)
- [Configuration](#configuration)
- [Style](#style)
- [Commands](#commands)
- [Shell Completion](#shell-completion)
- [License](#license)
## Requirements
@@ -325,10 +326,70 @@ slobs-cli scenecollection load "ExistingCollection"
slobs-cli scenecollection rename "ExistingCollection" "NewName"
```
## Shell Completion
Shell completion scripts are available for *bash*, *zsh*, and *fish*, you can find them in the [completions directory](./completions/).
#### Bash
Save the script in a completion directory of your choice.
```console
cp -v ./completions/_slobs-cli.bash ~/.completions/_slobs-cli
```
Source the file in `~/.bashrc`
```bash
. ~/.completions/_slobs-cli
```
Restart the shell
```console
exec "$SHELL"
```
#### Fish
Save the script to `~/.config/fish/completions`
```fish
cp -v ./completions/_slobs-cli.fish ~/.config/fish/completions/_slobs-cli
```
Restart the shell
```console
exec "$SHELL"
```
#### Zsh
Save the script in a completion directory of your choice.
```console
cp -v ./completions/_slobs-cli.zsh ~/.completions/_slobs-cli
```
Source the file in `~/.zshrc`
```zsh
. ~/.completions/_slobs-cli
```
> Note: If you're using a framework like oh-my-zsh you can copy the completion script straight into $ZSH_CUSTOM/completions and skip modifying ~/.zshrc
Restart the shell
```console
exec "$SHELL"
```
## Special Thanks
- [Julian-0](https://github.com/Julian-O) For writing the [PySLOBS wrapper](https://github.com/Julian-O/PySLOBS) on which this CLI depends.
## License
`slobs-cli` is distributed under the terms of the [MIT](https://spdx.org/licenses/MIT.html) license.
`slobs-cli` is distributed under the terms of the [MIT](https://spdx.org/licenses/MIT.html) license.