AI-powered code review tool for Git repositories
Project description
AIReview
AIReview is a command-line tool that leverages LLM to provide code reviews for your Git changes.
Features
- Automatic detection of Git changes
- AI-powered code review using OpenAI's GPT models
- Customizable review prompts and project context
- Markdown-formatted review output
- Support for multiple file reviews in a single run
Installation
Install this tool using pip:
pip install aireview
Configuration
Create a configuration file named aireview.config with the following structure in your project root:
[ai]
model = gpt-4
api_key = your_openai_api_key
base_url = https://api.openai.com/v1 # Optional: for custom OpenAI-compatible endpoints
[review]
output = ai-review.md # Output file for the review comments
[context]
project_context = Your project context description... # Example, I am working on Nodejs, typescript project
[prompt]
prompt_template = Your custom review prompt... # Example, Review the changes and provide feedback on the code quality and best practices
Usage
- Make some changes in your Git repository
- Add changes to the staging area:
git add the/changed/files
- Run AIReview:
aireview --config path/to/aireview.config # you can skip --config if the config file is in the project root
The tool will:
- Detect your Git changes
- Send them to the LLM for review
- Generate a markdown file with the review comments
Development
- Clone the repository:
git clone https://github.com/setkyar/aireview.git
cd aireview
- Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
- Install the package:
pip install -e .
Running Tests
# Install test dependencies
pip install -e ".[test]"
# Run tests
pytest
# Run tests with coverage
coverage run -m pytest
coverage report
Contributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
aireview-1.4.tar.gz
(11.2 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
aireview-1.4-py3-none-any.whl
(12.9 kB
view details)
File details
Details for the file aireview-1.4.tar.gz.
File metadata
- Download URL: aireview-1.4.tar.gz
- Upload date:
- Size: 11.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a6135ddfd47921ec1a36b87787f94c7c0ea04bd7b3ca04b17f1089034e60ca09
|
|
| MD5 |
7e631da43ae23ca531e95d4de27d8b4b
|
|
| BLAKE2b-256 |
24e70424566bb85ce12bcad95145062ed48222e243467c97f843f76f610363fb
|
File details
Details for the file aireview-1.4-py3-none-any.whl.
File metadata
- Download URL: aireview-1.4-py3-none-any.whl
- Upload date:
- Size: 12.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
58591b31f47c845db868b0c141ef06b8b12f5123d35c61221466376e6b67a266
|
|
| MD5 |
79ebd4c1fdc6de18b19ea1aa59002659
|
|
| BLAKE2b-256 |
8b1ad177d3294996b34fc9f93c71b539cfc218aa3d912a34a2dc1f208c4f424a
|