sift-grep
Grep-like CLI for indexed codebase search. Thin wrapper over sift-core: parses flags with clap, maps them to core types, and prints matches.
Sift currently ships a runtime-width N-gram index for literal search acceleration, defaulting to trigram width. The CLI and core are designed for multiple composable index configurations. Repeatable --index ngram with optional --width / --norm (after --index) selects which indexes to build; the search path is index-agnostic.
Usage
# Create an index (async via daemon by default)
# Create an index synchronously (blocks until complete)
# Refresh an existing index (async by default)
# Refresh synchronously
# Upgrade the binary
# Search
# Common flags
Structure
| File | Description |
|---|---|
src/main.rs |
Thin binary entrypoint |
src/lib.rs |
main_entry, re-exports for tests/benches |
src/cli.rs |
Cli (clap Parser), config builders, Cli::dispatch |
src/update.rs |
sift update (install script via curl) |
src/index/ |
IndexJob / IndexRequest (build & update), daemon IPC |
src/grep/ |
Search domain: argv, run, pattern, filter, output, paths, ignore |
tests/ |
Domain-focused integration tests spawning the real sift binary |
Integration Tests
| Test file | Coverage |
|---|---|
integration_search.rs |
Core search correctness |
integration_patterns.rs |
Pattern syntax, -e, -f, -F |
integration_output.rs |
Output formatting, --heading, --column, --vimgrep |
integration_paths.rs |
Path scoping and resolution |
integration_context.rs |
-A/-B/-C context lines |
integration_glob.rs |
-g glob filtering |
integration_ignore.rs |
.gitignore, --no-ignore, hidden files |
integration_json.rs |
--json output format |
integration_stats.rs |
--stats flag |
integration_debug.rs |
--debug stderr diagnostics |
integration_modes.rs |
-c, -l, -L, -o, --count-matches |
integration_null_color.rs |
-0/--null, --color |
Build & Test
Release binary name: sift (see Cargo.toml [[bin]]).