AI-Native Version Control Layer with Knowledge Graph & Semantic Search
CV-Git is an intelligent wrapper around Git that adds a knowledge graph, semantic search, and AI-powered code understanding to your development workflow. Think of it as "Git with a brain" - it understands your codebase structure, relationships, and context to provide powerful AI-assisted development features.
- Overview
- System Dependencies β NEW - MOVE TO TOP
- Prerequisites (with installation commands)
- Quick Start Checklist β NEW
- Installation Steps
- Configuration
- Usage
- WSL-Specific Notes (keep but reference the System Dependencies section)
- AST-based parsing using Tree-sitter for 5+ languages
- Multi-language support: TypeScript, JavaScript, Python, Go, Rust, Java
- FalkorDB graph database with advanced query capabilities
- Call graph extraction - understand function dependencies
- Symbol relationships - imports, exports, inheritance, implementations
- Advanced analysis: path finding, dead code detection, complexity analysis
- Vector embeddings with OpenAI for natural language search
- Qdrant vector database for fast similarity search
- Natural language queries - find code by describing what it does
- Context-aware results with relevance scoring
- Full-text search across all code entities
cv explain- Get natural language explanations of codecv do- Generate code from task descriptionscv review- AI code review with multi-aspect analysiscv find- Semantic code search across all languages
cv graph- Query and visualize code relationships- Call path analysis - Find execution paths between functions
- Dead code detection - Identify unreachable code
- Complexity analysis - Find high-complexity functions needing refactoring
- Circular dependency detection - Identify architectural issues
- Hot spot analysis - Find most-called functions for optimization
- 20 MCP tools for AI agents (Claude Desktop, etc.)
- Code understanding: semantic search, explain, graph queries
- Code modification: task execution, code review, sync
- Platform integration: GitHub PRs, releases
- System operations: diagnostics, configuration, status
- Advanced analysis: path finding, complexity, dead code, cycles, hotspots
cv sync- Build/update knowledge graph and embeddings- Git passthrough - All standard git commands work seamlessly
- Incremental updates - Fast syncing of only changed files
- Production-ready - Zero compilation errors, comprehensive error handling
Before installing, ensure you have the required system packages:
# Ubuntu/Debian/WSL
sudo apt update
sudo apt install -y libsecret-1-dev build-essential python3sudo dnf install libsecret-devel gcc-c++ make python3sudo pacman -S libsecret base-devel pythonWhy these are needed:
- libsecret-1-dev: Required for keytar (secure credential storage)
- build-essential: Compilers needed for native bindings (tree-sitter, keytar)
- python3: Required by node-gyp for building native modules
macOS Users
xcode-select --installWindows Users
Use WSL2 and follow the Linux/WSL instructions above.
Move from just listing requirements to providing installation commands:
WSL/Linux (recommended - using nvm):
# Install nvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
source ~/.bashrc
# Install Node.js LTS
nvm install --lts
# Install pnpm globally
npm install -g pnpmAlternative (apt):
sudo apt install -y nodejs npm
sudo npm install -g pnpmVerify installation:
node --version # Should be 18+
pnpm --version-
Install system dependencies first (see System Dependencies section above)
-
Clone and build:
git clone https://github.com/controlVector/cv-git.git cd cv-git # This will build native bindings - may take a few minutes pnpm install pnpm build # Link CLI globally cd packages/cli && pnpm link --global
Common issue: If you see libsecret-1.so.0: cannot open shared object file:
sudo apt install -y libsecret-1-dev
pnpm rebuild keytarBefore running pnpm install, verify you have:
- Node.js 18+ installed (
node --version) - pnpm installed (
pnpm --version) - System build tools (
gcc --versionorxcode-select -p) - libsecret library (Linux/WSL:
dpkg -l | grep libsecret-1-dev) - Docker running (
docker ps) - API keys ready (Anthropic & OpenAI)
- Node.js 18+
- pnpm (required for workspace dependencies)
- Docker (for FalkorDB and Qdrant)
- API Keys:
- Anthropic API key (for AI features)
- OpenAI API key (for embeddings)
# Install pnpm if you haven't already
npm install -g pnpm
# Clone the repository
git clone https://github.com/controlVector/cv-git.git
cd cv-git
# Install dependencies (pnpm required for monorepo)
# Note: This will build native tree-sitter and keytar bindings
pnpm install
# Build the project
pnpm build
# Link CLI globally
cd packages/cli && pnpm link --global && cd ../.. # Install Node.js using nvm (Node Version Manager) - recommended approach
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
# Reload your shell configuration
source ~/.bashrc
# Install the latest LTS version of Node.js
nvm install --lts
# Verify installation
node --version
npm --version
# Install pnpm globally in WSL
npm install -g pnpm
# Verify pnpm installation
pnpm --version
# Now you can run the build
cd ~/prod/cv-git
pnpm install
pnpm build# Install libsecret development library
sudo apt update
sudo apt install -y libsecret-1-dev
# You may also need to rebuild the native modules
cd ~/prod/cv-git
pnpm rebuild keytar
# Now try running cv again
cv
If you still have issues after installing libsecret, you might need to rebuild all native dependencies:
cd ~/prod/cv-git
pnpm rebuildNote: This project uses pnpm workspaces. npm and yarn are not currently supported.
Build Dependencies: You'll need build tools for native modules (gcc, g++, make, python3). On Ubuntu/Debian:
sudo apt install build-essential python3
# Verify cv command is available
cv --version
# If 'cv' command not found, add pnpm global bin to PATH:
export PATH="$(pnpm bin -g):$PATH"
# Add to your shell profile (~/.bashrc, ~/.zshrc, etc.) to make permanent
echo 'export PATH="$(pnpm bin -g):$PATH"' >> ~/.bashrc# Start FalkorDB (knowledge graph)
docker run -d --name falkordb -p 6379:6379 falkordb/falkordb
# Start Qdrant (vector database)
docker run -d --name qdrant -p 6333:6333 qdrant/qdrant# Set environment variables
export ANTHROPIC_API_KEY=sk-ant-...
export OPENAI_API_KEY=sk-...
# Or create .env file in your project
cat > .env << EOF
ANTHROPIC_API_KEY=sk-ant-...
OPENAI_API_KEY=sk-...
EOF# Navigate to your project
cd /path/to/your/project
# Initialize CV-Git
cv init
# Sync your codebase
cv syncCV-Git understands and analyzes code in multiple languages:
| Language | Extensions | Features Supported |
|---|---|---|
| TypeScript | .ts, .tsx |
Functions, classes, interfaces, types, imports/exports |
| JavaScript | .js, .jsx, .mjs, .cjs |
Functions, classes, imports/exports |
| Python | .py, .pyi, .pyw |
Functions, classes, methods, decorators, __all__ exports |
| Go | .go |
Functions, methods, structs, interfaces, exported names |
| Rust | .rs |
Functions, structs, enums, traits, impl blocks, pub items |
| Java | .java |
Classes, interfaces, enums, methods, constructors |
All languages support:
- β Symbol extraction (functions, classes, methods)
- β Call graph analysis
- β Import/export tracking
- β Complexity calculation
- β Semantic search
- β AI-powered explanations
# Find authentication code in any language
cv find "authentication logic"
# Search specific language
cv find "database connection" --language python
# Search in specific directory
cv find "validation" --file src/api# Explain a function
cv explain "authenticateUser"
# Explain a concept
cv explain "how does error handling work?"
# Explain a file
cv explain "src/auth/service.py"# Generate code
cv do "add logging to all API endpoints"
# Preview plan without executing
cv do "refactor auth to use OAuth2" --plan-only
# Auto-approve execution
cv do "add input validation" --auto-approve# Review staged changes
cv review --staged
# Review specific commit
cv review HEAD
# Review with context
cv review abc1234 --context# Get graph statistics
cv graph stats
# Find what a function calls
cv graph calls authenticateUser
# Find what calls a function
cv graph called-by processPayment
# View file dependencies
cv graph imports src/auth/service.ts
# List all functions in Python
cv graph functions --language python# Find execution path between functions
cv graph path --from main --to processPayment
# Detect dead code
cv graph dead-code
# Find complex functions (complexity > 10)
cv graph complexity --threshold 10
# Detect circular dependencies
cv graph cycles
# Find hot spots (most-called functions)
cv graph hotspots --limit 20For detailed usage, see the full documentation.
CV-Git includes a Model Context Protocol (MCP) server that exposes all functionality to AI agents like Claude Desktop.
- Build the MCP server:
cd cv-git
pnpm build- Configure Claude Desktop:
Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
{
"mcpServers": {
"cv-git": {
"command": "node",
"args": ["/path/to/cv-git/packages/mcp-server/dist/index.js"],
"env": {
"ANTHROPIC_API_KEY": "your-api-key",
"OPENAI_API_KEY": "your-api-key"
}
}
}
}- Restart Claude Desktop
Code Understanding (8 tools)
cv_find- Semantic code searchcv_explain- AI-powered code explanationcv_graph_query- Query code relationshipscv_graph_stats- Graph statisticscv_graph_inspect- Inspect symbols and filescv_graph_path- Find execution pathscv_graph_complexity- Find complex functionscv_graph_hotspots- Find most-called functions
Code Analysis (3 tools)
cv_graph_dead_code- Detect unreachable codecv_graph_cycles- Find circular dependenciescv_graph_search- Full-text entity search
Code Modification (3 tools)
cv_do- AI task executioncv_review- AI code reviewcv_sync- Update knowledge graph
Platform Integration (4 tools)
cv_pr_create- Create GitHub PRscv_pr_list- List PRscv_pr_review- Review PR detailscv_release_create- Create releases
System Operations (2 tools)
cv_config_get- Get configurationcv_status- Repository statuscv_doctor- Run diagnostics
See packages/mcp-server/README.md for detailed tool documentation.
- OpenAI Embeddings: ~$0.50/month (1,000 functions)
- Claude API: ~$20-30/month (regular usage)
- Total: ~$25-35/month for active development
We welcome contributions! Please see CONTRIBUTING.md for details.
MIT License - see LICENSE for details.
Built with β€οΈ for the open source community