README
¶
Cadre CLI 🚀🤖
Overview 🌟
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.
Features 🛠️
- 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

Review Details
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

Installation 🔧
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]
Usage 💡
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
Command-Line Switches
--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_KEYenvironment 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.
Configuring The Model
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
Running Tests ✔️
make test
make test-verbose
make test-race
Installing Tools 🛠️
make install-tools
Linting 🧹
make lint
make lint-markdown
Contributing 🤝
Forking and Sending a Pull Request
-
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.
Github Guidelines
Please ensure your code adheres to the project's standards and guidelines.
Quick Tips
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
License 📝
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. 🌈
Documentation
¶
There is no documentation for this package.