reference

CLI reference

Code-search, indexing, conversation, setup, server, and integration commands.

Commands

CommandPurpose
sgrep [query]Search the current repository with the balanced profile
sgrep index [path]Build or rebuild a repository index
sgrep watch [path]Watch a repository and update its index
sgrep listList indexed repositories
sgrep statusShow repository index status
sgrep clearClear a repository index
sgrep conv [search] <query>Search indexed agent conversations
sgrep conv indexIndex or watch conversation sources
sgrep conv view <session_id>View a conversation
sgrep conv export <session_id>Export a conversation
sgrep conv context <session_id>Extract reusable context
sgrep conv copy <session_id>Copy a conversation or turn
sgrep conv resume <session_id>Resume in the originating agent when supported
sgrep conv statusShow conversation index status
sgrep setupDownload the embedding model and verify llama.cpp
sgrep server start|stop|statusManage the local embedding daemon explicitly
sgrep install-claude-codeInstall Claude Code hooks and skill
sgrep install-skillInstall offline skill copies

Run sgrep <command> --help for the authoritative flags accepted by the installed version.

Code-search flags

FlagMeaning
-n, --limit NMaximum results; default 10
-c, --contextInclude code context
--jsonEmit machine-readable JSON
-q, --quietEmit paths only
--threshold FMaximum cosine distance; lower is stricter
-t, --include-testsInclude test files
--all-chunksDisable per-file result deduplication
--profile fast|balanced|qualitySelect the retrieval pipeline
--hybridEnable semantic and BM25 retrieval
--semantic-weight FSemantic weight in hybrid fusion; default 0.6
--bm25-weight FBM25 weight in hybrid fusion; default 0.4
--colbertEnable ColBERT late interaction
--no-colbertDisable ColBERT even when the profile selects it
--colbert-adaptive-segmentsExperiment with adaptive segment budgets
--rerankEnable cross-encoder reranking
--rerank-topk NCandidate count passed to reranking; default 50
-d, --debugPrint timing diagnostics; repeat for more detail
--debug-log PATHWrite debug events to a file
--traceEmit a search trace

Index flags

FlagMeaning
--workers NParallel embedding workers; 0 selects the default
--quantize none|int8|binaryLegacy SQL-vector quantization mode
--sql-vectorsRetain full first-stage vectors in SQL for legacy search
--colbert-preindexPrecompute ColBERT segments; enabled by default
--colbert-adaptive-segmentsUse adaptive segment budgets during preindexing
--colbert-codec tqmse|int8|pq6Select the ColBERT sidecar codec
--exact-vector-limit NExact-float artifact cutoff; default 20,000, 0 disables

Conversation-search flags

FlagMeaning
-n, --limit NMaximum results; default 10
-T, --threshold FSimilarity threshold from 0 to 1
--hybridCombine semantic and keyword retrieval
--exactUse keyword matching only
-a, --agent NAMEFilter by Claude, Codex, Cursor, OpenCode, Pi, or all
-p, --project VALUEFilter by project name or path
--since DURATIONRelative time filter such as 7d or 2w
--after DATEInclude conversations on or after YYYY-MM-DD
--before DATEInclude conversations on or before YYYY-MM-DD
--jsonEmit JSON
-q, --quietEmit session IDs only
-v, --verboseInclude full turn content
--format default|table|timelineSelect presentation format
-i, --interactiveEnter interactive mode after search

Indexing adds --source, --force, and --watch. View, export, context, copy, and resume each expose focused flags through their own --help output.