homebrew command details - Serbipunk/notes GitHub Wiki

(base) admindeMacBook-Pro:~ admin$ brew --help
Example usage:
  brew search [TEXT|/REGEX/]
  brew info [FORMULA...]
  brew install FORMULA...
  brew update
  brew upgrade [FORMULA...]
  brew uninstall FORMULA...
  brew list [FORMULA...]

Troubleshooting:
  brew config
  brew doctor
  brew install --verbose --debug FORMULA

Contributing:
  brew create [URL [--no-fetch]]
  brew edit [FORMULA...]

Further help:
  brew commands
  brew help [COMMAND]
  man brew
  https://docs.brew.sh

common usage

link1

show package

brew list <package_name>

show dependency relation

brew deps --tree --installed

gpt answer

### local operations
1. Check if libomp is installed
brew list --versions libomp


This shows whether libomp is installed, and if so, which version.

2. Get detailed information
brew info libomp


This prints:

The installed version(s)

The installation path (usually under /usr/local/Cellar/libomp/ or /opt/homebrew/Cellar/libomp/ on Apple Silicon)

Any caveats (like how to link or use it with Clang)

Dependencies

Homebrew’s description of the formula

3. Find where the library lives
brew --prefix libomp


This gives you the top directory, e.g. /opt/homebrew/opt/libomp.
Inside that, you’ll see:

include/ → the OpenMP headers

lib/ → the runtime (libomp.dylib)

4. Search in Homebrew (if not installed yet)
brew search libomp


This confirms availability.
### remote operations
1. Use brew info --cask --json (for formula metadata in JSON)
brew info --json=v2 libomp


This will output JSON containing:

Current version

URL of the source/bottle

Revision history (if any)

You can then parse that JSON to see what Homebrew’s remote catalog has.

2. Check available versions via brew search
brew search libomp


This shows whether libomp is a valid formula and can hint if multiple variants exist (e.g., libomp@13 if older versions are still maintained).

3. Use brew formulae website

Homebrew maintains an online registry:
👉 https://formulae.brew.sh/formula/libomp

That page always shows the latest version available in the Homebrew repository, plus installation instructions.

4. GitHub tap history

Since Homebrew’s formulas are in GitHub, you can also check the version history:
👉 https://github.com/Homebrew/homebrew-core/commits/master/Formula/libomp.rb

This shows every past release that was packaged.