# semsearch
Semantic code search that just works. Ask questions in plain English, get ranked file locations.
## Usage
```bash
semsearch "find the authentication handler"
```
Auto-indexes on first run, caches for instant subsequent searches.
## Options
```
semsearch [OPTIONS] [QUERY]
Arguments:
[QUERY] Natural language search query
Options:
-n, --limit <N> Max results (default: 10)
-p, --path <DIR> Project path (default: walks up to .git)
--json Output as JSON
--reindex Force full reindex
--stats Show index statistics
-v, --verbose Show progress even when cached
-h, --help Print help
```
## Examples
```bash
# Search current project
semsearch "error handling logic"
# JSON output for scripting
# Search specific directory
semsearch -p /path/to/project "API endpoints"
# Check index status
semsearch --stats
```
## Output
Human-readable (default):
```
src/auth.rs:42 0.89 pub async fn validate_token...
src/handlers/login.rs:1 0.82 //! Login and authentication...
```
JSON (`--json`):
```json
[
{"path": "src/auth.rs", "line": 42, "score": 0.89, "snippet": "..."},
...
]
```
## How It Works
1. Detects project root (walks up to `.git`)
2. Indexes all text files via [fsindex](https://crates.io/crates/fsindex)
3. Chunks content, embeds with BGE-small-en-v1.5 via [fastembed](https://crates.io/crates/fastembed)
4. Stores vectors in [usearch](https://crates.io/crates/usearch) index
5. Caches at `~/.cache/semsearch/<project-hash>/`
6. Incremental updates on file changes
## Install
```bash
cargo install --path .
```
## License
None (unpublished)