Last active
April 16, 2026 05:37
-
-
Save vitorcalvi/b606ec323bed2afc5dd146b676e01f51 to your computer and use it in GitHub Desktop.
configure Macbook
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| set -euo pipefail | |
| # ============================================ | |
| # Output Formatting Helpers (Bug #1 Fixed) | |
| # ============================================ | |
| RED='\033[0;31m' | |
| GREEN='\033[0;32m' | |
| YELLOW='\033[1;33m' | |
| BLUE='\033[0;34m' | |
| NC='\033[0m' # No Color | |
| info() { echo -e "${BLUE}[INFO]${NC} $1"; } | |
| ok() { echo -e "${GREEN}[OK]${NC} $1"; } | |
| warn() { echo -e "${YELLOW}[WARN]${NC} $1"; } | |
| # ============================================ | |
| # Homebrew Bootstrap & Configuration | |
| # ============================================ | |
| export HOMEBREW_NO_AUTO_UPDATE=1 | |
| if ! command -v brew &>/dev/null; then | |
| info "Homebrew not found. Installing..." | |
| /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" | |
| fi | |
| info "Evaluating Homebrew shell environment..." | |
| eval "$(/opt/homebrew/bin/brew shellenv)" | |
| ok "Homebrew is ready." | |
| # ============================================ | |
| # Homebrew Formulae | |
| # ============================================ | |
| FORMULAE=( | |
| git git-lfs gh tmux | |
| pipx pyenv postgresql@14 nvm ollama agent-browser | |
| ffmpeg scrcpy vercel-cli cloudflare-wrangler stripe-cli | |
| wget mas transmission-cli asitop | |
| ) | |
| info "Installing Homebrew formulae..." | |
| brew install "${FORMULAE[@]}" || true | |
| info "Installing Crush AI coding agent..." | |
| brew tap charmbracelet/tap | |
| brew install charmbracelet/tap/crush || true | |
| info "Setting up agent-browser (downloading Chromium)..." | |
| agent-browser install || true | |
| # ============================================ | |
| # Homebrew Casks (GUI Applications) | |
| # ============================================ | |
| CASKS=( | |
| iterm2 visual-studio-code sublime-text | |
| claude-code trae jan lm-studio google-chrome | |
| android-platform-tools android-file-transfer balenaetcher | |
| miro rectangle discord whatsapp macs-fan-control tailscale tradingview | |
| ) | |
| info "Installing Homebrew casks..." | |
| brew install --cask "${CASKS[@]}" || true | |
| # ============================================ | |
| # GitHub CLI Extensions | |
| # ============================================ | |
| info "Installing GitHub CLI extensions..." | |
| gh extension install github/gh-copilot 2>/dev/null || true | |
| # ============================================ | |
| # Bun (Bug #2 Fixed) | |
| # ============================================ | |
| if ! command -v bun &> /dev/null; then | |
| info "Installing Bun..." | |
| curl -fsSL https://bun.sh/install | bash || true | |
| fi | |
| # ============================================ | |
| # Oh My Zsh & Terminal Setup (Bugs #2, #3, #4 Fixed) | |
| # ============================================ | |
| info "Setting up Oh My Zsh and Powerlevel10k..." | |
| if [ ! -d "$HOME/.oh-my-zsh" ]; then | |
| sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended || true | |
| fi | |
| ZSH_CUSTOM="${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}" | |
| if [ ! -d "$ZSH_CUSTOM/themes/powerlevel10k" ]; then | |
| git clone --depth=1 https://github.com/romkatv/powerlevel10k.git \ | |
| "$ZSH_CUSTOM/themes/powerlevel10k" || true | |
| fi | |
| # Set Theme (Bug #4 Fixed) | |
| sed -i '' 's/^ZSH_THEME=.*/ZSH_THEME="powerlevel10k\/powerlevel10k"/' ~/.zshrc | |
| grep -q 'ZSH_THEME="powerlevel10k/powerlevel10k"' ~/.zshrc || \ | |
| echo 'ZSH_THEME="powerlevel10k/powerlevel10k"' >> ~/.zshrc | |
| # Install Plugins | |
| [ ! -d "$ZSH_CUSTOM/plugins/zsh-autosuggestions" ] && \ | |
| git clone https://github.com/zsh-users/zsh-autosuggestions \ | |
| "$ZSH_CUSTOM/plugins/zsh-autosuggestions" || true | |
| [ ! -d "$ZSH_CUSTOM/plugins/zsh-syntax-highlighting" ] && \ | |
| git clone https://github.com/zsh-users/zsh-syntax-highlighting \ | |
| "$ZSH_CUSTOM/plugins/zsh-syntax-highlighting" || true | |
| # Activate Plugins | |
| sed -i '' 's/^plugins=.*/plugins=(git zsh-autosuggestions zsh-syntax-highlighting)/' ~/.zshrc | |
| # ============================================ | |
| # Node.js via NVM (Bug #5 Fixed) | |
| # ============================================ | |
| info "Setting up Node.js versions via NVM..." | |
| export NVM_DIR="$HOME/.nvm" | |
| [ -s "/opt/homebrew/opt/nvm/nvm.sh" ] && . "/opt/homebrew/opt/nvm/nvm.sh" | |
| nvm install 18 || true | |
| nvm install 20 || true | |
| nvm install node || true | |
| nvm alias default node || true | |
| # Global npm packages (Bug #3, #5 Fixed) | |
| info "Installing global npm packages..." | |
| npm install -g \ | |
| typescript \ | |
| ts-node \ | |
| yarn || true | |
| # ============================================ | |
| # Python / Pyenv / Pipx Setup (Bug #5 Fixed) | |
| # ============================================ | |
| info "Installing Python via pyenv..." | |
| export PYENV_ROOT="$HOME/.pyenv" | |
| export PATH="$PYENV_ROOT/bin:$PATH" | |
| eval "$(pyenv init -)" | |
| # Seed Pyenv with versions natively | |
| pyenv install -s 3.12.9 || true | |
| pyenv install -s 3.13.3 || true | |
| pyenv global 3.12.9 || true | |
| info "Ensuring pipx paths..." | |
| pipx ensurepath || true | |
| # ============================================ | |
| # Mac App Store Apps (Bug #5 Fixed) | |
| # ============================================ | |
| info "Installing Mac App Store applications..." | |
| mas install 937984704 || true # Amphetamine | |
| mas install 497799835 || true # Xcode | |
| # ============================================ | |
| # Git Configuration | |
| # ============================================ | |
| info "Applying default Git config..." | |
| git lfs install || true | |
| git config --global init.defaultBranch main || true | |
| git config --global pull.rebase false || true | |
| # ============================================ | |
| # .zshrc Configuration (Bug #6 Fixed) | |
| # ============================================ | |
| info "Writing custom shell profile aliases and paths..." | |
| if ! grep -qF "# --- Homebrew (Apple Silicon) ---" ~/.zshrc; then | |
| cat >> ~/.zshrc << 'ZSHRC' | |
| # --- Homebrew (Apple Silicon) --- | |
| eval "$(/opt/homebrew/bin/brew shellenv)" | |
| # --- NVM --- | |
| export NVM_DIR="$HOME/.nvm" | |
| [ -s "/opt/homebrew/opt/nvm/nvm.sh" ] && \. "/opt/homebrew/opt/nvm/nvm.sh" | |
| [ -s "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm" ] && \. "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm" | |
| # --- Bun --- | |
| export BUN_INSTALL="$HOME/.bun" | |
| export PATH="$BUN_INSTALL/bin:$PATH" | |
| # --- Pyenv --- | |
| export PYENV_ROOT="$HOME/.pyenv" | |
| export PATH="$PYENV_ROOT/bin:$PATH" | |
| eval "$(pyenv init -)" | |
| # --- Pipx --- | |
| export PATH="$HOME/.local/bin:$PATH" | |
| # --- PostgreSQL --- | |
| export PATH="/opt/homebrew/opt/postgresql@14/bin:$PATH" | |
| # --- Git --- | |
| alias g="git" | |
| alias gst="git status" | |
| alias gco="git checkout" | |
| alias gcm="git commit -m" | |
| alias gp="git push" | |
| alias gpl="git pull" | |
| alias gl="git log --oneline --graph --decorate" | |
| # --- Node / npm / Yarn --- | |
| alias y="yarn" | |
| alias yd="yarn dev" | |
| alias yb="yarn build" | |
| alias n="npm" | |
| alias nd="npm run dev" | |
| alias nb="npm run build" | |
| # --- Bun --- | |
| alias bd="bun dev" | |
| alias bb="bun build" | |
| alias br="bun run" | |
| # --- Python --- | |
| alias py="python3" | |
| alias pip="pip3" | |
| # --- Docker --- | |
| alias dc="docker compose" | |
| alias dps="docker ps" | |
| alias dlg="docker logs" | |
| # --- Misc --- | |
| alias ll="ls -lAh" | |
| alias reload="source ~/.zshrc" | |
| ZSHRC | |
| fi | |
| # ============================================ | |
| # Final Notes | |
| # ============================================ | |
| echo "" | |
| ok "Setup Complete!" | |
| echo "" | |
| echo -e "${YELLOW}=== Next Steps ===${NC}" | |
| echo "" | |
| echo "1. Authenticate tools:" | |
| echo " gh auth login # GitHub CLI auth" | |
| echo " claude # Claude CLI auth" | |
| echo " crush # configure model on first run" | |
| echo "" | |
| echo "2. Set Git identity:" | |
| echo " git config --global user.name 'Your Name'" | |
| echo " git config --global user.email 'your@email.com'" | |
| echo "" | |
| echo "3. Start PostgreSQL:" | |
| echo " brew services start postgresql@14" | |
| echo "" | |
| echo "4. Manual Installations & Configurations:" | |
| echo " - Anaconda : brew install --cask anaconda (or install from conda.io)" | |
| echo " - FlutterFlow : Download directly from https://flutterflow.io" | |
| echo " - PrivadoVPN : https://privadovpn.com" | |
| echo " - Comet : https://comet.sh" | |
| echo " - /etc/hosts : Update manually for local networking if required" | |
| echo "" | |
| echo "5. Activate prompt:" | |
| echo " source ~/.zshrc && p10k configure" | |
| echo "" | |
| echo "6. Restart terminal or run: source ~/.zshrc" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment