https://github.com/louis-7/ai-code-review
Let AI do code review.
https://github.com/louis-7/ai-code-review
ai bot chatgpt code code-review codereview codereview-bot
Last synced: 7 months ago
JSON representation
Let AI do code review.
- Host: GitHub
- URL: https://github.com/louis-7/ai-code-review
- Owner: Louis-7
- License: apache-2.0
- Created: 2023-04-14T07:28:29.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-03-18T12:23:39.000Z (8 months ago)
- Last Synced: 2025-03-22T17:05:04.771Z (8 months ago)
- Topics: ai, bot, chatgpt, code, code-review, codereview, codereview-bot
- Language: JavaScript
- Homepage:
- Size: 6.28 MB
- Stars: 21
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# AI Code Review

Let AI do code review for you! [Demo](https://github.com/Louis-7/ranking-board/pull/10)
This app is calling OpenAI chatGPT API to do code review for you.
[GitHub Action](https://github.com/marketplace/actions/quick-ai-code-review) | [Self-host Instruction](https://github.com/Louis-7/ai-code-review/tree/main#host-it-by-yourself)
## Install
1. Go to **Settings** -> **Secrets and variables** -> **Actions** -> **New repository secret**
2. Create a repository secret named `OPENAI_API_KEY` and fill it with your API key
1. `AZURE_OPENAI_API_KEY` for Azure OpenAI
2. `DEEPSEEK_API_KEY` for DeepSeek
3. Add the configurations to `.github/workflows/pr-code-review.yml`
1. [OpenAI example](https://github.com/Louis-7/ai-code-review/blob/main/examples/open-ai-example.yml)
2. [Azure OpenAI example](https://github.com/Louis-7/ai-code-review/blob/main/examples/azure-open-ai-example.yml)
3. [DeepSeek example](https://github.com/Louis-7/ai-code-review/blob/main/examples/deepseek-example.yml)
4. Get more details about the available environment variables in [.env.action.example](https://github.com/Louis-7/ai-code-review/blob/main/.env.action.example)
5. Create a pull request in your repository and let AI assistant you!
### Host it by yourself
You can also host the code reviewer by your self. Just follow the Dev section.
## Dev
The application is built on [Probot](https://github.com/probot/probot).
### Setup
```sh
# Install dependencies
npm install
# add environment variables
cp .env.example .env
# build app
npm run build
# Run the bot
npm start
```
Learn more about [Probot configuration](https://probot.github.io/docs/configuration/).
### Build
```sh
# build node.js app
npm run build
# build GitHub Action
npm run build:action
# build deployable azure function
npm run build:function
```
### Docker
You can also build docker image to deploy.
```sh
# 1. Build container
docker build -t protagonist-bot .
# 2. Start container
docker run -e APP_ID= -e PRIVATE_KEY= protagonist-bot
```
## License
AI Code Review is released under the [Apache License 2.0](LICENSE).