A comprehensive automation script for setting up a fresh macOS installation with development tools, productivity apps, and custom system configurations.
- 🚀 Automated Installation: One command to set up your entire development environment
- 🔧 Modular Design: Run specific components independently
- 🔄 Idempotent: Safe to run multiple times without duplicating installations
- 📝 Comprehensive Logging: Detailed logs of all operations
- 🧪 Dry-Run Mode: Test the script without making actual changes
- ⚡ Modern Tools: Replaces traditional Unix tools with modern alternatives
- 🔮 Future-Proof: Compatible with macOS 15.x through latest beta versions
- macOS 15.x or later (tested on macOS Sequoia 15.1+)
- Compatible with newer macOS versions including beta releases
- Apple Silicon (M1/M2/M3/M4) recommended - Script is optimized for arm64 architecture
- Intel Macs supported with limited functionality
- Administrator privileges
- Internet connection
- Apple ID (for Mac App Store apps)
Note for Beta Users: While this script is designed to work with the latest macOS beta versions (including macOS 26.x), some settings may behave differently on untested versions. The script includes robust error handling to gracefully handle incompatibilities.
Note for Intel Mac Users: This script is optimized for Apple Silicon Macs. While it will work on Intel Macs, some features and performance optimizations are specific to arm64 architecture. The script will display a warning if run on Intel hardware.
- Clone this repository:
git clone https://github.com/yourusername/mac-setup.git
cd mac-setup- Make the script executable:
chmod +x setup-mac.sh- Run the setup script:
./setup-mac.sh./setup-mac.shTest the script without making any changes:
./setup-mac.sh --dry-runInstall only selected components:
./setup-mac.sh --only homebrew,settings,shellAvailable components:
xcode- Xcode Command Line Toolshomebrew- Homebrew package managersettings- macOS system preferencesmas- Mac App Store appsbrew-packages- Homebrew packages and casksnative-apps- Native applications (Perplexity, Chrome, boringNotch, Synergy)shell- Shell environment (Oh-My-Zsh, Powerlevel10k)dotfiles- Configuration files (.zshrc, .gitconfig)bun-packages- Bun global packagesapp-replacements- App replacements (Raycast, Warp)defaults- Default applications
- ✅ Automatic architecture detection (Apple Silicon vs Intel)
- ✅ Rosetta 2 installation on Apple Silicon for x86_64 compatibility
- ✅ Architecture-specific native app downloads
- ✅ iCloud Drive for Desktop & Documents
- ✅ Hidden files visible in Finder
- ✅ File extensions shown
- ✅ Auto-hiding Dock
- ✅ Disabled desktop widgets
- Architecture Support: Automatic detection and optimization for Apple Silicon (arm64) and Intel (x86_64)
- Rosetta 2: Automatically installed on Apple Silicon for x86_64 compatibility
- Languages: Node.js, Bun, PHP 8.4, Go, Rust, PowerShell
- Version Control: Git, GitHub CLI, GitHub, GitKraken, Chezmoi, LazyGit
- Cloud Tools: AWS CLI, Vultr CLI, DigitalOcean CLI (doctl), Google Cloud CLI, Azure CLI, Oracle Cloud CLI, Linode CLI, Cloudflare CLI
- Infrastructure as Code: Terraform, Ansible, Packer
- Kubernetes: kubectl, Helm, k9s
- Security: 1Password CLI, Trivy, Grype
- CI/CD: act (GitHub Actions locally)
- Editors: VS Code Insiders, Claude
- Containers: Docker
- API Testing: Insomnia
- Database Tools: Beekeeper Studio, DataGrip
- Mobile Development: Android Command Line Tools
- Java Runtime: Temurin (Eclipse Temurin JDK)
- Terminal: Warp (replaces default Terminal)
- Shell: Zsh with Oh-My-Zsh
- Theme: Powerlevel10k
- Modern CLI Tools:
eza→ replaceslsbat→ replacescatfd→ replacesfindripgrep→ replacesgrepfzf→ fuzzy finderrar→ archive utility
- Launcher: Raycast (replaces Spotlight)
- Password Manager: 1Password
- VPN: Tailscale, Proton VPN
- Email: Proton Mail
- Cloud Storage: Filen
- Screenshot: Shotrr
- Communication: Discord, Slack
- Remote Desktop: Parsec
- Keyboard & Mouse Sharing: Synergy
- Utilities: Raspberry Pi Imager, Elgato Camera Hub, OrcaSlicer, AppLite, Ice (Beta), AppCleaner, DockDoor
- Infuse 7 - Media player
- Magnet - Window management
- Unsplash Wallpapers - Dynamic wallpapers
- HP Print and Support - HP printer support
- UHF Love Your IPTV - IPTV player
- Amphetamine - Keep your Mac awake
- Paste - Limitless Clipboard - Clipboard manager
- Perplexity Comet (set as default)
- Google Chrome
- Fira Code Nerd Font
- JetBrains Mono Nerd Font
- Meslo LG Nerd Font
@cloudflare/claude-code- Claude CLI@openai/codex- OpenAI Codex@google/gemini-cli- Google Gemini CLIccusage- Code complexity analyzer@githubnext/copilot-cli- GitHub Copilot CLI@kilocode/cli@alpha- Kilocode CLI
The script configures useful aliases in .zshrc:
ls # eza with icons
ll # long format with icons
la # show all including hidden
lt # tree view with iconsnpm # → bun
npx # → bunx
yarn # → bun
pnpm # → bungs # git status
ga # git add
gc # git commit
gco # git checkout
gb # git branch
gp # git push
gl # git log (formatted)
lg # lazygit (terminal UI for git)# Docker
dps # docker ps
dpsa # docker ps -a
di # docker images
dex # docker exec -it
dlog # docker logs -f
# Kubernetes
k # kubectl
kgp # kubectl get pods
kgs # kubectl get services
kgd # kubectl get deployments
kdp # kubectl describe pod
kl # kubectl logs -f
k9s # Kubernetes terminal UIAfter running the script, complete these manual steps:
- 1Password
- Tailscale
- Proton Mail & VPN
- Discord
- Filen
- Insomnia
- Slack
- Synergy (for keyboard and mouse sharing setup)
- Cloud providers (AWS, Azure, Google Cloud, DigitalOcean, Vultr, Oracle Cloud, Linode, Cloudflare)
- Open Raycast preferences
- Set hotkey to
Cmd+Space - Import your settings/extensions
- Configure workflows
VS Code Insiders:
- Sign in with GitHub for settings sync
- Install your preferred extensions
DataGrip:
- Activate license or start trial
- Connect to your databases
- Import data sources if migrating
# Cloud Provider CLIs
aws configure # AWS
az login # Azure
gcloud init # Google Cloud
doctl auth init # DigitalOcean
vultr-cli configure # Vultr
oci setup config # Oracle Cloud
linode-cli configure # Linode
cloudflare-cli login # Cloudflare
# Security & Password Management
op signin # 1Password
# Kubernetes
kubectl config view # View kubectl configuration
helm repo add stable https://charts.helm.sh/stable # Add Helm repo
# Infrastructure as Code
terraform init # Initialize Terraform (in project directory)
ansible --version # Verify Ansible installationssh-keygen -t ed25519 -C "your.email@example.com"Edit ~/.gitconfig with your information:
git config --global user.name "Your Name"
git config --global user.email "your.email@example.com"# Scan container images for vulnerabilities
trivy image <image-name>
# Scan for vulnerabilities with Grype
grype <image-name>
# Run GitHub Actions locally
act --list # List available actions
act pull_request # Run PR workflow# Accept Android SDK licenses
sdkmanager --licensesSome settings require a restart to take full effect.
The script automatically detects your Mac's architecture (Apple Silicon or Intel) and optimizes the installation accordingly.
On Apple Silicon Macs (M1/M2/M3/M4):
- ✅ Automatic Rosetta 2 installation for x86_64 compatibility
- ✅ Native arm64 binaries for optimal performance
- ✅ Architecture-specific app downloads (Synergy, etc.)
- ✅ Homebrew configured for arm64 (
/opt/homebrew)
On Intel Macs:
⚠️ Warning displayed (script optimized for Apple Silicon)- ✅ x86_64 binaries used throughout
- ✅ Homebrew configured for x86_64 (
/usr/local) - ❌ Rosetta 2 installation skipped (not needed)
What is Rosetta 2? Rosetta 2 is Apple's translation layer that allows x86_64 (Intel) applications to run on Apple Silicon Macs. It's automatically installed by this script on Apple Silicon to ensure maximum compatibility with legacy software.
Installation Process:
- Detected during Xcode Command Line Tools installation
- Installed silently with automatic license agreement
- Takes 1-3 minutes depending on internet speed
- No user interaction required
Manual Installation (if needed):
softwareupdate --install-rosetta --agree-to-licenseVerification:
# Check if Rosetta 2 is installed
arch -x86_64 /usr/bin/true && echo "Rosetta 2 is installed" || echo "Rosetta 2 is not installed"The script intelligently handles architecture differences:
| Feature | Apple Silicon | Intel |
|---|---|---|
| Homebrew Location | /opt/homebrew |
/usr/local |
| Rosetta 2 | Auto-installed | Not needed |
| Native Apps | arm64 versions | x86_64 versions |
| Performance | Optimized | Standard |
| Docker Containers | Can run both arm64 & x86_64 | x86_64 only |
Edit the package arrays in functions/packages.sh:
declare -a languages=(
"node"
"bun"
"python3" # Add new language
)Edit functions/shell-config.sh to add your own aliases in the .zshrc configuration.
Modify functions/macos-settings.sh to adjust macOS configurations.
- Ensure you have administrator privileges
- Check internet connection
- Review the log file in
logs/directory
# Check your Mac's architecture
uname -m
# Output: arm64 (Apple Silicon) or x86_64 (Intel)
# Verify the script detects it correctly
./setup-mac.sh --dry-runIf Rosetta 2 installation fails on Apple Silicon:
# Try manual installation
softwareupdate --install-rosetta --agree-to-license
# If that fails, try the interactive version
softwareupdate --install-rosetta
# Verify installation
arch -x86_64 /usr/bin/true && echo "Success" || echo "Failed"Note: The script will continue even if Rosetta 2 installation fails. You can install it manually later if needed.
# Manually install Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# For Apple Silicon, add to PATH
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
# For Intel
echo 'eval "$(/usr/local/bin/brew shellenv)"' >> ~/.zprofile
eval "$(/usr/local/bin/brew shellenv)"
# Then re-run specific components
./setup-mac.sh --only brew-packagesIf running on an Intel Mac:
- The warning about optimization for Apple Silicon is informational
- All core functionality will still work
- Some apps may have better performance on Apple Silicon
- Consider the script will continue without issues
- Open System Settings → Keyboard → Keyboard Shortcuts
- Disable Spotlight shortcuts manually
- Open Raycast and set
Cmd+Spaceas hotkey
# Install and use macdefaultbrowser tool
brew install https://raw.githubusercontent.com/twardoch/macdefaultbrowser/main/macdefaultbrowser.rb --build-from-source
macdefaultbrowser cometAll operations are logged to logs/setup-YYYY-MM-DD-HHMMSS.log. Review this file if you encounter any issues.
Feel free to submit issues and pull requests to improve this script.
MIT License - feel free to use and modify as needed.
- ✅ macOS Sequoia 15.1
- ✅ macOS Sequoia 15.x series
- macOS 15.x and later (including beta versions)
- The script includes version detection and will inform you if you're running on an untested version
- Newer macOS versions (16.x, 26.x, etc.) should work with graceful degradation for unsupported settings
When running on beta or newer untested macOS versions, you may encounter:
- System Settings Changes: Some
defaultscommands may not work if Apple has changed domain names or keys - Permission Changes: Beta versions may have stricter security requirements
- Deprecated Settings: Some settings may no longer be available or may use different mechanisms
The script handles these gracefully by:
- Logging warnings for failed settings (without stopping execution)
- Continuing with installation even if some configurations fail
- Providing clear error messages about what didn't work
If some settings don't apply on your macOS version:
# Run in dry-run mode first to see what would happen
./setup-mac.sh --dry-run
# Check the log file for warnings about failed settings
tail -f logs/setup-*.log | grep "Failed to set"For macOS 16.x and later:
- Some Finder settings may use different domain names
- Widget settings might have moved to a different preference pane
- Check System Settings manually for settings that didn't apply
For beta versions:
- Security settings may require manual approval in System Settings
- Some automation features may be disabled by default
- You may need to grant additional permissions
If you encounter issues on a specific macOS version:
- Check the log file in
logs/directory - Look for "Failed to set" warnings
- Manually verify which settings didn't apply
- Settings can be manually configured in System Settings if needed
The core functionality (Homebrew, packages, applications) should work regardless of macOS version, as these rely on package managers rather than system settings.
- Oh My Zsh for the amazing shell framework
- Powerlevel10k for the beautiful theme
- Homebrew for simplifying macOS package management
- All the amazing open-source tool authors
Note: This script is designed for macOS 15.x and later. While it includes support for newer versions and betas, some features may work differently on untested versions. The script will inform you if you're running on a newer version and handle incompatibilities gracefully. Always review the script and run in --dry-run mode first when using on beta versions.