Use this skill to run Homebrew operations safely and consistently on macOS. Start by checking whether Homebrew exists, then perform package lifecycle tasks (update/install/uninstall/verify) based on user intent.
Run in this order:
command -v brew
brew --version
Interpretation:
command -v brew returns a path (for example /opt/homebrew/bin/brew or /usr/local/bin/brew) → Homebrew installed.If not installed, reply with:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install ).brew install --cask ).Use when user says “更新 brew / update brew / upgrade brew itself”.
brew update
brew --version
Optional follow-up for packages (ask or infer from request):
brew upgrade
brew cleanup
brew install )brew install --cask )brew list --versions or open app checks for casks).Examples:
brew install wget
brew install --cask iterm2
Examples:
brew uninstall wget
brew uninstall --cask iterm2
Use when user asks “what do I have / what can I install / what is outdated”.
brew search <keyword>
brew list
brew list --cask
brew info <name>
brew outdated
Use after large upgrades/uninstalls or when disk cleanup is requested.
brew cleanup
brew autoremove --dry-run
brew autoremove
Run --dry-run first when safety matters.
Use when user wants to export or reproduce package setup.
brew bundle dump --file Brewfile
brew bundle check --file Brewfile
brew bundle install --file Brewfile
Use this table to convert natural-language requests into reliable brew commands.
brew updatebrew upgrade (optionally brew upgrade --cask when user focuses on apps)brew cleanupbrew install brew install --cask brew uninstall brew uninstall --cask brew search brew list / brew list --caskbrew info brew outdatedbrew bundle dump --file Brewfilebrew bundle install --file BrewfileWhen commands fail, capture the key error and apply the minimal safe fix path.
brew doctor
brew config
brew update
brew search <name>
brew update; report mirror/network suspicion.Use these when user asks for status, troubleshooting, or package discovery.
brew doctor
brew config
brew search <keyword>
brew list
brew list --cask
brew outdated
brew info <name>
共 1 个版本