← Back to Skills Marketplace
weichengwu

Homebrew

by weichengwu · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ Security Clean
345
Downloads
1
Stars
1
Active Installs
1
Versions
Install in OpenClaw
/install brew
Description
Manage Homebrew end-to-end on macOS, including detecting whether Homebrew is installed, understanding formula vs cask, updating metadata and packages, instal...
README (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.
Usage Guidance
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.
Capability Analysis
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.
Capability Assessment
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.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install brew
  3. After installation, invoke the skill by name or use /brew
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
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.
Metadata
Slug brew
Version 1.0.0
License MIT-0
All-time Installs 1
Active Installs 1
Total Versions 1
Frequently Asked Questions

What is Homebrew?

Manage Homebrew end-to-end on macOS, including detecting whether Homebrew is installed, understanding formula vs cask, updating metadata and packages, instal... It is an AI Agent Skill for Claude Code / OpenClaw, with 345 downloads so far.

How do I install Homebrew?

Run "/install brew" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Homebrew free?

Yes, Homebrew is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Homebrew support?

Homebrew is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Homebrew?

It is built and maintained by weichengwu (@weichengwu); the current version is v1.0.0.

💬 Comments