0 / 20
25:00
Guard the fire of focus, for it transforms chaos into clarity.

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

zsh
tools
shell
productivity
cli

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

  1. Open ~/.zshrc with your preferred editor:
nvim ~/.zshrc
  1. Add the following at the bottom:
# fzf configuration
eval "$(fzf --zsh)"
  1. Reload zsh:
source ~/.zshrc

Keybindings

KeybindAction
Ctrl + tFile/directory search
Ctrl + rCommand history search
TabMark result
Shift + TabUnmark result
Ctrl + jNext result
Ctrl + kPrevious result
EnterSelect result

fd

fd is a faster alternative to find.

Installation

brew install fd

Configuration

  1. Open ~/.zshrc:
nvim ~/.zshrc
  1. 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"
}
  1. Reload zsh:
source ~/.zshrc

fzf-git

fzf-git integrates fzf with Git.

Installation

  1. Clone the repository:
git clone https://github.com/junegunn/fzf-git.sh.git
  1. Add to ~/.zshrc:
source ~/fzf-git.sh/fzf-git.sh
  1. Reload zsh:
source ~/.zshrc

Keybindings

KeybindAction
Ctrl + g fGit files search
Ctrl + g bGit branches search
Ctrl + g tGit tags search

bat

bat is a cat alternative with syntax highlighting.

Installation

brew install bat

Usage

bat filename.txt

Theme Setup

  1. Create themes directory:
mkdir -p "$(bat --config-dir)/themes"
  1. Download a theme (e.g., Tokyo Night):
curl -O https://raw.githubusercontent.com/folke/tokyonight.nvim/main/extras/sublime/tokyonight_night.tmTheme
  1. Add to ~/.zshrc:
export BAT_THEME=tokyonight_night
  1. Reload zsh:
source ~/.zshrc

delta

delta enhances git diff.

Installation

brew install git-delta

Configuration

  1. Open ~/.gitconfig:
nvim ~/.gitconfig
  1. 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.