Docs

CLI tools

Tools for day-to-day SWE work

A running list of command-line tools I use as a software engineer, with the setup and shortcuts worth remembering.

fzf

fzf is a general-purpose fuzzy finder for the command line. On its own it filters whatever you pipe into it, but the shell integration is what makes it useful day to day: it adds key bindings and Tab completion to your shell.

Install

Terminal window
brew install fzf

Other package managers (apt, pacman, choco, scoop, winget, mise) are listed in the fzf README.

Enable shell integration

Add one line to your shell config file:

Shell Line
bash eval "$(fzf --bash)"
zsh source <(fzf --zsh)
fish fzf --fish | source

These flags need a recent fzf version. See shell integration setup.

Key bindings

Binding What it does
Ctrl+R Search command history and paste the selection. Press Tab to select several commands. Press Ctrl+R again to toggle between relevance and chronological order.
Ctrl+T Fuzzy search files and directories and paste the selection onto the command line.
Alt+C Fuzzy search directories and cd into the selection.

To disable a binding, set its *_COMMAND variable to an empty string before sourcing the script. For example, in bash: FZF_CTRL_R_COMMAND= FZF_ALT_C_COMMAND= eval "$(fzf --bash)". Setting the variable after sourcing has no effect. See key bindings.

Fuzzy completion

In bash and zsh, type ** after a command and press Tab:

Terminal window
vim **<Tab> # files under the current directory
cd **<Tab> # directories under the current directory
cd ~/github/fzf**<Tab> # directories under ~/github matching "fzf"
kill -9 **<Tab> # processes (Tab or Shift-Tab to multi-select)
ssh **<Tab> # hosts from /etc/hosts and ~/.ssh/config
unset **<Tab> # environment variables (also export, unalias)

The general pattern is COMMAND [DIRECTORY/][FUZZY_PATTERN]**<Tab>. Fish has no trigger and uses Shift+Tab instead. To change the trigger, set FZF_COMPLETION_TRIGGER, for example export FZF_COMPLETION_TRIGGER='~~'. See fuzzy completion.

Sources

Setup, key bindings, and completion details come from the fzf README. The README does not say how Alt+C behaves on macOS terminals, so verify that in your own terminal before relying on it.