My Dev Box Setup Script

Published 2026-3-7


Every time I spin up a fresh machine I run the same setup. I got tired of doing it manually, so I wrote a single script that handles everything: zsh, Oh My Zsh, uv, and an SSH key for GitHub.

Run it with:

curl -LsSf https://rlafuente.com/static/setup.sh | sh

That's it. Here's the full script:

#!/bin/sh
# Dev box setup — curl -LsSf https://rlafuente.com/static/setup.sh | sh
set -e

echo "==> Installing essentials"
sudo apt-get update && sudo apt-get install -y zsh git curl

echo "==> Setting zsh as default shell"
sudo chsh -s "$(which zsh)" "$(whoami)"

echo "==> Installing Oh My Zsh"
if [ ! -d "$HOME/.oh-my-zsh" ]; then
  RUNZSH=no sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
else
  echo "    already installed"
fi

echo "==> Installing uv"
if ! command -v uv >/dev/null; then
  curl -LsSf https://astral.sh/uv/install.sh | sh
  . "$HOME/.local/bin/env" 2>/dev/null || true
else
  echo "    already installed"
fi

echo "==> Generating SSH key for GitHub"
KEY="$HOME/.ssh/id_ed25519"
if [ ! -f "$KEY" ]; then
  mkdir -p "$HOME/.ssh" && chmod 700 "$HOME/.ssh"
  ssh-keygen -t ed25519 -C "$(whoami)@$(hostname)" -f "$KEY" -N ""
  eval "$(ssh-agent -s)" >/dev/null
  ssh-add "$KEY" 2>/dev/null
fi

echo ""
LINK="\033]8;;https://github.com/settings/ssh/new\033\\https://github.com/settings/ssh/new\033]8;;\033\\"
echo "Add this key to GitHub -> $(printf "$LINK")"
echo ""
cat "$KEY.pub"
echo ""
echo "Done! Restart your shell to pick up changes."

Every step is idempotent — rerun it as many times as you want. At the end it prints your new public key and a clickable link to add it to GitHub.