5 Essential Shell Tools for Terminal Productivity

β˜• 6 min read
shell

Table of Contents

Intro

After covering infrastructure tools like kubectl and AWS CLI in my previous article, this guide focuses on shell productivity toolsβ€”the ones that make the terminal itself more productive.

The default macOS terminal works, but it's minimal. No autocomplete from history. No syntax highlighting. No smart directory navigation. These 5 tools transform the terminal from functional to actually productive.

1. Spaceship Prompt

GitHub: spaceship-prompt/spaceship-prompt

Spaceship is a customizable zsh prompt showing git branch, language versions, AWS profiles, Kubernetes contexts, and more.

Install

1brew install spaceship
2
3# Add to ~/.zshrc
4source /opt/homebrew/opt/spaceship/spaceship.zsh

What It Shows

1my-project/scripts is πŸ“¦ 0.1.0 via 🐍 v3.11.0 at ☸️ v1.32.9 dev-cluster
2❯
  • Current directory
  • Package version from package.json/pyproject.toml
  • Language version (Python, Node, Go, etc.)
  • Kubernetes cluster and version

In git repos:

1blog/articles on main via 🟒 v18.17.0
2❯
  • Git branch
  • Node version

Context awareness prevents deployment accidents. Seeing ☸️ production-cluster makes it hard to accidentally run destructive commands in the wrong environment.

2. zsh-autosuggestions

GitHub: zsh-users/zsh-autosuggestions

Fish-like autocomplete that suggests commands from history as you type.

Install

1git clone https://github.com/zsh-users/zsh-autosuggestions ~/.zsh/zsh-autosuggestions
2
3# Add to ~/.zshrc
4source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh

How It Works

Type kubectl lo and it suggests:

1kubectl logs -f deployment/api -n production --tail=100
2 ↑ greyed out suggestion

Press β†’ to accept. Commands that took 30 seconds to type now take 3 seconds.

3. zsh-syntax-highlighting

GitHub: zsh-users/zsh-syntax-highlighting

Real-time command validation. Valid commands show green, invalid show red.

Install

1git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ~/.zsh/zsh-syntax-highlighting
2
3# Add to ~/.zshrc
4source ~/.zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh

Visual Feedback

Type git stats:

1git stats ← RED (invalid)

Type git status:

1git status ← GREEN (valid)

Catches typos before execution. No more "command not found" surprises.

4. fzf

GitHub: junegunn/fzf

Fuzzy finder for command history, files, and directories.

Install

1brew install fzf
2
3# Install keybindings
4$(brew --prefix)/opt/fzf/install

Sets up:

  • Ctrl+R - Search command history
  • Ctrl+T - Search files
  • Alt+C - Search directories and cd

Press Ctrl+R, type kubectl:

1> kubectl get pods -n production
2 kubectl logs -f api-7d8f9c8b-xk2m9
3 kubectl describe deployment api -n staging
4 kubectl port-forward svc/api 8080:80
5 15/15 ─────────────────────────────
6> kubectl

Navigate with arrows, press Enter to run. No more endless up-arrow pressing.

Press Ctrl+T, type part of filename:

1> next.config.js
2 tsconfig.json
3 src/config/api.ts
4 4/157 ──────────────────────────
5> config

Select and press Enter to insert into command.

5. zoxide

GitHub: ajeetdsouza/zoxide

Smart cd replacement that learns directory patterns.

Install

1brew install zoxide
2
3# Add to ~/.zshrc
4eval "$(zoxide init zsh)"

Usage

Instead of:

1cd ~/Projects/work/frontend/src/components/buttons

Just:

1z buttons

zoxide remembers frequently visited directories and jumps there directly.

Fuzzy matching works too:

1z blog art # β†’ ~/Projects/blog/articles

After a week, muscle memory kicks in:

1z proj # β†’ ~/Projects/
2z comp # β†’ ~/Projects/work/frontend/src/components/

Git Aliases

Save keystrokes on git commands.

Setup

1git config --global alias.st status
2git config --global alias.co checkout
3git config --global alias.br branch
4git config --global alias.cm 'commit -m'
5git config --global alias.ca 'commit --amend'
6git config --global alias.p push
7git config --global alias.pl pull
8git config --global alias.l 'log --oneline --graph --decorate'
9git config --global alias.undo 'reset HEAD~1 --soft'

Usage

Instead of:

1git status
2git checkout -b feature/dashboard
3git commit -m "feat: add dashboard"
4git push origin feature/dashboard

Now:

1git st
2git co -b feature/dashboard
3git cm "feat: add dashboard"
4git p origin feature/dashboard

Useful aliases:

git l - Pretty one-line log:

1* 2a0dfc5 (HEAD -> main) fix: update API endpoint
2* df8fa26 feat: add dashboard component
3* 1067bbf refactor: clean up old code

git undo - Undo last commit, keep changes:

1git cm "typo in message"
2git undo # Keeps changes staged
3git cm "fix: correct message"

History Configuration

Default zsh history is limited. Fix it:

1# Add to ~/.zshrc
2HISTFILE=~/.zsh_history
3HISTSIZE=50000
4SAVEHIST=50000
5setopt APPEND_HISTORY
6setopt SHARE_HISTORY

HISTSIZE/SAVEHIST=50000 - Store 50k commands instead of 2k

APPEND_HISTORY - Append to history file, don't overwrite

SHARE_HISTORY - Share history across all terminal tabs immediately

Complete .zshrc

1# Spaceship Prompt
2source /opt/homebrew/opt/spaceship/spaceship.zsh
3
4# zsh-autosuggestions
5source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh
6
7# zsh-syntax-highlighting
8source ~/.zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
9
10# fzf
11[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
12
13# zoxide
14eval "$(zoxide init zsh)"
15
16# History
17HISTFILE=~/.zsh_history
18HISTSIZE=50000
19SAVEHIST=50000
20setopt APPEND_HISTORY
21setopt SHARE_HISTORY
22
23# Useful aliases
24alias pip='python3 -m pip'
25alias vihost='sudo vi /etc/hosts'

Reload:

1source ~/.zshrc

15-Minute Setup Checklist

1. Install Homebrew

1/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

2. Install tools

1brew install spaceship fzf zoxide

3. Install zsh plugins

1git clone https://github.com/zsh-users/zsh-autosuggestions ~/.zsh/zsh-autosuggestions
2git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ~/.zsh/zsh-syntax-highlighting
3$(brew --prefix)/opt/fzf/install

4. Set up git aliases

1git config --global alias.st status
2git config --global alias.co checkout
3git config --global alias.br branch
4git config --global alias.cm 'commit -m'
5git config --global alias.ca 'commit --amend'
6git config --global alias.p push
7git config --global alias.pl pull
8git config --global alias.l 'log --oneline --graph --decorate'
9git config --global alias.undo 'reset HEAD~1 --soft'

5. Configure ~/.zshrc

Add configuration from "Complete .zshrc" section above.

6. Reload

1source ~/.zshrc

7. Verify

  • Prompt shows Spaceship
  • Typing shows suggestions (zsh-autosuggestions)
  • Invalid commands turn red (zsh-syntax-highlighting)
  • Ctrl+R searches history (fzf)
  • z jumps to directories (zoxide)
  • git st works (git aliases)

Total: 15 minutes.

Time Savings

  • zsh-autosuggestions: ~10s per command Γ— 200/day = 30+ min/day
  • zoxide: ~5s per cd Γ— 50/day = 4 min/day
  • fzf: ~20s per search Γ— 30/day = 10 min/day
  • Git aliases: ~3s per command Γ— 50/day = 2.5 min/day

Total: 46+ minutes/day, 3.8+ hours/week

Optional Tools

bat - Better cat with syntax highlighting:

1brew install bat
2alias cat='bat'

ripgrep - Faster grep:

1brew install ripgrep
2alias grep='rg'

tldr - Simplified man pages:

1brew install tldr

Wrapping Up

Shell productivity tools turn the terminal from functional to productive. Install these 5 tools, configure your .zshrc, and save hours per week.

Copy your .zshrc to new machines for instant productivity. No more painful setup days. Just clone dotfiles, run install commands, and you're productive.

Next laptop? Follow this checklist. 15 minutes to fully productive terminal.

Related Articles