# Getting Started

## Install

```bash
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

```bash
cargo install sgrep
```

## First Search

```bash
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

## Hybrid Search

Combine semantic understanding with keyword precision:

```bash
sgrep --hybrid "database connection pool" src/
```

## JSON Output

Pipe results into other tools:

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