A command-line autocompleter with steroids. 💪
Based on the desired command spec, beavr suggests arguments and flags. Suggestions can be selected with fzf, a fuzzy-finder.
The main objectives are:
- to increase discoverability, by showing all possible actions you can take;
- to prevent you from running auxiliar commands, copying the result into the clipboard and then pasting into the original command;
- to improve terminal usage as a whole.
Sure, you can find autocompleters out there for all your favorite commands.
However, they are very specific and each one may offer a different learning curve.
beavr, on the other hand, intends to be a general purpose platform for speccing any command with a couple of lines.
brew install fzf # or equivalent
npm install -g beavr
It's planned for beavr to ship with some command specs and, in case the command isn't available, beaver should infer the spec given the command's --help
content.
In the meantime, you must define a <your-cmd>.sh
in $HOME/.config/beavr/
such as in these examples:
beavr::help() {
echo "kubectl controls the Kubernetes cluster manager
Usage:
kubectl get <resource>
kubectl describe <resource> <id>"
}
beavr::suggestion() {
case "$1" in
"resource") echo "pods nodes deployments" | tr ' ' '\n';;
"id") kubectl get $resource | tail -n +2;;
esac
}
As of now, they must conform to neodoc/docopt specifications.
Simply source this file in your .zshrc
.
By default, the widget is trigged by Alt + G
.
While there is no widget for other shells, please run:
beavr <your-cmd> | pbcopy # or similar clipboard tool
# paste into the command line
Refer to this dashboard.
Feel free to add new issues or to upvote existing ones.
Command-line call builder > builder > beaver > beavr.