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.

Alternative: Build from Source

cargo install sgrep
sgrep "handle authentication errors" src/

On first run, sgrep downloads an 8M parameter embedding model (~7.5MB, int8 quantized) from sgrep.sh 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'
.md
All docs →

Was this page helpful?