title: navi Interactive Command Line Cheatsheet Tool: Say Goodbye to Forgetting Commands date: 2026-03-10 authors: [kevinpeng] slug: navi-interactive-cheatsheet-tool categories: - Linux Tools tags: - CLI - Productivity Tools - Linux - Terminal - Open Source Tools description: Introduction to navi interactive command line cheatsheet tool, supporting fuzzy search, variable replacement, and custom cheatsheets, making Linux commands easy to remember. Installation and configuration tutorial + practical tips. cover: https://res.makeronsite.com/dashen-tech.com/navi-interactive-cheatsheet-tool-cover.webp
navi Interactive Command Line Cheatsheet Tool: Say Goodbye to Forgetting Commands¶
As a Linux user, have you ever encountered this situation: you clearly know a command can complete the task, but you just can't remember the specific parameters? Or when facing complex ffmpeg, kubectl commands, you have to open a browser to search for the syntax?
Today, I'll introduce a tool that can completely solve this problem—navi, an interactive command line cheatsheet tool.
What is navi?¶
navi is an interactive cheatsheet tool written in Rust that allows you to browse and execute command examples directly in the terminal without leaving your current working environment.
Core Features¶
- 🚀 Interactive Search: Supports fuzzy search to quickly find needed commands
- 📝 Variable Replacement: Command parameters can be dynamically input, avoiding manual editing
- 🎨 Highly Customizable: Supports custom colors, fonts, and layouts
- 📦 Community Driven: Built-in cheatsheets for common tools, also supports importing community resources
- 🔌 Shell Integration: Supports mainstream shells like Bash, Zsh, Fish
Why choose navi instead of tldr?¶
You may have heard of tldr, which is also a popular command line cheatsheet tool. So what advantages does navi have?
| Feature | tldr | navi |
|---|---|---|
| Interaction Method | Static display | Interactive selection |
| Variable Replacement | ❌ Not supported | ✅ Supports dynamic input |
| Custom Cheatsheets | Limited | Fully customizable |
| Command Execution | Manual copy-paste | Can execute directly |
| Search Experience | Basic | Fuzzy search |
Simply put: tldr is suitable for quickly viewing command syntax, navi is suitable for actually executing commands.
Installing navi¶
Method 1: Using Package Manager (Recommended)¶
Fedora/RHEL/CentOS:
sudo dnf install navi
Ubuntu/Debian (need to add repository first):
sudo add-apt-repository universe
sudo apt update
sudo apt install navi
Arch Linux:
sudo pacman -S navi
macOS (Homebrew):
brew install navi
Method 2: Using Cargo (Rust Package Manager)¶
If you already have Rust installed:
cargo install navi
Method 3: Download Binary¶
Download pre-compiled binaries from GitHub Releases:
# Download latest version (example v2.23.0)
wget https://github.com/denisidoro/navi/releases/download/v2.23.0/navi-v2.23.0-x86_64-unknown-linux-musl.tar.gz
# Extract
tar -xzf navi-v2.23.0-x86_64-unknown-linux-musl.tar.gz
# Move to system path
sudo mv navi /usr/local/bin/
Configuring Shell Integration¶
After installation, you need to add integration code to your shell configuration file.
Bash¶
Edit ~/.bashrc, add:
eval "$(navi widget bash)"
Zsh¶
Edit ~/.zshrc, add:
eval "$(navi widget zsh)"
Fish¶
Edit ~/.config/fish/config.fish, add:
navi widget fish | source
After configuration, reload the shell configuration:
source ~/.bashrc # or ~/.zshrc
Basic Usage¶
1. Search Commands¶
The simplest usage is direct search:
navi
This opens an interactive interface where you can enter keywords to search for commands. For example, entering git will display all Git-related cheatsheets.
2. Using Widget (Recommended)¶
After configuring shell integration, you can use shortcuts to call navi:
- Bash/Zsh:
Ctrl + G - Fish:
Ctrl + G
Pressing the shortcut will bring up the search interface, and after selecting a command, it can be directly filled into the command line.
3. View Cheatsheets for Specific Tools¶
navi --query git
navi --query docker
navi --query kubectl
4. Execute Commands¶
After selecting a command in the navi interface, you can:
- Press
Enter: Fill the command into the shell - Press
Ctrl + Y: Execute the command directly - Press
Esc: Cancel
Custom Cheatsheets¶
The power of navi lies in its support for fully custom cheatsheets.
Creating Personal Cheatsheets¶
Create .cheat files in the ~/.config/navi/ directory:
mkdir -p ~/.config/navi
vim ~/.config/navi/my_tools.cheat
Cheatsheet Format¶
# Title
% git common commands
# Command description
$ View current branch status
git status
# Command with variables
$ Switch to specified branch
git checkout <branch>
# Variable with comment
$ Create new branch and switch
git checkout -b <branch>
%% branch: New branch name
# Multiple variables
$ Commit code
git commit -m "<message>"
%% message: Commit message
# Variable with default value
$ Push branch
git push <remote> <branch>
%% remote: Default origin
%% branch: Current branch name
Variable Types¶
navi supports multiple variable types:
# Text input
%% name: Please enter name
# With default value
%% port: Default 8080
# Selection list
%% method: Default GET, options GET POST PUT DELETE
# Command output as options
%% branch: Command git branch --format='%(refname:short)', wrapped in backticks
Practical Example: Docker Cheatsheet¶
% Docker common operations
$ View running containers
docker ps
$ View all containers (including stopped)
docker ps -a
$ Start container
docker start <container>
%% container: Command docker ps -a --format '{{.Names}}'
$ Stop container
docker stop <container>
%% container: Command docker ps --format '{{.Names}}'
$ Delete container
docker rm <container>
%% container: Command docker ps -a --format '{{.Names}}'
$ View container logs
docker logs -f <container>
%% container: Command docker ps --format '{{.Names}}'
$ Enter container
docker exec -it <container> <shell>
%% container: Command docker ps --format '{{.Names}}'
%% shell: Default /bin/bash, options /bin/bash /bin/sh
Importing Community Cheatsheets¶
The navi community maintains a large number of cheatsheets for common tools that can be imported directly.
Using navi's Built-in Features¶
# Browse available cheatsheet repositories
navi repo add denisidoro/navi
# Or add manually
navi repo add https://github.com/denisidoro/cheats
Recommended Cheatsheet Repositories¶
- denisidoro/cheats - Official maintained general cheatsheets
- sv222/kubectl-autocompletion-navi - Kubernetes kubectl commands
- ormico/navi-cheatsheets - Various development tool cheatsheets
Advanced Tips¶
1. Use Tags to Organize Commands¶
% System Administration
tags: system
$ View disk usage
df -h
$ View memory usage
free -h
% Git Operations
tags: git, version-control
$ View commit history
git log --oneline
2. Conditional Variables¶
$ Deploy based on environment
deploy <environment>
%% environment: Options dev staging production
%% If environment = production: echo "⚠️ Production deployment, please confirm!"
3. Call External Scripts¶
$ Backup database
./scripts/backup.sh <database>
%% database: Command mysql -e "SHOW DATABASES;" | tail -n +2
4. Custom Color Themes¶
Edit ~/.config/navi/config.yaml:
style:
tag:
color: blue
width: 20
comment:
color: yellow
snippet:
color: green
Practical Application Scenarios¶
Scenario 1: Quickly Execute Complex Commands¶
Need to regularly clean up Docker resources? Create a cheatsheet:
% Docker Cleanup
$ Delete all stopped containers
docker container prune -f
$ Delete unused images
docker image prune -f
$ Delete all unused resources
docker system prune -f
In the future, just Ctrl + G, search "docker cleanup", execute with one key.
Scenario 2: Team Collaboration Standardization¶
Write the team's common operations into cheatsheets and place them in a shared repository:
# Team repository
git clone https://github.com/your-team/team-navi-cheats.git ~/.config/navi/team
# Add in config.yaml
paths:
- ~/.config/navi/team
New team members immediately have standardized operation manuals.
Scenario 3: Learning New Tools¶
When learning Kubernetes, import kubectl cheatsheet:
navi repo add https://github.com/sv222/kubectl-autocompletion-navi
Learn while using, get started quickly.
Common Issues¶
Q: What if navi conflicts with fish shell's autospawn?¶
A: Adjust the loading order in fish configuration to ensure navi widget loads last.
Q: How to backup my custom cheatsheets?¶
A: Include the ~/.config/navi/ directory in version control:
cd ~/.config/navi
git init
git add .
git commit -m "Initial navi cheatsheets"
# Push to private repository
Q: Chinese display garbled?¶
A: Ensure the terminal and fonts support Chinese, or set in config.yaml:
terminal:
font: "Noto Sans Mono CJK SC"
Summary¶
navi is a tool that can significantly improve command line efficiency, especially suitable for:
- ✅ Developers who frequently use complex commands
- ✅ Multi-taskers who need to quickly switch between different tool contexts
- ✅ Tech Leads who want to standardize team operations
- ✅ Beginners learning new tools
Project Info: - GitHub: https://github.com/denisidoro/navi - Language: Rust - Stars: 16,400+ - License: Apache-2.0
Spend 30 minutes configuring navi, save 10 minutes every day searching for commands in the future. This investment is worth it!
Related Reading: - tldr-pages/tldr - Simplified man pages - cheat.sh - Online cheatsheet without installation - fzf - General fuzzy finder, can be used with navi
