GitHub - jasonhemann/brew-cask-audit

2 min read Original article ↗

brew-cask-audit is a conservative, audit-first shell tool for macOS GUI apps.

It reports:

  1. Which .app bundles exist in /Applications and ~/Applications
  2. Which are managed by currently installed Homebrew casks
  3. Which are not managed by installed casks
  4. Which unmanaged apps plausibly map to available (but not installed) casks by name

It does not automatically migrate apps. It generates reports only. Manual follow-up is required.

Dependencies

Required:

  • Homebrew
  • GNU coreutils (for gfind, gsort, gcomm, greadlink, gtr)
  • GNU awk (gawk)
  • GNU sed (gsed)
  • Python 3

Install GNU tools with:

brew install coreutils gawk gnu-sed gnu-tar

The script sets LC_ALL=C for deterministic bytewise sorting/collation.

Usage

Each run writes to a new timestamped directory:

brew-cask-audit-YYYYMMDD-HHMMSS

Example:

brew-cask-audit-20260226-110033

Key Output Files

  • apps_managed_by_installed_casks.names.txt: App bundle names declared in installed cask artifacts.
  • apps_not_managed_by_installed_casks.txt: App bundle names found on disk that were not matched to installed cask artifacts.
  • apps_not_managed_by_installed_casks.with_missing_cask_by_name.txt: Name-normalized unmanaged app names that intersect with available-not-installed cask tokens.
  • installed_casks_missing.txt: Installed cask tokens that were not present in installed-cask JSON metadata (renamed/deprecated/broken metadata cases).
  • REPORT.txt: Summary counts and file pointers for the run.

Recommended Workflow

  1. Inspect apps_not_managed_by_installed_casks.with_missing_cask_by_name.txt.
  2. For each candidate token, run brew info --cask <token>.
  3. Quit the corresponding app.
  4. Reinstall with brew install --cask --force <token> when appropriate.

Limitations

  • Name matching is heuristic.
  • Some casks do not declare .app artifacts cleanly.
  • Mac App Store apps may appear as unmanaged.
  • Installer-package (pkg) casks may not surface as .app artifacts.
  • Renamed/deprecated casks are reported separately via installed_casks_missing.txt.

Inspired By