One-command setup for a complete macOS development environment with automated tool management.
git clone https://github.com/26zl/MacOS_Basic_Setup.git
cd MacOS_Basic_Setup
./install.sh # Installs shell setup and system package managers
./dev-tools.sh # Installs language tools (optional)
source ~/.zshrcDaily usage:
update # Update all tools
verify # Check status
versions # Show versions- ⚡ One Command Updates: Update Homebrew, Python, Node.js, Ruby, Rust, Go, Swift, .NET, and more
- 🎨 Beautiful Terminal: Powerlevel10k, syntax highlighting, autosuggestions
- 🛡️ Safe & Smart: Protects system files, graceful error handling
- 📦 Multi-Language: Python (pyenv), Node.js (nvm), Ruby (chruby), Rust (rustup), Swift (swiftly), Go, Java, .NET
- 🤖 CI/CD Safe: Non-interactive mode support
./install.sh
source ~/.zshrcInstalls: Xcode CLT, Git, Homebrew, Oh My Zsh, Powerlevel10k, ZSH plugins, maintain-system script
Optional: MacPorts, mas, Nix, FZF (interactive prompts)
./dev-tools.sh # Interactive installation
./dev-tools.sh check # Dry-run
./dev-tools.sh test # Test detectionInstalls: Conda, pipx, pyenv, nvm, chruby, rustup, swiftly, Go, Java, .NET
update- Update all tools, package managers, and language runtimesverify- Check status of all installed toolsversions- Display versions of all tools
Package Managers: Homebrew, MacPorts, Nix, mas, Conda, pipx
Languages: Python (pyenv), Node.js (nvm), Ruby (chruby), Rust (rustup), Swift (swiftly), Go, Java, .NET
Global Packages: npm, Cargo, Go tools, Python packages, RubyGems
Note: Only global/system packages are updated. Project files (package.json, go.mod, etc.) are never modified.
Environment variables:
MAINTAIN_SYSTEM_CLEAN_PYENV=0- Disable Python cleanupMAINTAIN_SYSTEM_CLEAN_NVM=0- Disable Node.js cleanupMAINTAIN_SYSTEM_CLEAN_CHRUBY=0- Disable Ruby cleanupMAINTAIN_SYSTEM_PYENV_KEEP="3.11.8,3.10.14"- Keep specific Python versionsMAINTAIN_SYSTEM_NVM_KEEP="v18.19.1"- Keep specific Node.js versionsMAINTAIN_SYSTEM_CHRUBY_KEEP="ruby-3.4.6"- Keep specific Ruby versionsMAINTAIN_SYSTEM_SWIFT_SNAPSHOTS=1- Enable Swift snapshots
Package Managers: Homebrew, MacPorts, Nix, mas, Conda, pipx
Languages: Python (pyenv), Node.js (nvm), Ruby (chruby), Rust (rustup), Swift (swiftly), Go, Java, .NET
Databases: MySQL, MongoDB, PostgreSQL (detection only)
Other: Docker, C/C++ (via Xcode CLT)
Pre-configured with Oh My Zsh, Powerlevel10k, syntax highlighting, autosuggestions, and FZF.
brew install --cask ghostty
mkdir -p ~/.config/ghostty
cp "Ghostty config.txt" ~/.config/ghostty/config
cp background/terminal-background.png ~/.config/ghostty/terminal-background.pngWill this modify my project files?
No! Only global/system packages are updated. Project files are never modified.
Is it safe for CI/CD?
Yes! Set NONINTERACTIVE=1 or CI=1 for automated runs.
Does it work on Intel and Apple Silicon?
Yes! Automatically detects architecture.
What if tools are missing?
The update command gracefully skips missing tools and shows installation instructions.
Security Features:
- ✅ Input validation and sanitization
- ✅ Selective error handling
- ✅ Safe directory navigation
- ✅ HTTPS-only downloads with TLS verification
Note: Scripts download external content. Review scripts before running for maximum security.
- Run
./quick-test.shto verify syntax - Ensure ShellCheck passes
- Test on both Intel and Apple Silicon Macs
CI/CD: ShellCheck, Gitleaks, Trivy, syntax checks, comprehensive macOS tests.
MIT License - see LICENSE file for details.
Made with ❤️ for the macOS developer community
