Home

Awesome

beavr

<img src="https://user-images.githubusercontent.com/3226564/56245772-95f85c80-6076-11e9-9f86-054231221e1f.png" align="right" />

CircleCI npm version Downloads

A command-line autocompleter with steroids. :muscle:

Based on the desired command spec, beavr suggests arguments and flags. Suggestions can be selected with fzf, a fuzzy-finder.

Demo

:warning: If you're interested in this project you will probably like navi!

The main objectives are:

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.

Installation

brew install fzf # or equivalent
npm install -g beavr

Usage

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.

ZSH widget

Simply source this file in your .zshrc.

By default, the widget is trigged by Alt + G.

Widgets for other shells

While there is no widget for other shells, please run:

beavr <your-cmd> | pbcopy # or similar clipboard tool
# paste into the command line

Roadmap

Refer to this dashboard.

Feel free to add new issues or to upvote existing ones.

Etymology

Command-line call builder > builder > beaver > beavr.

Icon

Icon made by Freepik from flaticon, licensed by CC 3.0 BY.