Skip to main content

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

1

Pick a repository root

2

Optionally pick a model or external state dir

3

Or use OpenRouter embeddings

4

Reuse warm state when possible

Unchanged files reuse the existing file-hash cache and indexed snapshot data instead of rebuilding everything from scratch.

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:
  • embeddinggemma
  • qwen3
  • a direct path to a .gguf file
  • an OpenRouter model id when --provider openrouter is selected

--provider

Embedding provider to use. Accepted values:
  • llama.cpp
  • openrouter

--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

Notes

  • The first run may download the default embedding model and local yzma runtime 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 index and search, otherwise ranking quality will be wrong.
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.
--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.
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.