Skip to main content

Fast offline-first search of Homebrew formulae, casks, taps, and installed packages

Project description

brew-hop-search

Fast offline-first search of Homebrew formulae, casks, taps, and installed packages.

Built on SQLite + FTS5 for instant local search with smart caching.

GitHub · PyPI · Brew Tap

Install

# PyPI (recommended)
uv tool install brew-hop-search     # or: pip install brew-hop-search
uvx brew-hop-search python          # one-shot without install

# Homebrew tap
brew tap mcint/brew-hop-search
brew install brew-hop-search

Usage

brew-hop-search <query>                  # search formulae + casks (default)
brew-hop-search -f <query>               # formulae only
brew-hop-search -c <query>               # casks only
brew-hop-search -i <query>               # search installed packages
brew-hop-search -t <query>               # also search tapped repos
brew-hop-search -L <query>               # search brew's local API cache (offline)
brew-hop-search -C                       # show cache status
brew-hop-search --refresh <query>        # force re-fetch before searching

Cache control (bkt-style TTLs)

brew-hop-search --stale 1h <query>       # background refresh if cache > 1h old
brew-hop-search --fresh 24h <query>      # force sync refresh if cache > 24h old

Output formats

brew-hop-search --json <query>           # JSON output
brew-hop-search -g <query>               # greppable: slug\tversion\turl
brew-hop-search -C --json                # machine-readable cache status

Direct DB access

The SQLite database is at ~/.cache/brew-hop-search/brew-hop-search.db and is fully compatible with sqlite-utils:

sqlite-utils tables ~/.cache/brew-hop-search/brew-hop-search.db
sqlite-utils search ~/.cache/brew-hop-search/brew-hop-search.db formula python
sqlite-utils query ~/.cache/brew-hop-search/brew-hop-search.db "SELECT name, desc FROM installed_formula"

How it works

On first run, brew-hop-search fetches the Homebrew formula and cask indexes from formulae.brew.sh, stores them in a local SQLite database with FTS5 full-text search, and keeps the raw JSON alongside for easy re-creation.

Subsequent searches are instant (local FTS5 queries). Stale caches trigger a background refresh so the next search is both fast and fresh.

Source Flag Data
Remote API (default) formulae.brew.sh formula + cask indexes
Installed -i brew info --json=v2 --installed
Taps -t .rb files in $(brew --repo)/Library/Taps/
Local -L Brew's own API cache at $(brew --cache)/api/

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

brew_hop_search-0.2.0.tar.gz (23.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

brew_hop_search-0.2.0-py3-none-any.whl (17.1 kB view details)

Uploaded Python 3

File details

Details for the file brew_hop_search-0.2.0.tar.gz.

File metadata

  • Download URL: brew_hop_search-0.2.0.tar.gz
  • Upload date:
  • Size: 23.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.19

File hashes

Hashes for brew_hop_search-0.2.0.tar.gz
Algorithm Hash digest
SHA256 3061147166d9486bf0554a177666915bba6ac8fd657efaa1ef72199bf2e82f35
MD5 40df37fc83dfc66598299ede72dfe9d0
BLAKE2b-256 61436f1818035759feb9cef3e7b3bccae57166c9c8cd7e283ffc0c03a693aa82

See more details on using hashes here.

File details

Details for the file brew_hop_search-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for brew_hop_search-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b535d1926bee5721cc8f98fed0ea1ac1c35c8e78e3d391a1f5adfede6bd717cb
MD5 a2e60afd1aeaa78d6315182d4d7e0756
BLAKE2b-256 7addac3ddb1b79f4d3784479f7644361ef01f73f043f1e02c16f9d7cdf12b10c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page