_____ ___ ____________ _____
/ __ \ / _ \| _ \ ___ \ ___|
| / \// /_\ \ | | | |_/ / |__
| | | _ | | | | /| __|
| \__/\| | | | |/ /| |\ \| |___
\____/\_| |_/___/ \_| \_\____/
$ cadre --url https://github.com/kmesiab/cadre/pull/6
Cadre CLI is a command-line application designed to automate code reviews across various programming languages, utilizing OpenAI's ChatGPT API. It offers intelligent insights and suggestions to improve code quality and developer efficiency.
- Language-Agnostic Analysis: Compatible with multiple programming languages.
- AI-Powered Insights: Employs ChatGPT for in-depth code analysis.
- User-Friendly CLI: Simple and intuitive command-line interface for easy usage.
- Markdown Reports: Outputs code reviews in markdown for flexible viewing and integration.
- Configurable Model: Use the default OpenAI model, or choose another
Each diff file is reviewed in isolation. Code reviews are broken into several sections:
- Technical Accuracy
- Best Practices
- Performance and Scalability
- Readability and Clarity
- Maintainability
- Testability
- Contextual Fit
To install Cadre CLI, you need to have Go installed on your machine. Follow these steps:
go install github.com/kmesiab/cadre@latest
Set your OpenAI API Key (You can also pass this value on the command
line w/ --key
):
export OPENAI_API_KEY=sk-[SECRET]
To run the program:
cadre --url [url to github pull request]
To review a pull request, run the following command:
./cadre --url [url to github pull request]
ex:
or
# Run the application with a GitHub pull request URL and API key
./cadre --url=https://github.com/user/repo/pull/123 --key=your_api_key
./cadre --url=https://github.com/a/repo/pull/123 --model gpt-3.5-turbo-instruct
--url
: The GitHub pull request URL. Example:--url=https://github.com/user/repo/pull/123
--key
: Your OpenAI API key. You can also set this using theOPENAI_API_KEY
environment variable. Example:--key=your_api_key
--model
: You can specify the (OpenAI Model)[https://platform.openai. com/docs/models] to use by passing it here.--help
: Show help information.
You can tell Cadre what OpenAI Model to use by passing it via
the command line argument --model
or by setting the CADRE_COMPLETION_MODEL
environment variable.
The most common models are: gpt-4
and gpt-3.5-turbo-1106
make test
make test-verbose
make test-race
make install-tools
make lint
make lint-markdown
-
Fork the Repository: Click the 'Fork' button at the top right of this page.
-
Clone Your Fork:
git clone https://github.com/kmesiab/cadre cd cadre
-
Create a New Branch:
git checkout -b your-branch-name
-
Make Your Changes: Implement your changes or fix issues.
-
Commit and Push:
git commit -m "Add your commit message" git push origin your-branch-name
-
Create a Pull Request: Go to your fork on GitHub and click the 'Compare & pull request' button.
Please ensure your code adheres to the project's standards and guidelines.
Run make lint
before committing to ensure your code is properly formatted.
- Always rebase, never merge commit
- Always use a description commit message
- Separate your title from your description
- Keep commit messages under 50 characters
- Start your branch with
feat|bugfix|docs|style|refactor|perf|test
- Squash your commits into logical units of work
Information regarding the licensing of cadre will be included here.
Note: This project is under active development. Additional features and documentation will be updated in due course. 🌈