Metadata-Version: 2.4
Name: semfind
Version: 0.1.0
Summary: Semantic grep for the terminal — search files by meaning, not pattern
Author: puri
License-Expression: MIT
Project-URL: Homepage, https://github.com/puri/semsearch
Keywords: semantic-search,grep,embeddings,cli
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Text Processing :: General
Classifier: Topic :: Utilities
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: fastembed>=0.7.0
Requires-Dist: faiss-cpu>=1.7.0
Requires-Dist: numpy>=1.24.0
Dynamic: license-file

# semsearch

Semantic grep for the terminal. Search files by meaning, not pattern.

Uses [fastembed](https://github.com/qdrant/fastembed) (BAAI/bge-small-en-v1.5) + FAISS for fast local vector search. No API keys needed — everything runs locally.

## Install

```bash
pip install semsearch
```

## Usage

```bash
# Search a file
semsearch "deployment issue" logs.md

# Search multiple files, top 3 results
semsearch "permission error" memory/*.md -k 3

# Show 2 lines of context around each match
semsearch "database migration" notes.md -n 2

# Force re-index (ignore cache)
semsearch "query" file.md --reindex

# Set minimum similarity threshold
semsearch "auth bug" *.md -m 0.5
```

## How it works

1. On first search, each file's non-empty lines are embedded and cached in `~/.cache/semsearch/`
2. Cache is keyed by file content hash — changes auto-invalidate
3. Your query is embedded and compared via FAISS inner-product search
4. Results are printed grep-style with similarity scores

## Options

| Flag | Description | Default |
|------|-------------|---------|
| `-k, --top-k` | Number of results | 5 |
| `-n, --context` | Context lines before/after | 0 |
| `-m, --max-distance` | Minimum similarity score | none |
| `--reindex` | Force re-embed | false |
| `--model` | Embedding model | BAAI/bge-small-en-v1.5 |
| `--no-cache` | Skip cache | false |
| `--version` | Print version | |

## License

MIT
