ctx catalog
ctx catalog indexes documentation, generates embeddings via an OpenAI-compatible endpoint, and answers natural-language queries. 100% local.
# Register a documentation collectionctx add my-project --source ./docs --include "**/*.md" --exclude "**/node_modules/**"
# Index documents + generate embeddings (requires Ollama)ctx index my-project --with-embed
# Search by intentctx search my-project "how does the auth pipeline work?"Subcommands
Section titled “Subcommands”| Command | Function |
|---|---|
ctx add <name> | Register a new collection (sources, include/exclude patterns, models) |
ctx index <name> | Index documents (detects new/modified) |
ctx embed <name> | Generate embeddings for pending chunks |
ctx search <name> <query> | Semantic + lexical search |
ctx list | List all collections |
ctx status <name> | Show collection stats |
ctx compact <name> | Optimize storage |
ctx bootstrap --path <dir> | One-shot: add + index |
Search modes
Section titled “Search modes”The query prefix selects the mode:
ctx search my-project "exact: middleware chain" # lexical onlyctx search my-project "conceptual: auth flow" # semantic emphasisctx search my-project "expanded: how do hooks work?" # query expansion (planned)ctx search my-project "natural query" # auto-detect (default)Configuration
Section titled “Configuration”Global (~/.ctx/config.toml):
[llm]endpoint = "http://localhost:11434"embedder = "nomic-embed-text"reranker = "llama3.2"Per-collection override (set during ctx add):
ctx add my-project \ --source ./docs \ --embedder-model bge-base-en \ --reranker-model llama3.2 \ --llm-endpoint http://localhost:11434Without Ollama
Section titled “Without Ollama”ctx search falls back to lexical (BM25) mode automatically. Useful for environments where you can’t run a local LLM but still want semantic-ish search via term matching.