Skip to content
A command-line autocompleter with steroids 💪
Clojure Shell
Branch: master
Clone or download
Latest commit dad257d Oct 15, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci Set CircleCI (#24) Apr 18, 2019
shell Rename some folders (#22) Apr 17, 2019
specs Rename spec Apr 18, 2019
src Allow pre-input (#25) Apr 18, 2019
test/beavr Add first test (#23) Apr 17, 2019
.gitignore Minor fixes (#10) Apr 16, 2019
README.md Add reference to navi Oct 15, 2019
package.json Bump ws from 1.1.5 to 7.1.2 (#29) Oct 15, 2019
project.clj Add first test (#23) Apr 17, 2019

README.md

beavr

CircleCI npm version Downloads

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.

Demo

⚠️ If you're interested in this project you will probably like navi!

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.

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.

You can’t perform that action at this time.