← 返回 Skills 市场
weichengwu

Homebrew

作者 weichengwu · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
345
总下载
1
收藏
1
当前安装
1
版本数
在 OpenClaw 中安装
/install brew
功能描述
Manage Homebrew end-to-end on macOS, including detecting whether Homebrew is installed, understanding formula vs cask, updating metadata and packages, instal...
使用说明 (SKILL.md)

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

  1. Confirm platform compatibility (Homebrew tasks here are for macOS).
  2. Detect whether Homebrew is installed.
  3. If missing, report clearly and ask whether to install Homebrew first.
  4. If present, execute the requested brew operation.
  5. 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 brew returns a path (for example /opt/homebrew/bin/brew or /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

  1. Determine install type:
    • CLI/tool/library: formula (brew install \x3Cname>)
    • App: cask (brew install --cask \x3Cname>)
  2. Install.
  3. Verify installation (brew list --versions \x3Cname> or open app checks for casks).

Examples:

brew install wget
brew install --cask iterm2

Uninstall Packages

  1. Confirm target package name.
  2. Uninstall with correct type.
  3. 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 (optionally brew upgrade --cask when 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.

  1. Run diagnostics:
brew doctor
brew config
  1. If package not found:
brew update
brew search \x3Cname>
  1. If download/network errors: retry once after brew update; report mirror/network suspicion.
  2. If permission/path conflicts: report exact path/conflict line and ask before destructive fixes.
  3. 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.
安全使用建议
This skill is coherent for managing Homebrew, but it runs shell commands on your Mac and — with your consent — will fetch and execute Homebrew's remote installer script. Before installing or making destructive changes: (1) confirm you trust the operator and the environment, (2) ask the skill to show the exact commands it will run and approve them, (3) consider running sensitive commands yourself if you prefer manual control, and (4) have backups or a recovery plan for important data. If you want stricter controls, deny installer execution and request only read-only diagnostics or explicit command previews.
功能分析
Type: OpenClaw Skill Name: brew Version: 1.0.0 The skill provides standard Homebrew management capabilities on macOS, including package installation, updates, and diagnostics. It includes the official Homebrew installation command (curl | bash from raw.githubusercontent.com) and standard brew CLI operations, all of which are consistent with its stated purpose and show no signs of malicious intent or data exfiltration.
能力评估
Purpose & Capability
Name/description match the runtime instructions. All requested actions (detecting brew, update/install/uninstall/search/diagnostics, Brewfile workflows) align with a Homebrew management skill; there are no unrelated env vars, binaries, or config paths.
Instruction Scope
Instructions stay within Homebrew management scope. They explicitly require running shell commands on the host and, with user consent, fetching and executing the Homebrew installer script. This is expected for installing Homebrew but is an operation that changes the system and should only be run after explicit user confirmation.
Install Mechanism
The skill is instruction-only (no install spec). It directs running the official Homebrew installer via a curl to raw.githubusercontent.com script — a well-known host and standard Homebrew method, but it still entails fetching and executing remote code, which is intrinsically higher-risk than local-only commands.
Credentials
No environment variables, credentials, or config paths are requested. The skill does not ask for unrelated secrets or access, which is proportionate to its purpose.
Persistence & Privilege
always is false and the skill is user-invocable. The agent is expected to run commands on the user's machine (normal for this skill). Some brew operations or the installer may require elevated permissions or modify system state; the SKILL.md advises asking before installing/destructive fixes, which is appropriate.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install brew
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /brew 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
- Major update: skill now guides end-to-end Homebrew management on macOS. - Adds Homebrew install detection and guidance if missing. - Clarifies differences and usage for formula vs cask. - Expands workflows: updating, upgrading, installing, uninstalling, searching, listing, cleanup, diagnostics, and Brewfile export/import. - Includes explicit commands-to-intents mapping and improved troubleshooting steps. - Improves response style for clear, concise reporting and user guidance.
元数据
Slug brew
版本 1.0.0
许可证 MIT-0
累计安装 1
当前安装数 1
历史版本数 1
常见问题

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。

💬 留言讨论