7 Amazing CLI Tools You Won't Be Able To Live Without
Discover seven indispensable CLI tools that will revolutionize your terminal workflow, complete with installation guides and configuration tips.
Published: 12:00 am · 12 Feb 2025
Open a Terminal Window
Open a terminal window on your macOS or Linux machine. I’m using Alacritty on macOS with the zsh shell.
Install Homebrew
Run the following command to install Homebrew:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
If prompted, enter your password and press Enter. If you haven’t installed the XCode Command Line Tools, Homebrew will handle the installation for you.
Add Homebrew to Path (Apple Silicon Macs)
After installation, add Homebrew to your path:
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
fzf
fzf is a powerful fuzzy finder for the command line.
Installation
brew install fzf
Configuration
- Open
~/.zshrc
with your preferred editor:
nvim ~/.zshrc
- Add the following at the bottom:
# fzf configuration
eval "$(fzf --zsh)"
- Reload zsh:
source ~/.zshrc
Keybindings
Keybind | Action |
---|---|
Ctrl + t | File/directory search |
Ctrl + r | Command history search |
Tab | Mark result |
Shift + Tab | Unmark result |
Ctrl + j | Next result |
Ctrl + k | Previous result |
Enter | Select result |
fd
fd is a faster alternative to find
.
Installation
brew install fd
Configuration
- Open
~/.zshrc
:
nvim ~/.zshrc
- Add:
export FZF_DEFAULT_COMMAND="fd --hidden --strip-cwd-prefix --exclude .git"
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
export FZF_ALT_C_COMMAND="fd --type=d --hidden --strip-cwd-prefix --exclude .git"
_fzf_compgen_path() {
fd --hidden --exclude .git . "$1"
}
_fzf_compgen_dir() {
fd --type=d --hidden --exclude .git . "$1"
}
- Reload zsh:
source ~/.zshrc
fzf-git
fzf-git integrates fzf with Git.
Installation
- Clone the repository:
git clone https://github.com/junegunn/fzf-git.sh.git
- Add to
~/.zshrc
:
source ~/fzf-git.sh/fzf-git.sh
- Reload zsh:
source ~/.zshrc
Keybindings
Keybind | Action |
---|---|
Ctrl + g f | Git files search |
Ctrl + g b | Git branches search |
Ctrl + g t | Git tags search |
bat
bat is a cat
alternative with syntax highlighting.
Installation
brew install bat
Usage
bat filename.txt
Theme Setup
- Create themes directory:
mkdir -p "$(bat --config-dir)/themes"
- Download a theme (e.g., Tokyo Night):
curl -O https://raw.githubusercontent.com/folke/tokyonight.nvim/main/extras/sublime/tokyonight_night.tmTheme
- Add to
~/.zshrc
:
export BAT_THEME=tokyonight_night
- Reload zsh:
source ~/.zshrc
delta
delta enhances git diff
.
Installation
brew install git-delta
Configuration
- Open
~/.gitconfig
:
nvim ~/.gitconfig
- Add:
[core]
pager = delta
[interactive]
diffFilter = delta --color-only
[delta]
navigate = true
side-by-side = true
[merge]
conflictstyle = diff3
[diff]
colorMoved = default
eza
eza is a modern ls
alternative.
Installation
brew install eza
Configuration
Add to ~/.zshrc
:
alias ls="eza --color=always --long --git --no-filesize --icons=always --no-time --no-user --no-permissions"
tldr
tldr provides concise man pages.
Installation
brew install tlrc
Usage
tldr eza
thefuck
thefuck corrects command typos.
Installation
brew install thefuck
Configuration
Add to ~/.zshrc
:
eval "$(thefuck --alias)"
Usage
After a typo:
fuck
zoxide
zoxide is a smarter cd
.
Installation
brew install zoxide
Configuration
Add to ~/.zshrc
:
eval "$(zoxide init zsh)"
Usage
z
Conclusion
These tools will significantly enhance your CLI experience. Each one solves specific pain points, making your workflow more efficient. Explore and configure them to suit your needs for a more productive development environment.