brew-search
Search Homebrew for available packages
TLDR
Search for casks and formulae using a keyword
Search for casks and formulae using a regex
Enable searching through descriptions
Only search for formulae
Only search for casks
SYNOPSIS
brew search [options] [query]
PARAMETERS
--formula, --formulae
Search only formulae (no casks).
--cask
Search only casks (GUI apps).
--installed
Show only installed formulae/casks.
--deprecated
Show only deprecated formulae/casks.
--pinned
Show only pinned formulae.
--prefix=<PREFIX>
Use custom Homebrew prefix.
--repo <REPO>
Use specified repository.
--json=v1[,<fields>]
Output JSON. Fields: name, description, homepage, versions, keg_only.
-h, --help
Show help message.
DESCRIPTION
The brew search command queries the local Homebrew repository for formulae (command-line packages) and casks (GUI apps) matching a given string. It searches names, tokens, and descriptions in the cached formula index.
Without a query, it lists all available packages. With a query like python, it shows matches such as python@3.11 or python-tk. Output is human-readable by default but supports --json for machine-parsing.
On Linux (via Homebrew on Linux), it operates similarly but uses the Linuxbrew prefix, typically $HOME/.linuxbrew. Always run brew update first for the latest index, as search is local-only—no remote queries to avoid API limits.
Ideal for discovering packages before installation with brew install. Filters like --formulae or --casks refine results, aiding package management workflows.
CAVEATS
Local-only search; run brew update for fresh index. No fuzzy matching—exact substring required. JSON fields limited; casks may lack some.
EXAMPLES
brew search git
Lists git-related packages.
brew search --formula python
Formulae matching 'python'.
brew search --json=v1 wget
JSON output for scripting.
HISTORY
Introduced in Homebrew 0.1 (2009) by Max Howell. Evolved with cask support (2014); shifted to local index in 2020+ for GitHub API efficiency.


