Usage
Default state
unch index --root . builds or refreshes ./.semsearch.Custom state dir
Use
--state-dir when you want the index somewhere other than <root>/.semsearch.Provider-aware snapshots
Each provider and model pair keeps its own active snapshot.
Common flow
Flags
--root
Root directory to index. Defaults to ..
--state-dir
Path to a custom .semsearch directory. Defaults to <root>/.semsearch.
--db
Deprecated alias for the index location. Accepts .semsearch/index.db or a .semsearch directory, but --state-dir is the preferred interface.
--model
Embedding model to use. Accepts:
embeddinggemmaqwen3- a direct path to a
.gguffile - an OpenRouter model id when
--provider openrouteris selected
--provider
Embedding provider to use. Accepted values:
llama.cppopenrouter
--exclude
Exclude glob pattern. Repeat it to add more patterns.
--lib
Path to a yzma library directory, or one of its shared library files.
--gitignore
Path to a .gitignore file. Defaults to <root>/.gitignore.
--ctx-size
llama context size. 0 uses the selected model default.
--verbose
Enable verbose yzma logging.
--comment-prefix
Legacy fallback comment prefix for unsupported files or parser failures.
--context-prefix
Legacy fallback file-context prefix for unsupported files or parser failures.
Examples
- Default repo-local state
- Custom state directory
- Different model
- OpenRouter
Notes
- The first run may download the default embedding model and local
yzmaruntime libraries. - OpenRouter token lookup checks
OPENROUTER_API_KEY, then~/.config/unch/tokens.json, then.semsearch/tokens.json. - If the repository is currently bound to remote CI, a local reindex detaches that binding and returns the manifest to local mode.
- Use the same provider and model family for
indexandsearch, otherwise ranking quality will be wrong.
Why is --db deprecated?
Why is --db deprecated?
unch state is no longer just one database file.The full .semsearch directory contains index.db, manifest.json, filehashes.db, and related runtime state, so --state-dir is the more honest interface.When do legacy prefix flags matter?
When do legacy prefix flags matter?
--comment-prefix and --context-prefix only matter in fallback indexing paths for unsupported files or parser failures.They are not part of the normal Tree-sitter-based flow for supported languages.What happens to remote binding after a local reindex?
What happens to remote binding after a local reindex?
A local reindex switches the manifest back to local-only mode.Rebind with
unch bind ci ... afterwards if you want that checkout to follow remote updates again.