Suppose I have added a new tap to Brew using brew tap ...
.
I've tried looking into brew search
, brew tap
, and brew tap-info
, but none of these subcommand present any suitable options.
How can I list all formulae available within that tap?
Suppose I have added a new tap to Brew using brew tap ...
.
I've tried looking into brew search
, brew tap
, and brew tap-info
, but none of these subcommand present any suitable options.
How can I list all formulae available within that tap?
From this Stack Overflow article:
List of formulae in a tap can be found by running
brew tap-info $TAP --json
To turn this into a proper readable format we can run
brew tap-info $TAP --json | jq -r '.[]|(.cask_tokens[])'
Example: To find all formulae in homebrew/cask-fonts we can do:
brew tap-info homebrew/cask-fonts --json | jq -r '.[]|(.cask_tokens[])'
brew tap-info homebrew/cask-fonts --json
lists JSON info of the taps and some other stuff (output)jq -r '.[]
removes the outside square bracket (output)|(.cask_tokens[])'
gets the JSON value of the key cask_tokens
TL;DR: Running brew tap-info <tap-here> --json | jq -r '.[]|(.cask_tokens[])'
will give you the formulae from that tap.
Note If this fails to list all try running brew tap-info <tap-here> --json | jq -r '.[]|(.formula_names[],.cask_tokens[])'
.formula_names[]
necessary? May a tap contain both formulae and casks?
.formula_names[]
made no difference to the output. From this paste we can see that there is a field with the key "formula_names"
. I am not sure if it is required to run with .formula_names[]
, but since the field is there in the JSON output I'm leaving it there for now.