5 stable releases
Uses new Rust 2024
| 1.1.2 | Dec 6, 2025 |
|---|---|
| 1.0.1 | Dec 6, 2025 |
#1450 in Filesystem
36KB
599 lines
semsearch
Semantic code search that just works. Ask questions in plain English, get ranked file locations.
Usage
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
# Search current project
semsearch "error handling logic"
# JSON output for scripting
semsearch --json "database queries" | jq '.[] | .path'
# 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):
[
{"path": "src/auth.rs", "line": 42, "score": 0.89, "snippet": "..."},
...
]
How It Works
- Detects project root (walks up to
.git) - Indexes all text files via fsindex
- Chunks content, embeds with BGE-small-en-v1.5 via fastembed
- Stores vectors in usearch index
- Caches at
~/.cache/semsearch/<project-hash>/ - Incremental updates on file changes
Install
cargo install --path .
License
None (unpublished)
Dependencies
~106MB
~2.5M SLoC