Getting Started

Install

curl -fsSL https://sgrep.sh/install.sh | sh

This downloads a pre-built binary for your platform (macOS, Linux) and installs it to ~/.local/bin.

sgrep "handle authentication errors" src/

On first run, sgrep downloads an 8MB embedding model from HuggingFace and caches it in ~/.cache/sgrep/models/. After that, everything runs offline.

What Just Happened?

  1. Your query was converted to a 256-dimensional vector via Model2Vec
  2. Every chunk of code in src/ was also embedded
  3. Results ranked by cosine similarity — highest meaning-match first

Combine semantic understanding with keyword precision:

sgrep --hybrid "database connection pool" src/

JSON Output

Pipe results into other tools:

sgrep --json "parse config" src/ | jq '.[] | .path'

Was this page helpful?