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.
First Search
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?
- Your query was converted to a 256-dimensional vector via Model2Vec
- Every chunk of code in
src/was also embedded - Results ranked by cosine similarity — highest meaning-match first
Hybrid Search
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?