Skip to main content

AI-powered code review tool for Git repositories

Project description

AIReview

PyPI Changelog Tests codecov License

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

  1. Clone the repository:
git clone https://github.com/setkyar/aireview.git
cd aireview
  1. Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
  1. Install the package:
pip install -e .

Configuration

Create a configuration file named aireview.config with the following structure:

[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

  1. Make some changes in your Git repository
  2. Add changes to the staging area:
git add  the/changed/files
  1. Run AIReview:
aireview --config path/to/aireview.config

The tool will:

  1. Detect your Git changes
  2. Send them to the LLM for review
  3. Generate a markdown file with the review comments

Development

Running Tests

# Install test dependencies
pip install -e ".[test]"

# Run tests
pytest

# Run tests with coverage
coverage run -m pytest
coverage report

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. 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.2.tar.gz (8.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aireview-1.2-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

Details for the file aireview-1.2.tar.gz.

File metadata

  • Download URL: aireview-1.2.tar.gz
  • Upload date:
  • Size: 8.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for aireview-1.2.tar.gz
Algorithm Hash digest
SHA256 a7cf8c1570fecc2d831fb1d263efc8b5e34aa0e178b78ad54b816554fd036a3e
MD5 eab4b374f1594709b70ba1c7f408c89d
BLAKE2b-256 866d1ccfe635b3d43b9d2a3c4a7f40da625bb6f0d05d721040ab05cb6001a9ab

See more details on using hashes here.

File details

Details for the file aireview-1.2-py3-none-any.whl.

File metadata

  • Download URL: aireview-1.2-py3-none-any.whl
  • Upload date:
  • Size: 11.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for aireview-1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 df44c3062e8ae335f4e5ea7adad6ae6f9ebbb3477a753c66b611799381a9570f
MD5 b8087282a8a788c0e13b74963d252728
BLAKE2b-256 56e20b2b47af426bf9d8bd1656b059fab10addce3d72b14bae189c45eff7cf21

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page