feat(sprite): Add completions for sprite

sprite is the CLI tool for https://docs.sprites.dev

Signed-off-by: Jonathan Stacks <jonstacks@users.noreply.github.com>
This commit is contained in:
Jonathan Stacks 2026-04-20 20:49:39 -05:00
commit b6aeb73109
No known key found for this signature in database
GPG key ID: FB934A2184BB941E
2 changed files with 34 additions and 0 deletions

20
plugins/sprite/README.md Normal file
View file

@ -0,0 +1,20 @@
# sprite plugin
This plugin adds completion for the [Sprites CLI](https://docs.sprites.dev/cli/installation) (`sprite`).
To use it, add `sprite` to the plugins array in your zshrc file:
```zsh
plugins=(... sprite)
```
This plugin does not add any aliases.
## Cache
This plugin caches the completion script and is automatically updated asynchronously when the plugin is
loaded, which is usually when you start up a new terminal emulator.
The cache is stored at:
- `$ZSH_CACHE_DIR/completions/_sprite` completions script

View file

@ -0,0 +1,14 @@
# Autocompletion for sprite
if (( ! $+commands[sprite] )); then
return
fi
# If the completion file doesn't exist yet, we need to autoload it and
# bind it to `sprite`. Otherwise, compinit will have already done that.
if [[ ! -f "$ZSH_CACHE_DIR/completions/_sprite" ]]; then
typeset -g -A _comps
autoload -Uz _sprite
_comps[sprite]=_sprite
fi
sprite completion zsh >| "$ZSH_CACHE_DIR/completions/_sprite" &|