GUIDA 📖 4 min lettura

macOS Dev Environment Setup

Setup completo da zero: Homebrew, Git, Node.js, Python, Docker e tutti i tools essenziali

macOS Dev Environment Setup

Indice

  1. Homebrew
  2. Terminal & Shell
  3. Git & GitHub CLI
  4. Node.js (fnm)
  5. Python (pyenv + uv)
  6. Editor & IDE
  7. Docker
  8. Tools Extra
  9. Backup Dotfiles

1

Homebrew - Package Manager

Homebrew è il package manager essenziale per macOS. Installa tutto il resto.

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

# Configurazione PATH (Apple Silicon - M1/M2/M3)
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"

ℹ️ Intel vs Apple Silicon

Su Mac Intel, Homebrew si installa in /usr/local. Su Apple Silicon (M1/M2/M3) in /opt/homebrew.

Comandi Essenziali

brew update && brew upgrade    # Aggiorna tutto
brew search nome-pacchetto     # Cerca un pacchetto
brew install nome-pacchetto    # Installa
brew install --cask nome-app   # Installa app GUI
brew list                      # Lista installati
brew cleanup                   # Pulizia

2

Terminal & Shell

iTerm2 + Oh My Zsh

# iTerm2
brew install --cask iterm2

# Oh My Zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

# Plugin essenziali
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

Configura ~/.zshrc

# Modifica la riga plugins
plugins=(git zsh-autosuggestions zsh-syntax-highlighting)

Font Nerd Fonts

brew tap homebrew/cask-fonts
brew install --cask font-fira-code-nerd-font
brew install --cask font-jetbrains-mono-nerd-font

3

Git & GitHub CLI

brew install git gh

Configurazione Git

git config --global user.name "Il Tuo Nome"
git config --global user.email "tua@email.com"
git config --global core.editor "code --wait"
git config --global init.defaultBranch main

# Alias utili
git config --global alias.co checkout
git config --global alias.br branch
git config --global alias.st status
git config --global alias.lg "log --oneline --graph --all"

GitHub CLI Login

gh auth login
gh auth status

SSH Key

ssh-keygen -t ed25519 -C "tua@email.com"
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519
pbcopy < ~/.ssh/id_ed25519.pub
# Aggiungi su GitHub: Settings -> SSH Keys -> New

4

Node.js con fnm

fnm (Fast Node Manager) è il version manager consigliato per Node.js. Più veloce di nvm.

brew install fnm

# Aggiungi a ~/.zshrc
echo 'eval "$(fnm env --use-on-cd --shell zsh)"' >> ~/.zshrc
source ~/.zshrc

# Installa Node.js
fnm install --lts
fnm default lts-latest

# Verifica
node --version
npm --version

Package Manager Globali

npm install -g pnpm   # pnpm (consigliato)
npm install -g yarn   # yarn

5

Python con pyenv + uv

# Installa pyenv
brew install pyenv

# Aggiungi a ~/.zshrc
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.zshrc
echo 'command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.zshrc
echo 'eval "$(pyenv init -)"' >> ~/.zshrc
source ~/.zshrc

# Installa Python
pyenv install 3.12
pyenv global 3.12
python --version

Installa uv (Package Manager Veloce)

brew install uv

# Comandi essenziali
uv init mio-progetto      # Crea nuovo progetto
uv add requests pandas    # Aggiungi dipendenze
uv run python main.py     # Esegui script

6

Editor & IDE

brew install --cask visual-studio-code

# Estensioni essenziali
code --install-extension ms-python.python
code --install-extension dbaeumer.vscode-eslint
code --install-extension esbenp.prettier-vscode
code --install-extension bradlc.vscode-tailwindcss
code --install-extension eamodio.gitlens
code --install-extension github.copilot

Altri Editor

brew install --cask cursor           # Cursor (VS Code + AI)
brew install --cask jetbrains-toolbox # JetBrains

7

Docker

brew install --cask docker

ℹ️ Alternativa Leggera

Per un’alternativa più leggera a Docker Desktop, considera Colima:

brew install colima docker
colima start

8

Tools Extra

CLI Utilities

brew install wget curl jq yq tree htop bat eza ripgrep fzf tldr
ToolDescrizioneSostituisce
batcat con syntax highlightingcat
ezals moderno con icone e gitls
ripgrepgrep velocissimogrep
fzffuzzy finder interattivo-
tldrman pages semplificatiman

App GUI Utili

brew install --cask raycast rectangle alt-tab stats hiddenbar

9

Backup Dotfiles

# Esporta lista pacchetti
brew bundle dump --file=~/dotfiles/Brewfile --force

# Copia configurazioni
cp ~/.zshrc ~/dotfiles/
cp ~/.gitconfig ~/dotfiles/

Quick Start - Ripristino

Dopo aver installato Homebrew e creato un Brewfile, puoi ripristinare tutto con:

brew bundle install --file=~/Brewfile