Skip to content

Instantly share code, notes, and snippets.

@cmaneu
Last active May 3, 2026 14:42
Show Gist options
  • Select an option

  • Save cmaneu/55f3b9396ca5f395e09a2a26ebdf108b to your computer and use it in GitHub Desktop.

Select an option

Save cmaneu/55f3b9396ca5f395e09a2a26ebdf108b to your computer and use it in GitHub Desktop.
Mac setup
#!/usr/bin/env bash
set -euo pipefail
if [[ -z "${GIST_RAW_BASE:-}" ]]; then
echo "GIST_RAW_BASE is required."
echo
echo "Example:"
echo ' GIST_RAW_BASE="https://gist.githubusercontent.com/YOUR_GITHUB_USERNAME/YOUR_GIST_ID/raw" bash -c '\''curl -fsSL "$GIST_RAW_BASE/bootstrap-dev-mac.sh" | bash'\'''
exit 1
fi
BOOTSTRAP_DIR="$HOME/.mac-dev-bootstrap"
mkdir -p "$BOOTSTRAP_DIR"
cd "$BOOTSTRAP_DIR"
download_from_gist() {
local file="$1"
echo "==> Downloading $file"
curl -fsSL "${GIST_RAW_BASE%/}/$file" -o "$file"
}
download_from_gist "Brewfile"
download_from_gist "post-install.sh"
chmod +x post-install.sh
echo "==> Installing Homebrew if needed"
if ! command -v brew >/dev/null 2>&1; then
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
fi
echo "==> Configuring Homebrew in this shell"
if [[ -x /opt/homebrew/bin/brew ]]; then
BREW="/opt/homebrew/bin/brew"
elif [[ -x /usr/local/bin/brew ]]; then
BREW="/usr/local/bin/brew"
else
echo "Homebrew was not found after installation."
exit 1
fi
eval "$("$BREW" shellenv)"
SHELLENV_LINE="eval \"\$($BREW shellenv)\""
touch "$HOME/.zprofile"
grep -qxF "$SHELLENV_LINE" "$HOME/.zprofile" || echo "$SHELLENV_LINE" >> "$HOME/.zprofile"
echo "==> Installing software with Brewfile"
brew bundle --file="$BOOTSTRAP_DIR/Brewfile"
echo "==> Running post-install"
"$BOOTSTRAP_DIR/post-install.sh"
echo "==> Done"
brew "git"
brew "git-lfs"
brew "gh"
brew "powershell"
brew "ollama"
brew "llmfit"
cask "docker-desktop"
cask "visual-studio-code"
cask "visual-studio-code@insiders"
cask "copilot-cli"
#!/usr/bin/env bash
set -euo pipefail
echo "==> Running post-install steps"
mkdir -p "$HOME/Code"
echo "==> Initializing Git LFS"
git lfs install
echo "==> Starting Ollama service"
if command -v brew >/dev/null 2>&1; then
brew services start ollama || true
fi
echo "==> Starting Docker Desktop"
open -a Docker || true
resolve_cmd() {
local command_name="$1"
local fallback="$2"
if command -v "$command_name" >/dev/null 2>&1; then
command -v "$command_name"
elif [[ -x "$fallback" ]]; then
printf '%s\n' "$fallback"
else
return 1
fi
}
install_vscode_extensions() {
local code_bin="${1:-}"
if [[ -z "$code_bin" ]]; then
return 0
fi
echo "==> Installing VS Code extensions using: $code_bin"
local extensions=(
"ms-vscode-remote.remote-containers"
"GitHub.copilot"
"GitHub.copilot-chat"
"GitHub.vscode-pull-request-github"
"GitHub.vscode-github-actions"
"EditorConfig.EditorConfig"
"ms-azuretools.vscode-docker"
)
for extension in "${extensions[@]}"; do
"$code_bin" --install-extension "$extension" --force || true
done
}
CODE_BIN="$(resolve_cmd code "/Applications/Visual Studio Code.app/Contents/Resources/app/bin/code" || true)"
CODE_INSIDERS_BIN="$(resolve_cmd code-insiders "/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/bin/code-insiders" || true)"
install_vscode_extensions "$CODE_BIN"
install_vscode_extensions "$CODE_INSIDERS_BIN"
echo "==> Verifying tools"
git --version || true
git lfs version || true
gh --version || true
pwsh --version || true
ollama --version || true
llmfit --version || true
copilot --version || true
docker --version || true
if [[ -n "${CODE_BIN:-}" ]]; then
"$CODE_BIN" --version || true
fi
if [[ -n "${CODE_INSIDERS_BIN:-}" ]]; then
"$CODE_INSIDERS_BIN" --version || true
fi
echo "==> Opening VS Code"
open -a "Visual Studio Code" "$HOME/Code" || true

GIST_RAW_BASE="https://gist.githubusercontent.com/cmaneu/55f3b9396ca5f395e09a2a26ebdf108b/raw" bash -c 'curl -fsSL "$GIST_RAW_BASE/bootstrap-dev-mac.sh" | bash'

Download then run

export GIST_RAW_BASE="https://gist.githubusercontent.com/cmaneu/55f3b9396ca5f395e09a2a26ebdf108b/raw"

mkdir -p "$HOME/.mac-dev-bootstrap"

curl -fsSL "$GIST_RAW_BASE/bootstrap-dev-mac.sh" \
  -o "$HOME/.mac-dev-bootstrap/bootstrap-dev-mac.sh"

chmod +x "$HOME/.mac-dev-bootstrap/bootstrap-dev-mac.sh"

"$HOME/.mac-dev-bootstrap/bootstrap-dev-mac.sh"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment