CodeCriticAI is a tool for performing AI-powered code reviews using Git diffs. It leverages OpenAI's API to analyze code changes and generate detailed reviews.
- Analyzes code changes using Git diffs
- Utilizes OpenAI's API for code review
- Generates HTML reports of the code review
- Add support for gemini as it has larger token window which will be helpful to review large prs
- Add support to also add commit messages also in the prompt
- Python 3.6+
- OpenAI API key
- Git
pip install codecriticai
💡 Check out codecriticai on PyPI for the latest version and release notes.
# Linux/macOS
export OPENAI_API_KEY=your-api-key-here
# Windows (PowerShell)
$env:OPENAI_API_KEY="your-api-key-here"
# Review current directory changes
codecriticai
# Review specific directory
codecriticai --dir /path/to/repo
# Compare with different base branch
codecriticai --base develop
We love contributions! Here's how you can help:
- Clone the repository:
git clone https://github.com/mihir20/codecriticAI
cd codecriticAI
- Set up Python environment:
# Install Python 3.13.0
pyenv install 3.13.0
# Create a virtual environment
pyenv virtualenv 3.13.0 codecriticAI-dev
# Activate the environment
pyenv activate codecriticAI-dev
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
- Install dependencies:
pip install -e .
- Run locally:
# Using Python module directly (recommended for development)
python -m codecriticAI.main --base main
# Or after installing in development mode
codecriticai --base main
💡 Note: Using pyenv is recommended as it provides better Python version management and isolation.
This project is licensed under the MIT License - see the LICENSE file for details.
If you find codecriticAI useful, please consider:
- ⭐ Starring the repository
- 🐛 Reporting issues
- 🤝 Contributing to the code
- 📢 Spreading the word