Ansible-based automation for setting up a macOS development environment. This repository has been converted from bash scripts to Ansible playbooks for better maintainability and idempotency.
After starting up a new or reformatted Mac, you may want to transfer your SSH keys and API keys to the new machine. While transferring a zipped ~/.ssh directory via AirDrop is acceptable, creating new SSH keys and adding them to GitHub and cloud services is the preferred method.
Install Xcode Command Line Tools (includes make and git):
xcode-select --installThis opens a dialog to install the command line tools.
The easiest way to set up your environment:
make install # Installs Homebrew and Ansible
make run # Runs Ansible playbooksOptional:
make gitssh # Creates new SSH keys and adds them to GitHub
make extensions # Downloads and extracts browser extensionsIf you prefer to run commands manually:
- Install Homebrew:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"- Install Ansible:
brew install ansible- Run the playbooks:
ansible-playbook ansible/main.yml -i "localhost,"
ansible-playbook ansible/macos.yml -i "localhost,"- Set global Git configs:
git config --global user.name "Your Name"
git config --global user.email "your.email@example.com"Or use the Makefile command (requires .env file with GITHUB_USERNAME and GITHUB_EMAIL):
make gitsetup- Set up SSH keys for GitHub:
- Create a public SSH key & add it to SSH agent
- Log in to GitHub and add the newly created key
Or use the Makefile command:
make gitsshAfter running the Ansible playbooks, complete these manual steps:
- Install iTerm2 profile: Import
configs/iterm2-profile.json - Import Rectangle configs: Import
configs/RectangleConfig.json - Run Cursor Makefile commands:
make cursor-import-extensionsmake cursor-import-keybindings
- Add browser extensions to Ungoogled Chromium (use
make extensionsto download and extract extensions)
Run make help to see all available commands, or refer to the list below:
help # List all Makefile commands
install # Install Homebrew and Ansible
setup-homebrew # Install Homebrew
setup-apps # Install Ansible
check # Run playbooks in check mode (dry run)
run # Run playbooks normally
gitssh # Setup Git SSH keys
gitsetup # Setup Git global configs (requires .env file)
extensions # Download and extract browser extensions
extensions-download # Download browser extension CRX files
extensions-extract # Extract CRX files to unpacked extensions
cursor-export-extensions # [Cursor] Export extensions list
cursor-import-extensions # [Cursor] Import extensions
cursor-show-keybindings # [Cursor] Show keybindings
cursor-export-keybindings # [Cursor] Export keybindings
cursor-import-keybindings # [Cursor] Import keybindings
cursor # [Cursor] Run import commandsansible/- Ansible playbooks for automated setupmain.yml- Main playbook (packages, shell config, Python environment)macos.yml- macOS-specific system settings
configs/- Configuration files for various applications.gitconfig- Git configurationcursor-extensions.txt- Cursor IDE extensions listcursor-keybindings.json- Cursor IDE keybindingsiterm2-profile.json- iTerm2 profileRectangleConfig.json- Rectangle window manager config
scripts/- Helper scriptssetup-github-ssh.sh- SSH key setup scriptgpg-setup.sh- GPG setup script- Other utility scripts
archive/- Legacy bash scripts (deprecated, kept for reference)docs/- Documentation and notes
- Fix uv setup
- Add global uv to
.zshrc(see uv documentation) - Fix
make installbug