Home Cheatsheets Navi – An Interactive Commandline Cheatsheet Tool

Navi – An Interactive Commandline Cheatsheet Tool

By sk
Published: Last Updated on 6.2K views

A while ago, we posted some good alternatives to Linux man pages. Those tools skips all theoretical part and gives concise Linux command examples. If you are a lazy Linux user who wants some practical examples for a Linux command, they would definitely help. Today, we will see a similar tool named Navi. Navi is an interactive commandline cheatsheet tool written in Rust. Just like Bro pages, Cheat, Tldr tools, Navi also provides a list of examples for a given command, skipping all other comprehensive text parts.

Install Navi In Linux

Since Navi is written in Rust, you need to install Rust on your Linux box. To install Rust programming language in Linux, refer this guide.

Also Navi requires fzf tool for interactive search.

After installing Rust and fzf,run the following one-liner command to install navi:

bash <(curl -sL https://raw.githubusercontent.com/denisidoro/navi/master/scripts/install)

A. Install Navi using Cargo

Alternatively, you can install navi using Cargo package manager:

$ cargo install navi

If you encountered with "linker cc not found" error, install development tools and try again.

B. Install Navi from source

Git clone the Navi repository using command:

$ git clone https://github.com/denisidoro/navi ~/.navi

This command will clone the contents of Navi official github repository in a folder named navi in your $HOME directory.

Go to the navi directory:

$ cd ~/.navi

And, install it using command:

$ sudo make install

C. Install Navi using Linuxbrew

If you have Linuxbrew installed on your system, run the following command to install navi:

$ brew install denisidoro/tools/navi

D. Install Navi from Arch User Repository

The Arch Linux users can install Navi from AUR using any AUR helper tools, for example Yay.

$ yay -S navi

How to use Navi interactive commandline cheatsheet tool

To launch navi, do:

$ navi

When you run navi for the time, you will see the following screen. By default, you will be suggested to download some cheatsheets. Use arrow keys to choose "Download default cheatsheets" option and hit enter to list the available cheatsheets.

Launch Navi cheatsheet tool

Launch Navi cheatsheet tool

Here is the list of available cheatsheets. You can preview the list of available command snippets in the selected cheetsheet on the right pane.

Choose the cheatsheet from the list and hit ENTER key to download it.

Available cheatsheets in Navi

Available cheatsheets in Navi

All downloaded cheatsheets are available in /home/<user>/.local/share/navi/cheats.

When you run navi again, you will see the downloaded cheatsheets.

Navi cheatsheets

Navi cheatsheets

Use UP/DOWN arrow keys to go through the commands in the cheatsheet or type a few letters to find the matched command. To run any command, simply choose it from the list and hit ENTER. The selected command will run instantly. No need to type the full command! Just choose it and hit ENTER!!

Press ESC key to exit without running any command.

Print commands without executing

If you want to print the commands without running it, use print option.

$ navi --print

This command will print the selected command snippet in your Terminal window, but will not execute it.

Search commands matching to a pattern

To list command matched to a specific string, for example "apt", simply run:

$ navi query apt

There is also another option called "best" that autoselects the snippet that best matches the query.

$ navi best apt

Import cheatsheets

To import cheatsheets from the available online repositories, run:

$ navi repo browse

The list of available repositories will appear. Choose any one from the list and hit ENTER to import the cheatsheets from the selected repository.

Import Navi cheatsheets

Import Navi cheatsheets

Run the above command again to download all available cheatsheets from other repositories.

In addition, you can import cheatsheets from any git repository like below:

$ navi repo add https://github.com/denisidoro/navi

When run Navi again, the newly imported cheatsheets will appear:

$ navi
All Navi cheatsheets

All Navi cheatsheets

For help:

$ navi --help

Recommended read: 


Hope this helps.

Resource:

You May Also Like

Leave a Comment

* By using this form you agree with the storage and handling of your data by this website.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

This website uses cookies to improve your experience. By using this site, we will assume that you're OK with it. Accept Read More