A macOS terminal setup script that automates the installation and configuration of essential development tools and a beautiful terminal prompt.
This project provides an automated, non-interactive setup script for macOS that installs and configures:
- Homebrew - Package manager for macOS
- Git - Version control system
- uv - Fast Python package installer and resolver
- Python 3.13 - Latest Python version via uv
- Starship - Cross-shell prompt with custom Catppuccin Mocha theme
- Oh My Zsh - Zsh configuration framework
- ✅ Idempotent - Safe to run multiple times
- ✅ Non-interactive - Minimal user input required
- ✅ Automatic backups - Existing configs are backed up before overwriting
- ✅ Custom Starship prompt - Beautiful Catppuccin Mocha themed prompt
- ✅ Cross-architecture - Supports both Intel and Apple Silicon Macs
- macOS (Darwin)
- zsh shell
- Internet connection
- Admin privileges (for Homebrew installation)
-
Clone this repository:
git clone https://github.com/mehta-raghav/terminal-setup.git cd terminal-setup -
Run the setup script:
zsh setup.sh
-
Reload your shell:
exec $SHELL -l
- Homebrew - Installed to
/opt/homebrew(Apple Silicon) or/usr/local(Intel) - Git - Latest version via Homebrew
- uv - Python package manager via Homebrew
- Python 3.13 - Installed and pinned via uv
- Starship - Prompt engine via Homebrew
- Oh My Zsh - Installed in unattended mode
- Starship prompt - Configured with custom theme
- PATH setup - Homebrew and uv added to PATH in
.zprofileand.zshrc
The script downloads config/starship.toml from this repository and installs it to ~/.config/starship.toml. The configuration includes:
- Theme: Catppuccin Mocha color palette
- Modules: OS, username, directory, git branch/status, Python version, conda environment, memory usage, and time
- Custom formatting: Powerline-style prompt with smooth transitions
To customize the setup, edit the variables at the top of setup.sh:
STARSHIP_GH_USER="mehta-raghav" # Your GitHub username
STARSHIP_GH_REPO="terminal-setup" # Repository name
STARSHIP_GH_BRANCH="main" # Branch name
STARSHIP_FILE_PATH="config/starship.toml" # Path to starship configThe script attempts to fetch config/.zshrc from the same repository. If you want to use a custom .zshrc, add it to config/.zshrc in this repository.
terminal-setup/
├── setup.sh # Main setup script
├── config/
│ └── starship.toml # Starship prompt configuration
└── README.md # This file
- Validates environment - Ensures macOS and zsh
- Requests admin privileges - Keeps sudo alive during installation
- Installs Xcode Command Line Tools - Required for Homebrew
- Installs Homebrew - Non-interactive installation
- Installs core tools - Git, uv, and Starship via Homebrew
- Sets up Python 3.13 - Installs and pins via uv
- Configures Starship - Downloads config from GitHub or uses preset fallback
- Installs Oh My Zsh - Unattended installation
- Fetches .zshrc - Downloads custom zsh config if available
- Verifies installation - Displays versions of installed tools
- Backup creation - Existing configs are backed up with timestamps before overwriting
- Idempotent operations - Safe to run multiple times
- Error handling - Script exits on errors with clear messages
- Fallback options - Uses Starship preset if config download fails
- Ensure you're running on macOS (Darwin)
- Run with zsh:
zsh setup.sh
- Check your internet connection
- Ensure Xcode Command Line Tools are installed
- Try running:
xcode-select --install
- Verify the GitHub repository is public
- Check that
config/starship.tomlexists in the repository - The script will fall back to a preset if download fails
- After installation, reload your shell:
exec $SHELL -l - Verify with:
uv run python -V - Should show Python 3.13.x
This project is open source and available for personal use.
Feel free to fork this repository and customize it for your own needs. If you have improvements, pull requests are welcome!
Created by mehta-raghav