Skip to main content

Automated macOS maintenance CLI

Project description

mac-upkeep

PyPI CI Python License macOS

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.

mac-upkeep demo

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

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 (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"]

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

mac_upkeep-2.3.0.tar.gz (294.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mac_upkeep-2.3.0-py3-none-any.whl (21.2 kB view details)

Uploaded Python 3

File details

Details for the file mac_upkeep-2.3.0.tar.gz.

File metadata

  • Download URL: mac_upkeep-2.3.0.tar.gz
  • Upload date:
  • Size: 294.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for mac_upkeep-2.3.0.tar.gz
Algorithm Hash digest
SHA256 7725daa19e0c32a1506fb66af220a6e1a336e936e9e16a1e2b0be84a5e696c1a
MD5 ee8f0a7691faf2cbeed08a05eb865b27
BLAKE2b-256 1b83377a46c13c2cf0e46efcb5881b122eed7b52805a8ab2065d977a9b99fd2a

See more details on using hashes here.

Provenance

The following attestation bundles were made for mac_upkeep-2.3.0.tar.gz:

Publisher: release.yml on calvindotsg/mac-upkeep

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mac_upkeep-2.3.0-py3-none-any.whl.

File metadata

  • Download URL: mac_upkeep-2.3.0-py3-none-any.whl
  • Upload date:
  • Size: 21.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for mac_upkeep-2.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 384fad61eb4617a04c229dc274a031b6ac6ae9349bd1caa3b0723ba5d6091d88
MD5 88f253fb141bf6d21146e03818958e37
BLAKE2b-256 2f3c8459c81c15bbab7e9e862ba6ef6b2f42283babf1fb382974233fa1cd8bc0

See more details on using hashes here.

Provenance

The following attestation bundles were made for mac_upkeep-2.3.0-py3-none-any.whl:

Publisher: release.yml on calvindotsg/mac-upkeep

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page