Code Indexer (cidx)
Semantic code search for your repositories: find code by what it does, not only by the words it contains.
What it is
CIDX indexes a git repository into a local vector index (VoyageAI or Cohere embeddings, HNSW) and a full-text
index (Tantivy), and answers natural-language, keyword and regex queries over it. It can also index git history,
build SCIP code-intelligence indexes, and run structural AST searches. Everything lives in the project's
.code-indexer/ directory; nothing runs in a container.
It is for:
- developers who want to search their own code by meaning from the command line;
- AI coding assistants, through instructions installed by
cidx teach-aior through the server's MCP endpoint; - teams, through the CIDX server: shared, centrally indexed repositories with REST, MCP and a Web UI.
Quickstart
Requires Python 3.9-3.12, a C/C++ compiler (for the hnswlib build) and a VoyageAI API key. Details: Installation.
pipx install git+https://github.com/LightspeedDMS/code-indexer.git@master
export VOYAGE_API_KEY="your-voyage-key"
cd /path/to/your/git/repository
cidx init
cidx index --fts
cidx query "where are requests rejected when the limit is exceeded" --limit 5
cidx query "authenticate_user" --fts # exact text
cidx query "token bucket" --fts --semantic # hybrid: keyword and meaning
Each semantic result shows the score, file and line range, then the matching code; add --quiet for a compact
listing.
Capabilities
- Semantic, full-text, regex and hybrid search with language, path and score filters: Query guide
- Git history search with time ranges: Temporal search
- Definitions, references, call chains and impact analysis (SCIP): SCIP guide
- Structural AST search with user-written evaluators (X-Ray): X-Ray cookbook
- A background daemon with in-memory indexes and watch mode: Operating modes
- Instructions and skills for local AI assistants: teach-ai
- Embedding providers (VoyageAI, Cohere) and project settings: Configuration
- Multi-user server with golden repositories, REST API, Web UI, SSO and MFA: Server deployment
- MCP endpoint for AI assistants: MCP registration
- Cross-repository dependency map: Meta-repo discovery
- Searchable Langfuse traces: Langfuse trace sync
- Multi-node cluster on PostgreSQL: Cluster setup
All documentation, by audience: docs/README.md. Design: Architecture overview.
Project
- Contributing: CONTRIBUTING.md and the Code of Conduct
- Security reports: privately, as described in SECURITY.md; not in public issues
- Bugs and feature requests: GitHub Issues
- Questions: GitHub Discussions
- Release history: CHANGELOG.md
- License: MIT
