This project is a command-line tool named BROGRAMMER, an AI Peer Review Bro. It uses the GPT model to review your code and provide feedback. The tool is designed to be flexible, allowing you to specify the level of feedback you want, the files you want to include or exclude, and even the branch to compare the git diff against.
The main functionality of the tool is contained within the main.py
file. This script uses the typer
library to parse command-line arguments and options. It also uses the rich
library to display the results in a formatted table in the console.
The git.py
file contains a function to get the git diff of the current project. It allows you to specify the file extensions to include or exclude, and the branch to compare against.
The llm.py
file contains functions to interact with the GPT model. It sends a prompt to the model and parses the response.
The models.py
file defines the BroMode
enum, which represents the level of feedback you want from the tool.
The utils.py
file contains utility functions used by the other scripts.
The constants.py
and commandments.py
files contain constant values and functions to generate prompts for the GPT model, respectively.
To use the tool, run the python -m py_do_you_even_diff_bro.main
script with the desired options. For example, to get a chill, jr-level engineer review, use the --chill
option:
python -m py_do_you_even_diff_bro.main --chill
To specify the GPT model to use, use the --model
option:
python -m py_do_you_even_diff_bro.main --model gpt-4
To only include files with certain extensions, use the --only
option:
python -m py_do_you_even_diff_bro.main --only .py .js
To ignore files with certain extensions, use the --ignore
option:
python -m py_do_you_even_diff_bro.main --ignore .txt .md
To specify a custom prompt for the GPT model, use the --prompt
option:
python -m py_do_you_even_diff_bro.main --prompt "Review this code"
To summarize the git diff, use the --summarize
option:
python -m py_do_you_even_diff_bro.main --summarize
To specify the branch to compare the git diff against, use the --peer-review
option:
python -m py_do_you_even_diff_bro.main --peer-review main