It's sometimes convenient to search for a package by its homepage URL rather than its name.
I found it's possible using the search on Homebrew homepage.

The question is: How to do this with the brew command?

I've tried brew search like the following, but it seems incapable to search by a URL.

brew search https://sqlitebrowser.org/
  • There already is a QA for this as you can see here
    – fabolous05
    Commented Mar 29, 2022 at 8:24
  • @fabolous05 I wanna search for packages by its URL using brew command. Which answer do you see as an answer to my question there?
    – catwith
    Commented Mar 29, 2022 at 8:34

2 Answers 2


This may not be the ideal solution. However, after following these steps, you will be able to search for brew formulaes by URL.

Paste the following AppleScript code into a new Script Editor.app document.
(I named my version "Brew_Master_List_Formulaes_Cataloger.scpt")

This AppleScript code will create 2 text files on your Desktop. ("Brew_Formulaes_List.txt" and "Brew_Formulaes_Info.txt")

enter image description here1

enter image description here2

property brewFormulae : POSIX path of (path to desktop) & "Brew_Formulaes_List.txt"
property brewFormulaesInfo : POSIX path of (path to desktop) & "Brew_Formulaes_Info.txt"

do shell script "/usr/local/bin/brew formulae > " & quoted form of brewFormulae

    do shell script "rm -f " & quoted form of brewFormulaesInfo
end try

set brewItemInfo to reverse of rest of reverse of paragraphs of (read brewFormulae)

repeat with i in brewItemInfo
    do shell script "/usr/local/bin/brew info " & quoted form of i & ¬
        " |sed '1,3!d' >> " & quoted form of brewFormulaesInfo
    do shell script "echo ' '" & " >> " & quoted form of brewFormulaesInfo
end repeat

NOTE: The "Brew_Formulaes_Info.txt" file could take up to 3 hours to be completed.

Once your "Brew_Formulaes_Info.txt" has been created, you can now search by URL, using the "Brew_Formulaes_Info.txt" as the source.

In Terminal.app, change your pwd (present working directory) to your Desktop with this command cd ~/Desktop (because this is where your "Brew_Formulaes_Info.txt" is located)

Now, for instance, the URL you want to search for contains "advancemame.it/scan-readme.html" (you will get better results by omitting the http:// or https:// or www.), your search commands in Terminal would be...

grep -ERIhi -B2 'advancemame.it/scan-readme.html' Brew_Formulaes_Info.txt

The result should look something like this... enter image description here3

Using your example URL...

grep -ERIhi -B2 'https://sqlitebrowser.org/' Brew_Formulaes_Info.txt

produced no results but...

grep -ERIhi -B2 'sqlite.org' Brew_Formulaes_Info.txt returned

enter image description here4


Homebrew provides JSON files for all core and cask formulae.

So you could install jq to use something like

curl -s https://formulae.brew.sh/api/formula.json | \
    jq -r '.[] | select(.homepage | contains("sqlite.org")) | [ .name, .desc ] | join(": ")'
dbhash: Computes the SHA1 hash of schema and content of a SQLite database
sqldiff: Displays the differences between SQLite databases
sqlite: Command-line interface for SQLite
sqlite-analyzer: Analyze how space is allocated inside an SQLite file

If you want to skip on the jq dependency and assume that the format of the JSON files won't change

curl -s https://formulae.brew.sh/api/formula.json | \
    sed -E -n 's|^.*"name":"([^"]+)".*sqlite.org.*|\1|p'

will do as well.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .