360 Secure SkillHub
360 安全技能中心

Brew Audit

通过 bash 脚本调用 brew,对 macOS 上的 Homebrew 安装做一次性审计:列出可升级的 formulae 与 casks,统计可清理的旧版本与预计磁盘节省,运行 brew doctor 检查孤立 keg、弃用包和权限问题,并汇总 formulae/casks 数量与 Homebrew 前缀;支持 --json 与按节输出。

rogue-agent1
rogue-agent1
热度 66.37
最近更新 2026-05-11 17:25:45
分类:自动化依赖:代码执行应用场景:DevOps / 自动化脚本 / 工作流 / 报告撰写

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add brew-audit
Metadata
name
brew-audit
version
1.0.0
description
Audit Homebrew installation — outdated packages, cleanup opportunities, and health checks. Use when asked about brew updates, system maintenance, or package health on macOS.
metadata
{"clawdbot":{"emoji":"🍺","homepage":"https://brew.sh","requires":{"bins":["brew"],"os":["darwin"]}}}

Homebrew Audit Skill

Quickly audit your Homebrew installation for outdated packages, cleanup opportunities, and health issues.

Usage

# Full audit (outdated + cleanup + doctor + summary)
bash scripts/brew-audit.sh

# Specific sections
bash scripts/brew-audit.sh --section outdated
bash scripts/brew-audit.sh --section cleanup
bash scripts/brew-audit.sh --section doctor

# JSON output (outdated only)
bash scripts/brew-audit.sh --json --section outdated

What It Checks

📦 Outdated Packages

Lists all formulae and casks with newer versions available, with current → available version info.

🧹 Cleanup Opportunities

Shows how many old versions/downloads can be removed and estimated disk savings. Run brew cleanup to reclaim.

🩺 Health Check

Runs brew doctor to detect:

  • Formulae with no source (orphaned kegs)
  • Deprecated/disabled packages needing replacement
  • Permission issues, broken symlinks, config problems

📊 Summary

Total formulae, casks, and Homebrew prefix.

When to Use

  • Periodic system maintenance (weekly/monthly)
  • Before major upgrades
  • When disk space is low
  • After noticing build failures (doctor check)

Updating Packages

After reviewing the audit:

brew upgrade              # upgrade all outdated
brew upgrade <formula>    # upgrade specific package
brew cleanup              # remove old versions