Minimal CLI tool to synchronize macOS applications across multiple Macs using:
- Homebrew
- Homebrew Cask
- Mac App Store via
mas - iCloud Drive
The project exports the installed app list from one Mac, stores it in iCloud, and installs missing apps on another Mac without external servers.
mac-sync-bootstrap is intended for machine bootstrap and repeated sync between Macs that share the same Apple ID.
Main goals:
- Export installed packages and apps from one Mac
- Store the sync state in iCloud Drive
- Import missing apps on another Mac
- Keep repeated executions safe and idempotent
- macOS
- iCloud Drive enabled
- Same Apple ID on all Macs involved
- Internet connection for package installation
Homebrew and mas are handled by install.sh if missing.
Main sync script.
Supported commands:
export: exports the current machine state to iCloudimport: installs what exists in iCloud and is missing locallysync: runsimportfirst, thenexport
What it manages:
- Homebrew formulae
- Homebrew casks
- Mac App Store apps from
mas
Operational behavior:
- Creates a lockfile to avoid concurrent execution
- Writes logs to a local logfile
- Uses
brew bundlefor Brew/Brew Cask sync - Uses
mas listandmas installfor App Store sync
Bootstrap installer.
What it does:
- Copies
sync_mac_apps.shto~/sync_mac_apps.sh - Makes it executable
- Installs
Homebrewif missing - Installs
masif missing - Loads the correct
brewenvironment for Apple Silicon and Intel
Reference file for the expected Brewfile format used by brew bundle.
At the moment, the real working Brewfile is generated automatically by:
~/sync_mac_apps.sh exportProject license file.
The script stores sync data in iCloud here:
~/Library/Mobile Documents/com~apple~CloudDocs/MacSync/
Generated files:
Brewfileappstore_apps.txt
Local runtime files:
- Logfile:
~/Library/Logs/sync_mac_apps.log - Lockfile:
/tmp/mac_sync_bootstrap.lock
Clone the repository:
git clone https://github.com/your-user/mac-sync-bootstrap.gitcd mac-sync-bootstrapRun the installer:
chmod +x install.sh./install.shAfter that, the main command is available at:
~/sync_mac_apps.sh
Run this on the Mac that already has the apps you want to replicate:
~/sync_mac_apps.sh exportResult:
- A
Brewfileis generated in iCloud - An
appstore_apps.txtfile is generated in iCloud
Run this on the other Mac:
~/sync_mac_apps.sh importResult:
brew bundleinstalls missing formulae and casksmasinstalls missing App Store apps- Existing apps are not reinstalled
Run:
~/sync_mac_apps.sh syncThis does:
- Imports anything already stored in iCloud
- Exports the current local state back to iCloud
Useful when a Mac acts both as consumer and source of truth over time.
Exports the current machine state to iCloud.
Use it when:
- You installed new Brew packages
- You installed new casks
- You installed new App Store apps
- You want to refresh the shared state
Imports the shared state from iCloud into the current machine.
Use it when:
- You are preparing a new Mac
- You want to align one Mac with another
- You want to install what is missing locally
Runs import followed by export.
Use it when:
- You want a safe incremental sync cycle
- The current Mac may both receive and publish changes
- The project uses
zsh. - The script is designed for repeated execution.
brew bundlealready skips installed items when possible.- App Store installation requires the same Apple ID to be signed in.
- The script uses
brctl downloadto request iCloud files before import.
- GitHub:
@usblsb
- Use GitHub Issues for bug reports, questions, and feature requests.
MIT