cristiand391 / oclif-carapace-spec-plugin

An oclif plugin to generate a carapace spec.
1 stars 0 forks source link
carapace completion oclif oclif-plugin

oclif-carapace-spec-plugin

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

image image

Supported features

Requirements

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.

Why should I use this instead of @oclif/plugin-autocomplete?

@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.