gptreview is a command-line tool that leverages OpenAI's GPT-3.5 to provide code reviews for Git branch differences. Get insightful code reviews in your preferred language, directly from the command line!
An OpenAI API key
Set your OpenAI API key as an environment variable:
export OPENAI_API_KEY=yourapikey
Run gptreview with the following command:
npx gptreview [options]
-l, --lang <language>: Specify the language for the code review (default: "english").
-s, --source <sourceBranch>: Specify the source branch for the code review (default: current branch).
-t, --target <targetBranch>: Specify the target branch for the code review (default: "main").
-p, --show-prompt: Show the prompt sent to ChatGPT (default: false).
npx gptreview -l japanese -s feature-branch -t main
This will provide a code review in Japanese, comparing the feature-branch to the main branch.
MIT License
This tool is not a substitute for professional code reviews conducted by experienced developers. The quality of the review depends on the performance of the GPT-3.5 model, which may not always provide accurate or optimal recommendations. Use this tool at your own risk and always double-check the suggestions provided.