Workshop 01 · DevOps

Set up your terminal for better DX

A concepts-and-toolkit tour for data scientists and AI engineers. We build a terminal that briefs you, swap the rusty Unix defaults for modern tools, make project environments reproducible, and wrap the whole thing in dotfiles you can redeploy on a fresh machine in one command.

Most of us inherited our terminal. The default shell, the default ls, a prompt that tells you almost nothing, and a stack of one-off pip installs that only you know about. It works — until you get a new laptop, spin up a cloud VM, or onboard a teammate, and discover that “your setup” was never written down anywhere.

This workshop fixes that. It is deliberately a tour, not a from-scratch build — we will lean on good defaults and copy-paste config rather than hand-rolling everything. By the end you will have a noticeably better day-to-day terminal and a dotfiles repo that makes it reproducible.

It is written for data scientists and AI engineers specifically, so the through-line is the stuff that actually bites us: Python and Node versions fighting each other, environments that don’t reproduce, secrets leaking into notebooks, and juggling local and hosted models. Everything works on macOS, Windows (via WSL2), and Linux — platform-specific steps are called out as we go.

How to run this. It is paced for about two hours as a guided session, in eight short modules with a checkpoint each. Solo? Work straight through. Teaching it? Each module stands alone, so you can trim to a 60-minute version by keeping modules 1–5 and assigning the rest as homework.

Module 0 — Pre-flight (~10 min)

Before the fun parts, everyone needs three things: a decent terminal, a package manager, and a font with icon glyphs. Pick your platform.

macOS

# 1. A terminal. The built-in Terminal.app is fine, but iTerm2 or Ghostty are nicer.
# 2. Homebrew — the package manager we'll use for everything else.
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

# Follow the printed instructions to add brew to your PATH, then:
brew --version

Windows — install WSL2, then treat it as Linux

Do not try to do data work in PowerShell or Git Bash. Install the Windows Subsystem for Linux and live inside a real Ubuntu. From an admin PowerShell:

wsl --install            # installs WSL2 + Ubuntu, then reboot

Open Windows Terminal, start the Ubuntu profile, and from then on you are in Linux. Install Homebrew on Linux so the rest of this workshop is identical to the Mac path:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"' >> ~/.bashrc
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"

Windows / WSL · Keep your code on the Linux filesystem (~/code), not under /mnt/c/.... Filesystem calls across the Windows boundary are slow, and that is exactly what git, rg, and package managers do thousands of times. VS Code’s “WSL” remote extension edits Linux files with a native Windows UI, so you lose nothing.

Linux

Use your distro’s package manager for system bits, but install Homebrew too — it carries newer versions of the CLI tools below than most distro repos:

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

Everyone — install a Nerd Font so prompts and eza icons render. Grab JetBrainsMono Nerd Font or Hack Nerd Font, install it, and select it in your terminal’s settings.

brew install --cask font-jetbrains-mono font-hack-nerd-font   # macOS

Checkpoint 0. brew --version works, and your terminal is using a Nerd Font (type a few emoji and a “ icon — no tofu boxes).

Module 1 — Why dotfiles, conceptually (~10 min)

A dotfile is any of those ~/.zshrc, ~/.gitconfig, ~/.config/... files that configure your tools. “Dotfiles” as a practice means: keep them in a git repo, symlink them into place, and script the install. Your machine’s personality becomes code — versioned, diffable, reviewable, and reproducible.

For data and AI work this matters more than for most, because our environments are unusually fragile:

  • You move between a laptop, a beefy workstation, a cloud GPU box, and ephemeral devcontainers — and you want the same muscle memory on all of them.
  • “Works on my machine” is a real research-reproducibility problem, not just a deploy problem.
  • Onboarding a collaborator should be git clone && ./bootstrap.sh, not a day of Slack archaeology.

The mental model for the rest of the workshop:

LayerQuestion it answersTool we’ll use
PackagesWhat is installed on this machine?Homebrew + a Brewfile
ShellWhat happens when I open a terminal?zsh + a plugin manager
PromptWhat is this terminal telling me?Starship
ToolsWhat do everyday commands feel like?eza, bat, fd, rg, fzf, …
ProjectsWhat environment does this repo need?mise, uv, direnv
ReproduceHow do I rebuild all of the above?a dotfiles repo + bootstrap script

We’ll build bottom-up and tie it together in Module 8.

Checkpoint 1. You can say, in one sentence, why a fresh-laptop setup should be a script and not a memory.

Module 2 — Packages as a manifest: the Brewfile (~15 min)

Installing tools by hand is how machines drift apart. A Brewfile is a plain-text list of every formula (CLI tool) and cask (GUI app) you want, so the whole set installs — and re-installs — in one command.

Create one from what you already have, or start fresh:

# Snapshot the current machine into a Brewfile
brew bundle dump --file=~/Brewfile --describe

A starter Brewfile for this workshop:

# ~/Brewfile — the modern CLI toolkit we install in Module 5
brew "eza"        # modern ls
brew "bat"        # cat with syntax highlighting
brew "fd"         # friendly find
brew "ripgrep"    # fast grep (rg)
brew "fzf"        # fuzzy finder
brew "zoxide"     # smart cd
brew "atuin"      # searchable shell history
brew "git-delta"  # readable git diffs
brew "lazygit"    # git TUI
brew "jq"         # JSON on the command line
brew "starship"   # the prompt (Module 4)
brew "mise"       # runtime version manager (Module 6)
brew "direnv"     # per-directory env (Module 6)
brew "uv"         # fast Python package manager (Module 6)

Install everything in it:

brew bundle install --file=~/Brewfile

Windows / WSL · Homebrew on Linux installs formulae (CLI tools) only — cask lines are macOS-only GUI apps, so drop or comment them in your WSL Brewfile. Your GUI apps stay on the Windows side (winget install ...).

Checkpoint 2. brew bundle install runs clean, and you have a Brewfile you could hand to a colleague. This file goes into your dotfiles repo in Module 8.

Module 3 — A shell worth living in: zsh + plugins (~15 min)

zsh is the default shell on macOS and a one-line install everywhere else. On its own it’s only marginally better than bash — the wins come from a few plugins and some history settings. We’ll use Antidote, a fast zsh plugin manager.

brew install antidote

Make a plugin list at ~/.zsh_plugins.txt:

zsh-users/zsh-autosuggestions       # ghost-text suggestions from your history
zsh-users/zsh-syntax-highlighting   # green = valid command, red = typo, before you hit enter
zsh-users/zsh-completions           # a big bundle of extra completions

Then wire it into ~/.zshrc, along with history settings that make your shell remember things properly across sessions:

# ~/.zshrc

# History: large, de-duplicated, shared across every open terminal
export HISTFILE=~/.zsh_history
export HISTSIZE=50000
export SAVEHIST=50000
setopt SHARE_HISTORY          # all sessions see the same history
setopt HIST_IGNORE_ALL_DUPS   # drop older duplicates
setopt HIST_IGNORE_SPACE      # a leading space keeps a command out of history (handy for secrets)

# Completion system — load before plugins
autoload -Uz compinit && compinit

# Load plugins via Antidote
source "$(brew --prefix)/opt/antidote/share/antidote/antidote.zsh"
antidote load ~/.zsh_plugins.txt

Open a new terminal. Start typing a command you’ve run before — the grey ghost-text completion is autosuggestions; press the right arrow to accept it. Mistype a command and watch it turn red before you run it. Those two plugins alone change the feel of the shell.

Windows / WSL · Ubuntu ships with bash. Install and switch to zsh once: sudo apt install zsh && chsh -s $(which zsh), then reopen the terminal. Everything above is identical from there.

Checkpoint 3. New terminals give you ghost-text suggestions and red/green command highlighting, and history survives across windows.

Module 4 — A prompt that briefs you: Starship (~10 min)

The default prompt is a dead $. Starship turns it into a status line: current directory, git branch and dirtiness, and — crucially for us — the active Python/Node/Rust version and virtual environment, shown only when relevant. No more “wait, which env am I in?”

brew install starship

Add the init line to the end of ~/.zshrc:

eval "$(starship init zsh)"

A starting config at ~/.config/starship.toml, tuned for data work — it surfaces the language versions and conda/venv that you actually care about:

# ~/.config/starship.toml
add_newline = true

[python]
symbol = " "
format = 'via [${symbol}${version}( ($virtualenv))]($style) '

[nodejs]
symbol = " "

[git_branch]
symbol = " "

[git_status]
style = "yellow"

[cmd_duration]
min_time = 2000          # show how long slow commands took — useful for training runs
format = "took [$duration](bold yellow) "

cd into a Python project and the prompt now shows the interpreter version and active venv without you asking. That single feature prevents a whole category of “I trained on the wrong environment” mistakes.

Checkpoint 4. Your prompt shows the git branch in a repo and the Python version/venv in a Python project.

Module 5 — The modern CLI toolkit (~25 min)

This is the heart of the tour. A handful of tools, mostly written in Rust, replace the crusty defaults with faster, friendlier, colour-aware versions. Install them (they’re already in your Module 2 Brewfile):

brew install eza bat fd ripgrep fzf zoxide atuin git-delta lazygit jq

Now the tour. Run each one — the point is to feel the difference, not memorise flags.

eza → a better ls. Icons, git status, tree view.

eza -l --icons --git           # long listing with git state per file
eza --tree --level=2 --git-ignore

bat → a better cat. Syntax highlighting, line numbers, git gutter.

bat src/app.py                 # paged, highlighted; even powers `man` with the env var below

fd → a better find. Sane syntax, respects .gitignore.

fd ".csv$" data/              # every CSV under data/, fast

ripgrep (rg) → a better grep. The fastest way to search a codebase; this is the engine inside many editors’ search.

rg "TODO" --type py           # all Python TODOs, recursively, skipping .gitignore

fzf → fuzzy finder. Pipe anything into it for an interactive filter. Its killer feature is Ctrl-R, which turns shell-history search into a fuzzy picker.

fd . notebooks/ | fzf         # fuzzy-pick a notebook
# then add fzf key-bindings + completion to ~/.zshrc:
eval "$(fzf --zsh)"           # gives you Ctrl-R history search and Ctrl-T file picker

zoxide → a smarter cd. It learns your most-used directories so you jump by a fragment of the name.

eval "$(zoxide init zsh)"     # add to ~/.zshrc
# then:
z proj                        # jumps to ~/Projects/Mokotahi/... after you've visited it once

atuin → your shell history, in a database. Full-text searchable, per-directory, syncable across machines. It takes over Ctrl-R with a much better UI.

eval "$(atuin init zsh)"      # add to ~/.zshrc

git-delta + lazygit → git you can read. Delta makes diffs legible; lazygit is a terminal UI for staging, committing, and browsing history.

# ~/.gitconfig
[core]
    pager = delta
[delta]
    navigate = true
    line-numbers = true
[interactive]
    diffFilter = delta --color-only
lazygit                        # stage hunks, commit, view log — all keyboard-driven

jq → JSON on the command line. Essential for poking at API responses and model outputs.

curl -s https://api.example.com/run | jq '.choices[0].message.content'

Now make a few of them your defaults with aliases in ~/.zshrc:

# ~/.zshrc — aliases
alias ls='eza --icons --group-directories-first'
alias ll='eza -l --icons --git --group-directories-first'
alias la='eza -la --icons --git'
alias cat='bat'
alias find='fd'
export MANPAGER="sh -c 'col -bx | bat -l man -p'"   # bat-powered, highlighted man pages

Exercise (5 min). Pick a real task you did this week — find a file, search a codebase, read a config, inspect a JSON response — and redo it with the new tool. Notice what’s faster.

Checkpoint 5. ls, cat, and find use the modern tools; Ctrl-R opens a fuzzy history search; z <fragment> jumps to a directory.

Module 6 — Reproducible project environments (~20 min)

This is the module that earns its keep for data and AI work. Three small tools remove most environment pain: mise (the right language versions per project), uv (fast Python packaging and venvs), and direnv (auto-load a project’s environment when you cd into it).

mise — one version manager for everything. Instead of pyenv + nvm + rbenv, mise pins Node, Python, and more per directory, and switches automatically.

brew install mise
echo 'eval "$(mise activate zsh)"' >> ~/.zshrc

# Global defaults
mise use --global node@lts
mise use --global python@3.12

# Per-project: writes a mise.toml the repo can commit
cd my-research-project
mise use python@3.11 node@20

uv — Python packaging that isn’t slow. A drop-in, much faster replacement for pip and venv, with reproducible lockfiles. This is the modern default for Python projects.

brew install uv

uv init                 # scaffold a pyproject.toml
uv add pandas polars duckdb scikit-learn
uv run python train.py  # runs in the project's managed venv, no manual activate
uv sync                 # rebuild the exact environment from the lockfile — reproducibility

direnv — environments that load themselves. Drop an .envrc in a project and direnv loads it on cd in, unloads it on the way out. Combine it with mise/uv so the right tools and variables are always live.

brew install direnv
echo 'eval "$(direnv hook zsh)"' >> ~/.zshrc
# my-research-project/.envrc
use mise                          # adopt mise's tool versions here
export DATA_DIR="$PWD/data"
export PYTHONPATH="$PWD/src"
dotenv_if_exists .env             # load local .env if present (see Module 7 on secrets)
direnv allow                      # one-time approval per .envrc (it won't run un-approved files)

Now cd-ing into the project gives you the right Python, the right packages, and the right environment variables, automatically — and cd-ing out cleans them up. That is reproducibility you don’t have to think about.

Exercise (8 min). Take one of your projects. Add a mise.toml pinning its Python version, an .envrc exporting PYTHONPATH, and run uv sync. Open a new terminal, cd in, and confirm the prompt shows the right version with everything live.

Checkpoint 6. Entering a project auto-selects its language versions and env vars; uv sync rebuilds its dependencies from a lockfile.

Module 7 — AI in the terminal, and secrets hygiene (~15 min)

Two things AI engineers want from the terminal: easy access to models (hosted and local), and a way to handle API keys that doesn’t end up on GitHub.

Coding agents in the terminal. Both major CLIs install in one line and live where your code is:

# Claude Code
curl -fsSL https://claude.ai/install.sh | bash

# OpenAI Codex CLI
curl -fsSL https://chatgpt.com/codex/install.sh | CODEX_NON_INTERACTIVE=1 sh

Local models. For offline work, cheap iteration, or private data, run models on your own machine:

brew install --cask ollama-app lm-studio   # macOS
ollama run llama3.2                          # pull + chat with a local model
ollama serve                                 # OpenAI-compatible API on localhost:11434

Windows / WSL · Run Ollama as a native Windows app for GPU access, then reach it from WSL at http://localhost:11434 — WSL2 forwards localhost to Windows automatically. LM Studio is Windows-native too.

Secrets hygiene — the part people skip until it bites them. Never hard-code an API key in a notebook or commit a .env. The minimum discipline:

# .gitignore — in every repo
.env
.env.*
*.key
.ipynb_checkpoints/

Then load keys from a local .env via direnv (Module 6) so they’re present in the project but never in the code:

# .env  (git-ignored)
ANTHROPIC_API_KEY=sk-ant-...
OPENAI_API_KEY=sk-...
# .envrc
dotenv_if_exists .env

For anything shared across machines or teammates, graduate from files to a secrets manager so keys are fetched at runtime, never written to disk:

brew install doppler
doppler run -- uv run python train.py   # injects secrets as env vars for this command only

Checkpoint 7. You can call a hosted or local model from the terminal, your keys come from .env/a secrets manager via the environment, and git status shows no secret files staged.

Module 8 — Make it yours: the dotfiles repo (~15 min)

Everything so far lives in scattered files. Now we make it reproducible. The pattern: one git repo holds the real files; symlinks point the system at them; a bootstrap script installs everything.

mkdir -p ~/dotfiles && cd ~/dotfiles && git init

# Move your real config files into the repo
mv ~/.zshrc           ./zshrc
mv ~/.zsh_plugins.txt ./zsh_plugins.txt
mv ~/.gitconfig       ./gitconfig
mkdir -p config && mv ~/.config/starship.toml ./config/starship.toml
cp ~/Brewfile         ./Brewfile

A small, idempotent bootstrap.sh — safe to run repeatedly — that installs packages and links everything into place:

#!/usr/bin/env bash
set -euo pipefail
DOTFILES="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

# 1. Packages
brew bundle install --file="$DOTFILES/Brewfile"

# 2. Symlinks (ln -sf is safe to re-run)
ln -sf "$DOTFILES/zshrc"           "$HOME/.zshrc"
ln -sf "$DOTFILES/zsh_plugins.txt" "$HOME/.zsh_plugins.txt"
ln -sf "$DOTFILES/gitconfig"       "$HOME/.gitconfig"
mkdir -p "$HOME/.config"
ln -sf "$DOTFILES/config/starship.toml" "$HOME/.config/starship.toml"

echo "Done. Restart your terminal."
chmod +x bootstrap.sh
git add -A && git commit -m "Initial dotfiles"
# push to a private GitHub repo

Because the live files are now symlinks back into the repo, editing ~/.zshrc edits the repo. The payoff: on any new Mac, WSL, or Linux box, your entire environment is:

git clone https://github.com/you/dotfiles ~/dotfiles
cd ~/dotfiles && ./bootstrap.sh

Going further. When the symlink list grows, GNU Stow manages the linking for you. Keep machine-specific or secret values out of the repo (use a git-ignored *.local file the bootstrap sources if present), and split macOS-only vs Linux-only steps with a simple if.

Checkpoint 8. Your config is a committed git repo, the live files are symlinks into it, and ./bootstrap.sh runs clean a second time without errors.

Where to go next

You now have a terminal that briefs you, a toolkit that’s faster across the board, project environments that reproduce, and a one-command setup for the next machine. From here:

  • Live in it for a week before adding more. Muscle memory beats more plugins.
  • tmux if you SSH into remote/GPU boxes a lot — persistent sessions that survive disconnects.
  • Neovim or your editor’s terminal config, version-controlled in the same repo.
  • Per-host overrides so one repo serves your laptop, workstation, and cloud boxes.

A worked, opinionated reference that does everything above — Brewfile, Antidote, Starship, the full toolkit, mise/uv/direnv, AI tooling, and an idempotent bootstrap — is my own dotfiles, which this workshop is distilled from. Fork it, delete what you don’t want, and make it yours.

Bespoke

Want this run for your team?

I run this as a live, hands-on session for data and ML teams — everyone leaves with a working dotfiles repo and a shared baseline, so "works on my machine" stops being a standing joke. Half a day, on-site in Jakarta / Singapore / KL, or remote anywhere.

Get in touch with a couple of sentences about your team's stack and where the setup pain is.