Complete installation guide for Code Indexer (CIDX) across all platforms and scenarios.
- Prerequisites
- Installation Methods
- Environment Setup
- Global Registry Setup
- Verification
- Platform-Specific Notes
- Upgrading
- Troubleshooting
- Uninstallation
- Python: Version 3.9 or higher
- RAM: 4GB minimum (8GB+ recommended for large codebases)
- Disk Space: 500MB for installation + index storage (varies by codebase size)
- Network: Internet connection for VoyageAI API (semantic search)
python3 --version
# Should output: Python 3.9.x or higherIf Python 3.9+ is not installed:
- Ubuntu/Debian:
sudo apt install python3.11 - macOS:
brew install python@3.11 - Windows: Download from python.org
pipx isolates CIDX in its own environment and makes it globally available:
# Ubuntu/Debian
sudo apt install pipx
pipx ensurepath
# macOS
brew install pipx
pipx ensurepath
# Any platform with pip
python3 -m pip install --user pipx
python3 -m pipx ensurepathAfter installation, restart your shell to ensure PATH is updated.
Best for most users - provides isolated environment with global command access:
# Install the package
pipx install git+https://github.com/jsbattig/code-indexer.git@v8.4.46
# Verify installation
cidx --version[Corrected by fact-checker: Removed cidx setup-global-registry command - this is DEPRECATED as of v8.0 container cleanup. The command still exists but displays deprecation notice stating "deprecated - no longer needed" since filesystem backend doesn't require port coordination or registry setup. See cli.py:setup_global_registry function.]
If cidx command is not found after installation:
# Add pipx bin directory to PATH
export PATH="$HOME/.local/bin:$PATH"
# Make permanent (add to ~/.bashrc or ~/.zshrc)
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
source ~/.bashrcFor users who prefer traditional virtual environments:
# Create virtual environment
python3 -m venv code-indexer-env
# Activate environment
source code-indexer-env/bin/activate # Linux/macOS
# OR
code-indexer-env\Scripts\activate # Windows
# Install CIDX
pip install git+https://github.com/jsbattig/code-indexer.git@v8.4.46
# Verify installation
cidx --versionNote: You must activate the virtual environment each time before using CIDX:
source code-indexer-env/bin/activateFor contributors or those who want to modify CIDX:
# Clone repository
git clone https://github.com/jsbattig/code-indexer.git
cd code-indexer
# Install in editable mode with dev dependencies
pip install -e ".[dev]"
# Verify installation
cidx --version
# Run tests to ensure everything works
./ci-github.shDevelopment dependencies include:
- pytest (testing framework)
- ruff (linter)
- black (code formatter)
- mypy (type checker)
CIDX requires VoyageAI API key for semantic search functionality.
- Sign up at https://www.voyageai.com/
- Navigate to API Keys section
- Generate a new API key
- Copy the key (starts with
pa-...)
Option A: Environment Variable (Recommended)
# Add to your shell profile (~/.bashrc, ~/.zshrc, etc.)
export VOYAGE_API_KEY="your-api-key-here"
# Reload shell configuration
source ~/.bashrc # or ~/.zshrcOption B: .env File (Per-Project)
# In your project directory
echo 'VOYAGE_API_KEY=your-api-key-here' > .env.local[Corrected by fact-checker: Changed .env.local format from export VOYAGE_API_KEY="..." to VOYAGE_API_KEY=... (no export statement). Note: CIDX does NOT automatically load .env.local files. The .env.local file is referenced in mcpb/bridge.py for the MCP bridge component only, not for CLI operations. For CLI usage, set VOYAGE_API_KEY via shell environment variable as shown in Option A.]
Option C: System-Wide Configuration
# Add to your shell profile for persistent environment variable
echo 'export VOYAGE_API_KEY="your-api-key-here"' >> ~/.bashrc
source ~/.bashrc[Corrected by fact-checker: Removed ~/.config/cidx/config.env reference - this directory/file does NOT exist in CIDX implementation. There is no code in src/code_indexer/ that reads from ~/.config/cidx/. The correct system-wide approach is to add VOYAGE_API_KEY to shell profile (.bashrc, .zshrc, etc.) as shown in Option A and this corrected Option C.]
# Check if environment variable is set
echo $VOYAGE_API_KEY
# Should output your API key[Corrected by fact-checker: This entire section describes a DEPRECATED feature. The cidx setup-global-registry command is marked as "deprecated - no longer needed" in cli.py since v8.0 container cleanup (Story #506). The filesystem backend doesn't require port coordination or global registry setup.]
Important: You can skip this section entirely. CIDX v8.0+ uses filesystem-based storage that doesn't require a global registry.
The ~/.code-indexer/ directory is still used by CIDX server mode for storing golden repositories and user data, but does NOT require manual setup via cidx setup-global-registry command. The directory is created automatically when needed.
# 1. Check version
cidx --version
# Output: code-indexer, version 8.4.46
# 2. Check help
cidx --help
# Should display command list
# 3. Verify API key
echo $VOYAGE_API_KEY
# Should display your key# Navigate to a small test project
cd /path/to/test/project
# Initialize CIDX
cidx init
# Index the project
cidx index
# Test semantic search
cidx query "your search term" --limit 5
# Cleanup
cidx clean-dataIf all steps complete without errors, installation is successful!
Additional dependencies for SCIP indexing:
# Java projects
sudo apt install openjdk-17-jdk
# Node.js projects
sudo apt install nodejs npm
# Python projects (already have Python)PATH issues: If cidx not found after pipx install:
pipx ensurepath
# Restart shellHomebrew recommended for dependencies:
# Java projects
brew install openjdk@17
# Node.js projects
brew install node
# Python projects (already have Python via Homebrew)Apple Silicon (M1/M2/M3) Notes:
- Use ARM-native Python (
brew install python) - VoyageAI API works natively, no Rosetta needed
Use PowerShell or Windows Terminal (not CMD):
# Install Python from python.org
# Ensure "Add Python to PATH" is checked during installation
# Install pipx
python -m pip install --user pipx
python -m pipx ensurepath
# Restart terminal
# Install CIDX
pipx install git+https://github.com/jsbattig/code-indexer.git@v8.4.46Path issues: If cidx not found:
# Add to PATH manually
$env:Path += ";$env:USERPROFILE\.local\bin"
# Make permanent via System Environment VariablesSCIP indexing: Install required SDKs:
- Java: OpenJDK 17
- Node.js: Node.js LTS
- .NET: .NET SDK
pipx installation:
pipx upgrade code-indexerpip installation:
# Activate virtual environment first
source code-indexer-env/bin/activate
# Upgrade
pip install --upgrade git+https://github.com/jsbattig/code-indexer.git@master# pipx
pipx install --force git+https://github.com/jsbattig/code-indexer.git@v8.4.46
# pip
pip install --force-reinstall git+https://github.com/jsbattig/code-indexer.git@v8.4.46After upgrading, you may need to reindex projects:
# Navigate to project
cd /path/to/project
# Clear old indexes
cidx clean-data
# Reindex with new version
cidx indexMigration guides: See Migration Guide for major version upgrades.
Symptoms: bash: cidx: command not found
Solutions:
-
Ensure pipx bin directory in PATH:
export PATH="$HOME/.local/bin:$PATH"
-
Verify installation:
pipx list | grep code-indexer -
Reinstall:
pipx uninstall code-indexer pipx install git+https://github.com/jsbattig/code-indexer.git@v8.4.46
Symptoms: ERROR: This package requires Python >=3.9
Solutions:
-
Check Python version:
python3 --version
-
Install Python 3.9+:
# Ubuntu/Debian sudo apt install python3.11 # macOS brew install python@3.11
-
Use specific Python version:
python3.11 -m pipx install git+https://github.com/jsbattig/code-indexer.git@v8.4.46
Symptoms: ERROR: VOYAGE_API_KEY environment variable not set
Solutions:
-
Set environment variable:
export VOYAGE_API_KEY="your-key-here"
-
Add to shell profile:
echo 'export VOYAGE_API_KEY="your-key-here"' >> ~/.bashrc source ~/.bashrc
-
Use .env file (MCP bridge only):
echo 'VOYAGE_API_KEY=your-key-here' > .env.local
Note: .env.local only works with CIDX MCP bridge, not with CLI commands.
Symptoms: Permission denied: '.code-indexer'
Solutions:
-
Check directory permissions:
ls -la .code-indexer
-
Fix ownership:
sudo chown -R $USER:$USER .code-indexer
-
Fix permissions:
chmod -R 755 .code-indexer
Symptoms: ERROR: Failed building wheel for [package]
Solutions:
-
Ubuntu/Debian - Install build tools:
sudo apt install build-essential python3-dev
-
macOS - Install Xcode Command Line Tools:
xcode-select --install
-
Windows - Install Visual C++ Build Tools:
- Download from Microsoft
- Select "Desktop development with C++"
[Corrected by fact-checker: This troubleshooting section is obsolete. The cidx setup-global-registry command is deprecated since v8.0. CIDX no longer requires registry.json for normal CLI operations. The ~/.code-indexer/ directory is used by CIDX server mode and created automatically when needed.]
Note: If you see registry-related errors, you're likely using an outdated workflow or documentation. CIDX v8.0+ uses filesystem-based storage without requiring registry setup.
Symptoms: ERROR: No SCIP indexer found for language
Solutions:
-
Install language-specific dependencies:
# Java/Kotlin sudo apt install openjdk-17-jdk # Linux brew install openjdk@17 # macOS # TypeScript/JavaScript sudo apt install nodejs npm # Linux brew install node # macOS # C# # Install .NET SDK from microsoft.com # Go sudo apt install golang-go # Linux brew install go # macOS
-
Verify indexer availability:
cidx scip status
pipx installation:
pipx uninstall code-indexerpip installation:
# Activate virtual environment
source code-indexer-env/bin/activate
# Uninstall
pip uninstall code-indexer
# Remove virtual environment
deactivate
rm -rf code-indexer-env# Remove global registry
rm -rf ~/.code-indexer
# Remove per-project indexes
cd /path/to/project
cidx clean-data # Run before uninstalling
# OR manually
rm -rf .code-indexer# 1. Uninstall CIDX
pipx uninstall code-indexer
# 2. Remove global registry
rm -rf ~/.code-indexer
# 3. Remove environment variables (edit shell profile)
# Remove: export VOYAGE_API_KEY="..."
# 4. Remove .env files from projects
find . -name ".env.local" -type f -deleteAfter successful installation:
- Index your first project: Quick Start Guide
- Learn query syntax: Query Guide
- Explore SCIP: SCIP Code Intelligence
- Set up watch mode: Operating Modes
- Documentation: Main README
- Issues: GitHub Issues
- Architecture: Architecture Guide
- Migration: Migration Guide