An oclif plugin to generate a carapace spec!
carapace-spec
allows to define CLI completions in a spec file, you can use it to get shell completion in all supported shells listed here:
https://carapace-sh.github.io/carapace-spec/carapace-spec/usage.html
- Commands
- Flags
- Options
- Exclusive relationships
- Re-generate spec automatically on plugin install/uninstall
carapace-spec
: dowload the binary for your OS and put it in yourPATH
- oclif CLI that supports installing plugins via
plugins install
plugins install @cristiand391/oclif-carapace-spec-plugin
Then run the carapace-gen
command and follow the instructions to source the spec in your shell.
@oclif/plugin-autocomplete
only supports bash, zsh and powershell while carapace-spec
supports those + 6 additional shells: https://carapace-sh.github.io/carapace-spec/carapace-spec/usage.html
Except for flag exclusive relationships, the completion experience is pretty much the same so if you oclif/plugin-autocomplete works for you then you can ignore this.
In the future I plan to add support for injecting custom macros for specific command/flags,see: https://carapace-sh.github.io/carapace-spec/carapace-spec/macros/core.html
that would allow users to define dynamic completion logic for flag/arg values without having to touch any code.