Where can I find a list of all formulas available for homebrew?

72

31

Is there a way to get a list of all formulas (packages) I can install using homebrew for Mac OS X?

BetaRide

Posted 2012-02-15T13:18:33.497

Reputation: 2 099

Answers

79

Online

You can visit formulae.brew.sh.

From your Mac

If you just want the package names for all formulae:

brew search

The following command will list the info snippets for all existing Homebrew formulae:

brew info --all

Or browse the local Git repository—thanks to Mk12 for that:

find /usr/local/Homebrew/ -type d -name "Formula" -exec ls -1 {} \;

slhck

Posted 2012-02-15T13:18:33.497

Reputation: 182 472

2brew server is unsupported and will be removed soon. You should use http://braumeister.org instead. – Michael Dorst – 2014-08-17T08:02:07.793

brew server seems to have been removed now (accurate as of Homebrew 0.9.5 (git revision 5745; last commit 2016-01-04)) – stkent – 2016-01-28T16:53:29.900

https://github.com/mxcl/homebrew/tree/master/Library/Formula this no longer works. Gives a 404 – cavalcade – 2016-09-09T02:14:18.047

1@MattTagg Thanks, I fixed the link. They split up the formulas into different repos now. – slhck – 2016-09-09T07:20:12.837

Local Git repository has changes to /user/local/Homebrew/Library/Tabs on my Homebew 1.0.6. – lingceng – 2016-10-06T08:32:57.410

Note that browsing the formula directory on the Github website won't really work, since it truncates the list to the first 1,000 formula. As of this writing, that means that 3,500 formula are not shown in that list. – M. Justin – 2018-03-25T20:58:12.483

@M.Justin You're right. I guess back when I wrote this, there weren't even that many. – slhck – 2018-03-26T06:15:49.240

brew info --all does not work on my macOS 10.14.6, Homebrew 2.1.15 system, but brew info --all --json does. I've submitted a corresponding edit to the question. – Johnny Utahh – 2019-10-24T19:23:41.033

1Or for a third option, ls $(brew --prefix)/Library/Formula – mk12 – 2012-08-19T21:19:48.227

22

Apart from the things slhck mentioned, there's an online package browser available at formulae.brew.sh.

Marco Peluso

Posted 2012-02-15T13:18:33.497

Reputation: 363

I was able to find the version needed. thank you – Krishna Vedula – 2015-12-16T12:38:08.517

1

You can list Homebrew formulae using the command

brew search

or browse on the Web using http://formulae.brew.sh/.

UPDATE: Searching for casks has been integrated into the above-mentioned methods.

Melebius

Posted 2012-02-15T13:18:33.497

Reputation: 1 145

1

Technically, the answer provided by @pengii23 above is correct, but as we know, JSON isn't very easy to understand. Moreover, that results in over 266,000 lines of output for 4546 packages, or more than 56 lines per package.

What we really want is just the package name, and the package description. The format might be something like this:

package -- description goes here
pack2 -- other description goes here

Now, if you have done a brew install gron, then I have a doozy of a command-line for you that will generate the type of output above:

$ brew info --json=v1 --all | gron | egrep '(.desc|.full_name) =' | \
grep -v 'runtime_dependencies' | sed 's/full_name/_name/' | \
gron -u | egrep -v '({|}|\[|\])' | \
sed -e 's/^.*"_name": //' -e 's/^.*"desc": //' | tr -d '\n' | \
sed -e 's/""/^I/g' -e 's/","/ -- /g'| tr '\t' '\n' | tr -d '"'

Note that you have to replace the literal "^I" in the line above with an actual tab character. For some reason, my sed is not liking '\t' instead of a literal tab character, and of course cutting-n-pasting a real tab character isn't going to work here.

Anyway, here's the first few lines of output from the command above:

a2ps -- Any-to-PostScript filter
a52dec -- Library for decoding ATSC A/52 streams (AKA 'AC-3')
aacgain -- AAC-supporting version of mp3gain
aalib -- Portable ASCII art graphics library
aamath -- Renders mathematical expressions as ASCII art
aap -- Make-like tool to download, build, and install software
aardvark_shell_utils -- Utilities to aid shell scripts or command-line users
abcde -- Better CD Encoder
abcl -- Armed Bear Common Lisp: a full implementation of Common Lisp
abcm2ps -- ABC music notation software

And here's the last few lines of output from the command above:

zssh -- Interactive file transfers over SSH
zstd -- Zstandard is a real-time compression algorithm
zsxd -- Zelda Mystery of Solarus XD
zsync -- File transfer program
zurl -- HTTP and WebSocket client worker with ZeroMQ interface
zxcc -- CP/M 2/3 emulator for cross-compiling and CP/M tools under UNIX
zxing-cpp -- C++ port of the ZXing barcode decoder
zyre -- Local Area Clustering for Peer-to-Peer Applications
zzuf -- Transparent application input fuzzer
zzz -- Command-line tool to put Macs to sleep

There you go! If you redirect that output to a file, you can then quickly grep the file for whatever kind of description you're looking for.

For example, if you're looking for compression commands, doing a brew search compress isn't very useful:

$ brew search compress
==> Searching local taps...
htmlcompressor            ncompress            yuicompressor
==> Searching taps on GitHub...
==> Searching blacklisted, migrated and deleted formulae...

But if we saved the output from the command above into a file in /tmp/brew.txt, then a simple grep compress /tmp/brew.txt returns 60 hits! Let's take a look at the first few:

$ grep -i compress /tmp/brew.txt | head
advancecomp -- Recompression utilities for .PNG, .MNG, .ZIP, and .GZ files
afsctool -- Utility for manipulating HFS+ compressed files
aften -- Audio encoder which generates ATSC A/52 compressed audio streams
archivemail -- Tool for archiving and compressing old email in mailboxes
brotli -- Generic-purpose lossless compression algorithm by Google
bzip2 -- Freely available high-quality data compressor
draco -- 3D geometric mesh and point cloud compression library
ecm -- Prepare CD image files so they compress better
epsilon -- Powerful wavelet image compressor
exomizer -- 6502 compressor with CBM PET 4032 support

So, if you were looking for advanced compression programs like brotli or zstd, but you didn't know the exact names to look for, then brew search compress would not be useful for you, but grepping through the output of the above command would return those two plus 58 more hits!

You're welcome! ;)

[ EDIT: Whoops! Sorry, I had forgotten to remove the runtime_dependencies from the previous version of the script. Sigh.... ]

Brad Knowles

Posted 2012-02-15T13:18:33.497

Reputation: 124

0

As of 27 May, 2016, just

brew info --all

is not sufficient for listing all formula. You must additionally add the --json=v1 switch (currently, only v1 is supported, which you can see when you type brew info --help):

brew info --json=v1 --all

pengii23

Posted 2012-02-15T13:18:33.497

Reputation: 1

0

grep desc $(brew --prefix)/Library/Formula/*.rb | perl -ne 'm{^.*/(.*?)\.rb.*?\"(.*)"$} and print "$1\t$2\n"'

rdj

Posted 2012-02-15T13:18:33.497

Reputation: 1

3Welcome to Super User! While this may answer the question, it would be a better answer if you could provide some explanation why it does so. – DavidPostill – 2015-07-29T20:20:01.483