Automated macOS maintenance CLI
Project description
mac-upkeep
Automated macOS maintenance CLI. Runs Homebrew updates, dev tool cache cleanup (gcloud, pnpm, uv), Fish plugin updates, system optimization, and Brewfile enforcement on boot + weekly via brew services — zero config required.
Install
brew install calvindotsg/tap/mac-upkeep
brew services start mac-upkeep # runs on boot + Monday 12 PM
Or via uv:
uv tool install mac-upkeep # persistent install
uvx mac-upkeep run # one-off without installing
Tasks
| Task | Description | Schedule |
|---|---|---|
brew_update |
Update Homebrew package database | Weekly |
brew_upgrade |
Upgrade outdated formulae and casks | Weekly |
gcloud |
Update Google Cloud SDK components | Monthly |
pnpm |
Prune pnpm content-addressable store | Monthly |
uv |
Prune uv package cache | Monthly |
fisher |
Update Fish shell plugins | Weekly |
mo_clean |
Clean system and user caches (mole) | Weekly |
mo_optimize |
Optimize DNS, Spotlight, fonts, Dock (mole) | Weekly |
mo_purge |
Remove old project artifacts (mole) | Monthly |
brew_cleanup |
Remove old versions and cache files | Monthly |
brew_bundle |
Remove packages not in Brewfile | Weekly |
git_sync |
Pull configured git repositories | Daily |
Tasks auto-detect installed tools — missing tools are skipped. Use --force <task> to run a specific task on demand.
mac-upkeep tasks # See all tasks with status, frequency, and next run
Usage
mac-upkeep run # Run tasks (frequency-checked)
mac-upkeep run --dry-run # Preview without executing
mac-upkeep run --force brew_update # Run only brew_update
mac-upkeep run --force all # Run all, ignoring schedule
mac-upkeep run --debug # Verbose output
mac-upkeep tasks # List tasks with status and next run
mac-upkeep init # Generate config (detects your tools)
mac-upkeep show-config --default # Show all available task options
mac-upkeep show-config # Show your config overrides
mac-upkeep setup # Print sudoers rules
mac-upkeep status # Show scheduling dashboard
mac-upkeep logs # View last 20 log lines
mac-upkeep logs -f # Follow logs
mac-upkeep --version # Show version
Configuration
Works out of the box with zero configuration. To customize, generate a starter config:
mac-upkeep init
This probes your system, detects installed tools, and writes a commented config to ~/.config/mac-upkeep/config.toml. Only detected tasks are listed. Built-in defaults apply automatically — uncomment lines to override.
To see all available tasks and options:
mac-upkeep show-config --default
Override examples
# ~/.config/mac-upkeep/config.toml
# Disable a task
[tasks.gcloud]
enabled = false
# Change frequency (daily, weekly, or monthly)
[tasks.brew_update]
frequency = "monthly"
# Set Brewfile path explicitly
[paths]
brewfile = "~/.config/Brewfile"
Custom tasks
Add your own tasks using the same format:
[tasks.docker_prune]
description = "Prune Docker system"
command = "docker system prune -f"
detect = "docker"
frequency = "monthly"
# Control execution order
[run]
order = ["brew_update", "brew_upgrade", "docker_prune", "brew_cleanup", "brew_bundle"]
git_sync
Pull configured git repositories daily with git pull --ff-only. Opt-in — list your repos explicitly:
[git_sync]
repos = [
"~/code/my-project",
"~/work/max-*", # glob patterns supported
]
skip_dirty = true # skip repos with uncommitted changes
Each repo is skipped with a reason if it's not a git repo, has no remote, has no upstream branch, or (when skip_dirty = true) has uncommitted changes.
Authentication
Any of the following work under launchd without mac-upkeep-side configuration:
- SSH +
IdentityAgent(recommended under launchd): a path-based entry in~/.ssh/configpointing at any SSH agent's UNIX socket. Works because the directive is a file path, not theSSH_AUTH_SOCKenv var that launchd would strip. - HTTPS + credential helper:
gh auth setup-gitorgit config --global credential.helper osxkeychain. Requires the helper binary on the launchdPATH. [url].insteadOfrewrite: force SSH regardless of remote protocol by rewritinghttps://<host>/in~/.gitconfigto a matching SSHHostalias. Bypasses HTTPS auth entirely.
git_sync sets GIT_TERMINAL_PROMPT=0 and a no-op GIT_ASKPASS default (user-set GIT_ASKPASS is respected) so misconfigured auth fails in milliseconds instead of stalling to the 60 s subprocess timeout.
Environment variables
MAC_UPKEEP_GCLOUD=false mac-upkeep run # Disable a task
MAC_UPKEEP_GCLOUD_FREQUENCY=monthly mac-upkeep run # Override frequency
Sudoers
mo_clean and mo_optimize require passwordless sudo for the mo binary:
mac-upkeep setup | sudo tee /etc/sudoers.d/mac-upkeep && sudo chmod 0440 /etc/sudoers.d/mac-upkeep
sudo visudo -c
Contributing
See CONTRIBUTING.md for development setup and conventions.
License
MIT
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mac_upkeep-2.4.0.tar.gz.
File metadata
- Download URL: mac_upkeep-2.4.0.tar.gz
- Upload date:
- Size: 301.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
153fb91c4016f3bb6f7d29dc01247d80787e19547b9cf9d7fd72c3fec861425a
|
|
| MD5 |
28dfe0bed5529832bebb938a46ff4b19
|
|
| BLAKE2b-256 |
06fb26558e573edc787dfd2d435d45f21c3eccb10a566165cdcd827555d4f804
|
Provenance
The following attestation bundles were made for mac_upkeep-2.4.0.tar.gz:
Publisher:
release.yml on calvindotsg/mac-upkeep
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mac_upkeep-2.4.0.tar.gz -
Subject digest:
153fb91c4016f3bb6f7d29dc01247d80787e19547b9cf9d7fd72c3fec861425a - Sigstore transparency entry: 1341982285
- Sigstore integration time:
-
Permalink:
calvindotsg/mac-upkeep@4eaa9a6a9807854b43d7dc24bdffb213c8b444f8 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/calvindotsg
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@4eaa9a6a9807854b43d7dc24bdffb213c8b444f8 -
Trigger Event:
push
-
Statement type:
File details
Details for the file mac_upkeep-2.4.0-py3-none-any.whl.
File metadata
- Download URL: mac_upkeep-2.4.0-py3-none-any.whl
- Upload date:
- Size: 24.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f9ae86ea5bff01e224e67cf7d68eead33fa9be04e630459fbf21ddea76daef8b
|
|
| MD5 |
be6e44f95d611eb2d6f72eff4b2a0589
|
|
| BLAKE2b-256 |
ce76c44a8741ff6623ba46ed19a64af16d9a4344fa524ac0362da17a9c01e5cb
|
Provenance
The following attestation bundles were made for mac_upkeep-2.4.0-py3-none-any.whl:
Publisher:
release.yml on calvindotsg/mac-upkeep
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mac_upkeep-2.4.0-py3-none-any.whl -
Subject digest:
f9ae86ea5bff01e224e67cf7d68eead33fa9be04e630459fbf21ddea76daef8b - Sigstore transparency entry: 1341982310
- Sigstore integration time:
-
Permalink:
calvindotsg/mac-upkeep@4eaa9a6a9807854b43d7dc24bdffb213c8b444f8 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/calvindotsg
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@4eaa9a6a9807854b43d7dc24bdffb213c8b444f8 -
Trigger Event:
push
-
Statement type: