CLI

All commands resolve chops-search.toml by walking up from the current directory, and per-command flags override its values for that run.

chops-search init

Scaffold a site's integration: chops-search.toml, content/search.md, and .gitignore entries, then print the template snippet for a site-wide search box. Nothing is ever overwritten; re-running reports what it skipped.

FlagEffect
--no-pageSkip content/search.md, for sites using only the overlay

chops-search model fetch

Download the embedding model and record what landed in .chops-search/model.lock.json. The only command that touches the network.

FlagEffect
--revision <REV>Fetch a specific upstream revision (use the lockfile's in CI)

chops-search model verify

Re-hash the model directory against the lockfile; non-zero exit on mismatch.

chops-search build

Read the content tree and the model, write hashed artifacts plus the wasm engine, worker, page script, and stylesheet into the output directory. Content changes touch only index.bin and snippets.bin.

FlagDefaultEffect
--content <DIR>content from configContent directory
--model <DIR>model from configModel directory
--out <DIR>out from configOutput directory
--prefix-rows <N>2048Rows bundled eagerly; larger means bigger eager payload, fewer range requests
--chunk-chars <N>600Target chunk size; smaller sharpens rare-word signal, costs more vectors
--dims <N>128PCA target (native 256); re-run eval after changing
--no-runtimeoffArtifacts only, skip the wasm/JS runtime

chops-search docs

Print every indexed document with its URL and chunk count. Run it after adding a post; these URLs are what eval expectations must match.

FlagDefaultEffect
--artifacts <DIR>out from configArtifacts directory to read

chops-search query <QUERY>

Explain a ranking: how the query tokenized on both sides, per-term keyword scores with document frequencies, best-chunk cosine per document, and each engine's contribution to the fused order. Calls the same scoring code as the ranker, so it cannot drift.

FlagDefaultEffect
--artifacts <DIR>out from configArtifacts directory to read
--limit <N>20Rows to print

chops-search eval

Run a labelled query set through the real engine over the real byte path and report recall@1 and recall@3 by kind, plus real bytes-per-query.

FlagDefaultEffect
--queries <FILE>fixtures/queries.toml beside the configQuery set
--kind <KIND>allOnly run cases of this kind
--fail-under <FRACTION>0.0Exit non-zero below this overall recall@1
--min-cos <COS>derived from dimsSweep the relevance floor
--chunk-penalty <COEFF>0.02Sweep the chunk-count correction; 0 disables
--artifacts <DIR>out from configArtifacts directory to read

chops-search completions <SHELL>

Emit a conventional static completion script. Prefer the dynamic path, which computes candidates at completion time.