Skip to content

NickMalberg/CLI-Setup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

CLI-Setup

A batteries-included .zshrc for macOS with fast defaults, friendly aliases, and practical developer workflows.

Use this as your day-to-day Zsh profile or as a reference you can cherry-pick from.

Highlights

  • PATH hygiene and sensible defaults (Google Cloud SDK, Mojo, Protobuf, pipx)
  • Modern prompt via Starship, tab completion, and sane Zsh options
  • Git power shortcuts (single-letter base g, commit helper, rich logs)
  • Python virtual environment helpers (act, mkvenv)
  • dbt build helpers (db, db+, db++)
  • Elastic dot navigation (.., ..., up to 10 levels)
  • Handy utilities (mkcd, extract for common archive types)
  • Fuzzy note-taking workflow with previews (notes, n), plus --today templated notes
  • GitHub PR comments overview with one command (ghprc)

Quick start

  1. Back up your current Zsh config
cp -a ~/.zshrc ~/.zshrc.bak.$(date +%Y%m%d-%H%M%S)
  1. Use this .zshrc (symlink or copy)
ln -sf /Users/nick/Documents/GitHub/CLI-Setup/.zshrc ~/.zshrc
  1. Reload your shell
exec zsh
# or
source ~/.zshrc

Dependencies and nice-to-haves

This config will work without everything below, but you’ll get the best experience with:

  • Starship prompt: brew install starship
  • lsd (better ls): brew install lsd
  • fzf (fuzzy finder): brew install fzf
  • bat or glow (note preview): brew install bat or brew install glow
  • GitHub CLI: brew install gh
  • dbt (optional if you use the dbt helpers)
  • Google Cloud SDK (optional)
  • Protobuf protoc (optional)

Note: Some PATH entries in the file are intentionally optional (Mojo, Google Cloud, Protobuf, pipx). Remove or adjust them if they don’t apply to your machine.

Daily shortcuts you’ll actually use

Git (base alias g)

  • Status: gs or gst (short + branch view)
  • Add: ga, gaa (all)
  • Commit: gc, gcmsg "Message", amend with gca
  • Quick commit widget: press Ctrl+G then Ctrl+M to insert git commit -m "" with the cursor in the quotes
  • Branching: gco (checkout), gcb (new branch), or gsw / gswc
  • Pull/push: gpl, gp, force-with-lease: gpf
  • Diffs/logs: gd, gds, pretty log: gl
  • Stash/clean: gsta, gstp, gclean

Python virtual env helpers

  • Activate an env: act (auto-detects venv, .venv, env, or ~/.venv)
  • Create + activate: mkvenv (uses the system Python’s venv and upgrades tooling)

dbt build shortcuts

  • db my_modeldbt build -s my_model
  • db+ my_modeldbt build -s +my_model
  • db++ my_modeldbt build -s +my_model+

Notes with fzf

  • Open the note picker: notes or n
  • Create a date-based note: notes todo --today
  • Inside the picker:
    • Ctrl-D: delete selected file (with confirmation)
    • Ctrl-Y: copy the selected filename back into the query
    • Ctrl-U: clear the query
  • Previews use glow if available, otherwise bat, otherwise cat
  • Default directory is ~/notes (override with NOTES_DIR)

GitHub PR comments overview

  • Run ghprc inside a repo with an open PR to print a clean, readable list of review comments across files.

Navigation and utilities

  • Elastic dots: .., ..., up to .......... to jump multiple levels
  • Quick cd: mkcd project-name (creates directory then cds into it)
  • Extract archives: extract file.(zip|tar.gz|tgz|rar|...)
  • Fuzzy search: search (alias to fzf)

Customization

  • Starship prompt: remove or tweak eval "$(starship init zsh)" if you use a different prompt
  • PATH entries: trim anything you don’t use (Mojo, Google Cloud SDK, Protobuf, etc.)
  • Company-specific dirs: update or remove cdplan, cdlake
  • dbt path/aliases: adjust if your dbt binary lives elsewhere
  • Notes directory: set export NOTES_DIR="/absolute/path/to/notes"

Troubleshooting

  • If the prompt doesn’t change, install Starship and restart the shell
  • If notes previews aren’t colored, install glow or bat
  • If ghprc warns about a missing PR, ensure your branch has an open PR and gh is authenticated (gh auth login)
  • If ls looks unchanged, verify lsd is installed and on your PATH

License

MIT. See LICENSE.

About

Some basic zsh settings I like to have in one place

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages