No description
Find a file
Denis Isidoro f1fee67a0f
Merge pull request #17 from d3d1rty/git-cheatsheet
This PR adds additional cheats to the git cheatsheet.
2019-09-21 17:35:34 -03:00
.circleci Add tests (#3) 2019-09-20 18:44:51 -03:00
.github Configure welcome probot (#7) 2019-09-20 20:04:58 -03:00
cheats Merge pull request #17 from d3d1rty/git-cheatsheet 2019-09-21 17:35:34 -03:00
scripts Add double-quotes to arguments (#24) 2019-09-21 17:17:01 -03:00
src Prevent printing result in some cases with --no-interpolation (#25) 2019-09-21 17:29:46 -03:00
test Fix indentation (#8) 2019-09-20 20:08:13 -03:00
LICENSE License under AGPL-3 (#4) 2019-09-20 19:08:45 -03:00
Makefile Add tests (#3) 2019-09-20 18:44:51 -03:00
navi Update version 2019-09-21 10:30:31 -03:00
README.md Link to cmdmenu 2019-09-21 11:00:56 -04:00

navi icon CircleCI

An interactive cheatsheet tool for the command-line so that you'll never say the following again:

How to run that command again?
Oh, it's not in my bash history
Geez, it's almost what I wanted but I need to change some args

Demo

navi allows you to browse through cheatsheets (that you may write yourself or download from maintainers) and execute commands, prompting for argument values.

Installation

Using brew:

brew install denisidoro/tools/navi

Without brew:

git clone http://github.com/denisidoro/navi /opt/navi
cd /opt/navi
sudo make install
# install fzf: https://github.com/junegunn/fzf

Usage

Simply call:

navi

Trying it out online

Head to this playground for previewing navi.

Motivation

The main objectives are:

  • to increase discoverability, by finding commands given keywords or descriptions;
  • to prevent you from running auxiliar commands, copying the result into the clipboard and then pasting into the original command;
  • to easily share one-liners with others so that they don't need to figure out how to write the commands;
  • 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.

Or you can launch a browser and search for instructions on Google, but that takes some time.

navi, on the other hand, intends to be a general purpose platform for bookmarking any command at a very low cost.

Using your own cheatsheets

In this case, you need to pass the directory which contains .cheat files as in:

navi --dir "/folder/with/cheats"

Alternatively, you can set an environment variable in your .bashrc-like file:

export NAVI_DIR="/folder/with/cheats"

Submitting cheatsheets

Feel free to fork this project and open a PR for me to include your contributions.

.cheat syntax

  • lines starting with % should contain tags which will be added to any command in a given file;
  • lines starting with # should be descriptions of commands;
  • lines starting with $ should contain commands that generate suggestion values for a given argument;
  • all the other non-empty lines are considered as executable commands.

For example, this is a valid .cheat file:

% git, code

# Change branch
git checkout <branch>

$ branch: git branch --format='%(refname:short)'

For advanced usage, please refer to the files in /cheats.

Alternatives

Etymology

In The Legend of Zelda Ocarina of Time, navi is a character that provides Link with a variety of clues to help him solve puzzles and progress in his quest.