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 gitgpg # Creates new GPG 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):
- 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 make commands
install install homebrew and apps
setup-homebrew install homebrew
setup-apps install apps
check run playbooks in check mode
run run playbooks normally
extensions-download download browser extension CRX files
extensions-extract extract CRX files to unpacked extensions
extensions download and extract browser extensions
cursor-export-extensions [cursor] export extensions
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 commands
gitsetup [git] setup git global configs
gitssh [git] setup git ssh
gitgpg [git] setup git gpgansible/- 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 scriptsetup-github-gpg.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)