Homebrew
/install brew
Homebrew
Overview
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.
Quick Start Workflow
- Confirm platform compatibility (Homebrew tasks here are for macOS).
- Detect whether Homebrew is installed.
- If missing, report clearly and ask whether to install Homebrew first.
- If present, execute the requested brew operation.
- Verify the result and report concise next steps.
Detect Homebrew Installation (Required First Step)
Run in this order:
command -v brew
brew --version
Interpretation:
command -v brewreturns a path (for example/opt/homebrew/bin/brewor/usr/local/bin/brew) → Homebrew installed.- Command not found or non-zero exit → Homebrew not installed.
If not installed, reply with:
- “Homebrew is not installed on this Mac.”
- Ask whether to proceed with installation.
- If user agrees, run Homebrew’s official installer:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Core Concepts (From Homebrew Manpage)
- formula: package definition built from source or bottle (
brew install \x3Cformula>). - cask: prebuilt app/binary package (
brew install --cask \x3Ccask>). - Prefer formula for developer tools and cask for desktop apps.
Common Operations
Update Homebrew
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
Install Packages
- Determine install type:
- CLI/tool/library: formula (
brew install \x3Cname>) - App: cask (
brew install --cask \x3Cname>)
- CLI/tool/library: formula (
- Install.
- Verify installation (
brew list --versions \x3Cname>or open app checks for casks).
Examples:
brew install wget
brew install --cask iterm2
Uninstall Packages
- Confirm target package name.
- Uninstall with correct type.
- Verify removal.
Examples:
brew uninstall wget
brew uninstall --cask iterm2
Status and Discovery
Use when user asks “what do I have / what can I install / what is outdated”.
brew search \x3Ckeyword>
brew list
brew list --cask
brew info \x3Cname>
brew outdated
Cleanup and Dependency Maintenance
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.
Brewfile (Environment Sync / Backup)
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
Intent → Command Mapping (Fast Routing)
Use this table to convert natural-language requests into reliable brew commands.
- “更新 brew 本身 / 更新索引” →
brew update - “升级已安装的软件” →
brew upgrade(optionallybrew upgrade --caskwhen user focuses on apps) - “清理缓存和旧版本” →
brew cleanup - “安装命令行工具 xxx” →
brew install \x3Cxxx> - “安装桌面应用 xxx” →
brew install --cask \x3Cxxx> - “卸载命令行工具 xxx” →
brew uninstall \x3Cxxx> - “卸载桌面应用 xxx” →
brew uninstall --cask \x3Cxxx> - “查找有没有 xxx” →
brew search \x3Cxxx> - “看看装了什么” →
brew list/brew list --cask - “查看 xxx 详情” →
brew info \x3Cxxx> - “看哪些过期了” →
brew outdated - “导出当前环境” →
brew bundle dump --file Brewfile - “按 Brewfile 同步环境” →
brew bundle install --file Brewfile
Failure Handling Playbook
When commands fail, capture the key error and apply the minimal safe fix path.
- Run diagnostics:
brew doctor
brew config
- If package not found:
brew update
brew search \x3Cname>
- If download/network errors: retry once after
brew update; report mirror/network suspicion. - If permission/path conflicts: report exact path/conflict line and ask before destructive fixes.
- If cask already installed or link conflicts: prefer explicit overwrite/reinstall only with user confirmation.
Helpful Diagnostic Commands
Use these when user asks for status, troubleshooting, or package discovery.
brew doctor
brew config
brew search \x3Ckeyword>
brew list
brew list --cask
brew outdated
brew info \x3Cname>
Response Style
- Report exactly what was run and what changed.
- For failed installs/uninstalls, include the key error line and a concrete retry/fix step.
- Keep output concise; avoid dumping full logs unless user asks.
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install brew - 安装完成后,直接呼叫该 Skill 的名称或使用
/brew触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
Homebrew 是什么?
Manage Homebrew end-to-end on macOS, including detecting whether Homebrew is installed, understanding formula vs cask, updating metadata and packages, instal... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 345 次。
如何安装 Homebrew?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install brew」即可一键安装,无需额外配置。
Homebrew 是免费的吗?
是的,Homebrew 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
Homebrew 支持哪些平台?
Homebrew 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Homebrew?
由 weichengwu(@weichengwu)开发并维护,当前版本 v1.0.0。