This guide is a compilation of various command line tools that will improve your productivity in addition to various quality-of-life features.
Note: for any npm
packages, make sure to install globally with -g
.
Getting Started
- Download a Nerd Font and set your favourite terminal to use it. I like
Cascaydia Cove Nerd Font
the best. - See my guide for setting up a custom prompt and various plugins using oh-my-zsh. This also includes some useful aliases, keybinds and terminals to use for different platforms.
General Productivity
tmux
: Terminal multiplexer that gives you tabs, panes and more natively in the shell. With tmux, you can detach terminal sessions so that they continue running in the background, restore sessions, and even reattach them to a different terminal.- See this blog to get started with tmux.
- See my
.tmux.conf
. - Alternatively, you can also use oh-my-tmux along with a bunch of plugins to extend the capabilities of tmux. See my
.tmux.conf.local
which has my current configuration using this framework. This is what my tmux looks like, with a customized status bar: bat
: Bettercat
- supports syntax highlighting for a large number of programming and markup languages.diff-so-fancy
: Makes your diffs human readable instead of machine readable. Go here to see usage with Git.- Can be used with
diff
, as in this alias:
1diffs() { 2 diff -u $1 $2 | diff-so-fancy 3} 4
bash
tldr
: Betterman
(manual) pages.thefuck
: Corrects errors in previous console commands.how2
: Finds the simplest way to do something in a unix shell using a natural language query.direnv
: Load and unload environment variables depending on the current directory (foroh-my-zsh
users, see this alternative)asdf
: Manage multiple runtime versions with a single CLI tool.glow
: Terminal based markdown reader.
Search
fzf
: General-purpose command-line fuzzy finder.- fzf can be used for tab completion, history search and more.
- If you are using oh-my-zsh, add
fzf
to your plugins for keybinds and more. - You can use fzf to search and
bat
for file previews using this alias:
1if [[ -x "$(command -v fzf)" ]] && [[ -x "$(command -v bat)" ]]; then 2 alias fp="fzf --preview 'bat --color=always --style=numbers --line-range=:500 {}'" 3fi 4
bash
rg
: Bettergrep
- ripgrep is a line-oriented search tool that recursively searches the current directory for a regex pattern.
Directory Navigation & Management
colorls
: Colorizes thels
output with color and icons (requiresgem
).- Includes many useful flags, such as
--gs
for Git status, or-t
for a tree view: - I use an alias to replace
ls
withcolorls
:
1if [ -x "$(command -v colorls)" ]; then 2 alias ls="colorls" 3 alias la="colorls -al" 4fi 5
bash
exa
: Alternative tocolorls
(use the--icons
flag to get icons likecolorls
).tree
: Visualize directories in a tree-like format (lightweight alternative tocolorls
with the-t
flag).broot
: Like tree, but works better with big directories.z
: Quickly jump between directories based on history (Forzsh
users, it is easier to install this plugin)
Utilities
vtop
: A graphical activity monitor for the command line.croc
: Simple file transfer via CLI.secman
: CLI password manager.hyperfine
: A command-line benchmarking tool.gping
: Ping, but with a graph.procs
: Replacement for ps.dog
: Command-line DNS client.duf
: A better df alternative.
Git
gh
: GitHub CLI - view pull requests, issues, and other GitHub concepts in the terminal.gitui
: Git GUI in your terminal.diff-so-fancy
: Makes your diffs human readable instead of machine readable.- Add the following to your
.gitconfig
:
1[alias] 2 dsf = diff --color 3[interactive] 4 diffFilter = diff-so-fancy --patch 5[color] 6 ui = true 7[color "diff-highlight"] 8 oldNormal = red bold 9 oldHighlight = red bold 52 10 newNormal = green bold 11 newHighlight = green bold 22 12[color "diff"] 13 meta = 11 14 frag = magenta bold 15 func = 146 bold 16 commit = yellow bold 17 old = red bold 18 new = green bold 19 whitespace = red reverse 20
bash
- commitizen: Get prompted to fill out any required commit fields at commit time.
Package Mangers
There are a wide range of different package managers for different environments (e.g., APT
for Ubuntu
) and languages (e.g., pip
for python
), but here are some general package managers that are good to have:
- Homebrew: MacOS, but also available on Linux.
- Chocolatey: Windows.
- nix: For Unix systems, functional package manager.
- npm: Package manager for
node
, but good to have.
Specialized Tools
Depending on what technologies you work with day-to-day, these may or may not be relevant:
jq
: JSON processor.httpie
: Command-line HTTP client (bettercurl
).wget
: Another command-line HTTP client.ngrok
: Secure URL to a localhost server.k9s
: Manage your Kubernetes clusters in style.
Next Steps
- Customize your theme and prompt. See my guide here.
- Use oh-my-zsh to install some zsh plugins. I've created a guide for that here. Some notable plugins include:
- Autocomplete
- Autosuggestions
- Syntax highlighting
.env
auto loading- Clipboard CLI utilities
web-search
for using search engines via CLI- Create some aliases for frequently used commands. See all my aliases in my
aliases.zsh
. Note that for git aliases, it is best to define them in your.gitconfig
.
Feel free to add a comment suggesting any additional CLI tools and I'll add them to the list!