A CLI tool is a program you run by typing commands in a terminal instead of clicking buttons in a graphical interface. CLI stands for Command Line Interface — you interact with the tool through text input and text output.
If you've ever typed git commit, npm install, or python script.py, you've used a CLI tool.
Why Do Developers Use CLI Tools?
Graphical apps are easier to learn. So why do developers prefer the command line?
Speed. Typing a command is faster than navigating menus. git push takes 2 seconds. Doing the same through a GUI takes 5-10 clicks.
Automation. CLI tools can be chained together in scripts. find . -name "*.log" -delete deletes all log files recursively — try doing that in Finder. Shell scripts, CI/CD pipelines, and build systems all run CLI tools under the hood.
Reproducibility. A command is exact. "Run npm install && npm test" is unambiguous. "Click the install button, then click run tests" depends on which version of the UI you're looking at.
Remote access. When you SSH into a server, there's no GUI. The terminal is all you have. Every server, container, and CI runner operates through CLI tools.
Composability. CLI tools can be piped together. curl api.example.com | jq '.users[].name' fetches JSON from an API and extracts usernames — two tools working together in one line.
Anatomy of a CLI Command
rg "TODO" --type py --count
rg— the program name (ripgrep, a search tool)"TODO"— an argument (what to search for)--type py— a flag with a value (only search Python files)--count— a boolean flag (show count instead of matches)
Most CLI tools follow this pattern: program [arguments] [flags]. Run program --help to see what's available.
How to Install CLI Tools
CLI tools are installed through package managers — programs that download, install, and update other programs.
macOS — Homebrew
The standard package manager for macOS. Install it first:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Then install tools:
brew install ripgrep # Search tool
brew install bat # File viewer
brew install lazygit # Git TUI
Linux — apt / dnf / pacman
Use your distribution's built-in package manager:
# Debian/Ubuntu
sudo apt install ripgrep
# Fedora
sudo dnf install ripgrep
# Arch
sudo pacman -S ripgrep
Language-Specific Package Managers
Some tools are installed through the language they're written in:
npm install -g typescript # JavaScript/Node.js tools
pip install httpie # Python tools
cargo install fd-find # Rust tools
go install github.com/x/tool # Go tools
Which Install Method to Use?
If a tool is available through Homebrew (macOS) or your system package manager (Linux), use that. It handles updates and dependencies. Language-specific installs are a fallback for tools not in the main repositories.
Every tool on clihub shows install commands for all available methods.
Command Line Cheat Sheet
Essential commands every developer should know.
File Navigation
| Command | What it does |
|---|---|
pwd | Print current directory |
ls | List files |
cd dirname | Change directory |
cd .. | Go up one directory |
cd ~ | Go to home directory |
mkdir dirname | Create a directory |
File Operations
| Command | What it does |
|---|---|
cat file | Display file contents |
cp source dest | Copy a file |
mv source dest | Move or rename a file |
rm file | Delete a file |
rm -r dir | Delete a directory and contents |
touch file | Create an empty file |
Searching
| Command | What it does |
|---|---|
grep "text" file | Search for text in a file |
grep -r "text" . | Search recursively in current directory |
find . -name "*.py" | Find files by name pattern |
which program | Show where a program is installed |
Process Management
| Command | What it does |
|---|---|
ps aux | List running processes |
kill PID | Stop a process by ID |
Ctrl+C | Stop the current running command |
Ctrl+Z | Suspend the current command |
Text & Pipes
| Command | What it does |
|---|---|
head -20 file | Show first 20 lines |
tail -20 file | Show last 20 lines |
wc -l file | Count lines in a file |
sort file | Sort lines alphabetically |
uniq | Remove duplicate lines |
cmd1 | cmd2 | Pipe output of cmd1 into cmd2 |
Git Basics
| Command | What it does |
|---|---|
git status | Show changed files |
git add . | Stage all changes |
git commit -m "msg" | Commit staged changes |
git push | Push to remote |
git pull | Pull from remote |
git log --oneline | View commit history |
Modern Upgrades
Every classic command in the cheat sheet above has a modern replacement that's faster and more user-friendly. Here are the upgrades worth making first:
| Classic | Modern | Why upgrade |
|---|---|---|
grep | ripgrep | Faster, respects .gitignore |
cat | bat | Syntax highlighting |
ls | eza | Git status, icons |
find | fd | Simpler syntax |
cd | zoxide | Learns your directories |
For the full breakdown, see Modern Alternatives to Classic Unix Commands.
Where to Discover CLI Tools
The hardest part of the command line is knowing what tools exist. You can't search for what you don't know about.
clihub is a directory of CLI tools organized by category — from dev utilities and AI agents to shell tools and system monitors. Every listing shows install commands, GitHub stats, and a description. Browse by category or search by name.
Start with the Best CLI Tools for Developers list for a curated overview.
FAQ
What's the difference between a terminal, a shell, and a CLI?
A terminal (or terminal emulator) is the app — the window you type in. A shell is the program that interprets your commands (Bash, Zsh, Fish). A CLI is the interface pattern — any program you interact with by typing text. The terminal runs the shell, and the shell runs CLI tools.
Do I need to learn the command line to be a developer?
For most development work, yes. Version control (Git), package managers (npm, pip), build tools, deployment, and CI/CD all run through the command line. You don't need to master it on day one, but basic fluency is essential.
What's the easiest way to start?
Open your terminal, learn the file navigation commands (cd, ls, pwd), and start using Git from the command line. That covers 80% of what you need daily. Add tools gradually as you run into tasks that need them.
Where can I practice?
Your own machine is a practice environment. Create a test directory (mkdir test && cd test), create files, move them around, search through them. For guided practice, resources like The Missing Semester of Your CS Education from MIT are excellent.
Discover more CLI tools on clihub — the directory for command line tools.