A command-line tool for codebase search and code-aware Q&A using Retrieval-Augmented Generation (RAG).
-
Activate your virtual environment:
cd codebase-rag source ../.venv/bin/activate export PYTHONPATH=src
-
Index your codebase:
python3 -m codebase_rag.cli index ./src
-
Ask questions via CLI:
python3 -m codebase_rag.cli search "How do I use the index_codebase API?" python3 -m codebase_rag.cli search "What does this code do? def add(a, b): return a + b" python3 -m codebase_rag.cli search "What does function get_embedding do?" python3 -m codebase_rag.cli search "What does ModuleNotFoundError: No module named 'foo' mean?"
-
Interactive mode:
python3 -m codebase_rag.cli interactive
- Search and ask questions about your codebase from the terminal
- Supports API usage, error explanations, code snippet analysis, and more
- No web frontend, no browser required
- If you see
ModuleNotFoundError: No module named 'codebase_rag', make sure you are in thecodebase-ragdirectory and have setexport PYTHONPATH=src. - For more options, run:
python3 -m codebase_rag.cli --help
This project is a Python CLI tool for codebase analysis using Retrieval-Augmented Generation (RAG). It indexes your codebase, embeds code/documents, and allows you to query or chat with your codebase using natural language. The backend uses FastAPI and supports pluggable embedding and generation models. All web UI has been removed for a streamlined, developer-focused workflow.