Skip to content

About

The ultimate 'one-command' updater for macOS developers. Safe, fast, and always up-to-date.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

23 Commits

Folders and files

Repository files navigation

mac-dev-up: Safe macOS Dev Environment Updater

CI

mac-dev-up is a bash script designed to securely, quickly, and reliably keep your macOS development environment up to date.

Features

  • Safe Mode by Default — avoids updates in system paths (System Python, System Ruby, global npm) to protect your OS. Smartly detects version managers (NVM, ASDF, Pyenv, Rbenv) and safely applies updates within them.
  • Alternative Package Managers — natively detects and updates global packages via pnpm or yarn as an alternative to npm.
  • Fast Mode (Parallel Execution) — runs independent tasks concurrently, tracking each background job individually and reporting its exit code. A per-module watchdog kills any job that hangs (default: 30 minutes, configurable via TIMEOUT).
  • Per-Module Run Summary — prints a summary at the end of every run showing which modules succeeded, which failed, and how long each one took.
  • Config File Support — persist your preferences in ~/.mac-dev-up.conf without passing flags every time.
  • Selective Runs — run only the modules you want with --only, or skip specific ones with --exclude even when running --all.
  • Run Status at a Glance — the result of every run is saved; --status shows how the last run went without digging through logs.
  • Verified Auto-Update — checks for newer versions and verifies the download against a SHA-256 checksum before installing; the update is refused if the checksum cannot be retrieved.
  • Smart Tool Installation — detects if Homebrew is missing and offers to install it on the fly.
  • Sudo Heartbeat — refreshes sudo in the background so you only need to enter your password once.
  • Resilient Internet Check — validates connectivity before proceeding.
  • Dry-Run Mode — preview every command that would be executed without touching the system.
  • macOS Native Notifications — triggers a system notification when the update process completes, with real module counts (e.g. "1 of 9 modules failed: ruby"). Opt out with --no-notify or NOTIFY=false in the config file.
  • LaunchAgent Installer — generates and registers a native macOS LaunchAgent that runs the script silently every week, with full output logging. The schedule is configurable (--install-cron=Sat,09:00), logs are rotated automatically, and scheduled runs skip when the Mac is on battery and keep it awake (caffeinate) while updating.

Installation

curl -O https://raw.githubusercontent.com/luismiguelopes/mac-dev-up/main/mac-dev-up.sh
chmod +x mac-dev-up.sh
sudo mv mac-dev-up.sh /usr/local/bin/mac-dev-up

Usage

mac-dev-up [options]

Update Targets

Flag Description
--all Run all supported updates (default)
--brew Update Homebrew packages and casks
--python Update pip, setuptools, and wheel
--npm Update global Node packages (falls back to pnpm or yarn if detected)
--ruby Update RubyGems (respects Rbenv, ASDF, and mise)
--macos Check and install macOS software updates
--composer Update Composer and global packages
--rust Update Rust toolchain via rustup
--mise Update mise itself and all tools it manages
--go Update Go toolchain (supports mise, asdf, and brew)
--pipx Update all pipx-installed packages via pipx upgrade-all
--mas Update Mac App Store apps (requires mas-cli)
--uv Update uv itself and all uv-installed tools
--gh Update all GitHub CLI extensions via gh extension upgrade --all
--vscode Update VS Code extensions via code --update-extensions
--bun Update the Bun runtime via bun upgrade
--deno Update the Deno runtime via deno upgrade
--only=LIST Run only specific modules, comma-separated (e.g. --only=brew,npm)
--exclude=LIST Skip specific modules, comma-separated (e.g. --exclude=macos,ruby)

Execution Modes

Flag Description
--safe Safe mode (default) — skips system directories to prevent breaking macOS
--full Aggressive updates — uses --greedy in brew to also catch self-updating apps like Chrome
--fast Parallel execution for independent tasks
--dry-run Preview mode — shows what would run without making any changes
--verbose Detailed logs for debugging
--no-notify Skip the macOS notification at the end of the run
--status Show the result of the last run and exit
--list-modules List all modules and whether each underlying tool is installed
--version Print the current version and exit
--install-cron[=Day,HH:MM] Install a macOS LaunchAgent to run mac-dev-up silently every week (default: Sun,10:00)
--uninstall-cron Remove the macOS LaunchAgent

Run Summary

At the end of every run, a per-module summary is printed:

== Run Summary ==
✔  brew     — 38s
✔  python   — 6s
⚠  npm      — FAILED (4s)
✔  rust     — 12s

If any module fails, the script exits with status 1, so failures are detectable in automated runs (e.g. the LaunchAgent logs).

The summary of every run (except dry runs) is also saved to ~/Library/Logs/mac-dev-up/last-run.txt and can be checked at any time:

mac-dev-up --status

Config File

Create ~/.mac-dev-up.conf to persist your preferences. CLI flags always take precedence.

# ~/.mac-dev-up.conf
MODE    = full
FAST    = true
EXCLUDE = macos, ruby
Key Values Description
MODE safe | full Sets the update mode
FAST true | false Enables parallel execution
EXCLUDE comma-separated module names Modules to skip on every run
SCHEDULE Day,HH:MM LaunchAgent schedule used by --install-cron (default Sun,10:00)
TIMEOUT seconds Fast-mode per-module timeout (default 1800)
NOTIFY true | false macOS notification at the end of the run (default true)
BREW_SKIP comma-separated formula names Homebrew formulae that are never upgraded (e.g. llvm, gcc)
BREW_TIMEOUT seconds Limit for the Homebrew formula upgrade (default 3600, 0 = no limit)

Intel Macs and Homebrew

Homebrew no longer publishes bottles for Intel Macs, so every formula upgrade is compiled locally — heavy formulae such as llvm or gcc can take hours. Use BREW_SKIP to keep them out of the upgrade and BREW_TIMEOUT to stop a build that runs too long. If one formula fails (e.g. a broken download), the remaining formulae are retried one at a time, so a single failure doesn't block the others; the summary lists the formulae that failed. Note that a skipped formula can still be upgraded when another formula being upgraded requires a newer version of it; use brew pin <formula> for a hard block — but a pinned formula makes the upgrade of anything that needs its latest version fail. Casks are unaffected.

Automated Weekly Updates

Run once to install a native macOS LaunchAgent that executes mac-dev-up every Sunday at 10:00 AM:

mac-dev-up --install-cron

To pick a different day and time, pass a schedule (or set SCHEDULE in the config file):

mac-dev-up --install-cron=Sat,09:30

Scheduled runs are power-aware: they are skipped when the Mac is running on battery, and caffeinate keeps the machine awake while updates are in progress.

Logs are written to ~/Library/Logs/mac-dev-up/ and rotated automatically once they exceed 1 MB (the previous log is kept as .old):

~/Library/Logs/mac-dev-up/run.log   # standard output
~/Library/Logs/mac-dev-up/run.err   # standard error

Integrity Verification

Each release ships a mac-dev-up.sh.sha256 checksum file. The auto-update mechanism verifies it automatically. To verify manually:

curl -O https://raw.githubusercontent.com/luismiguelopes/mac-dev-up/main/mac-dev-up.sh.sha256
shasum -a 256 -c mac-dev-up.sh.sha256

Scope of this protection: the checksum is published in the same repository as the script, so it protects against corrupted or truncated downloads — not against a compromised repository, since an attacker with write access could replace both files. Review the script before installing, as with any tool distributed this way.

Supported Toolchains

Tool Version Manager Support
Homebrew —
Python / pip pyenv, asdf, mise, system (safe mode skips)
Node.js / npm nvm, asdf, mise, pnpm, yarn
Ruby / gems rbenv, asdf, mise, system (SIP-protected, always skipped)
Rust rustup
PHP / Composer —
macOS softwareupdate
mise —
Go mise, asdf, brew
pipx —
uv mise, brew (self-update deferred to the managing module)
Bun mise, asdf, brew (update deferred to the managing module)
Deno mise, asdf, brew (update deferred to the managing module)
Mac App Store mas-cli
GitHub CLI extensions —
VS Code extensions —

License

Distributed under the MIT License. See the LICENSE file for more details.

About

The ultimate 'one-command' updater for macOS developers. Safe, fast, and always up-to-date.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages