There are already excellent code review tools like pr-agent and cursor. However, pr-agent is based on GitHub, which limits its use, and cursor is not open source, so it cannot be fully customized or integrated into other tools.
So, I decided to create a new tool with the following characteristics.
- Customizable
- Open Source
- Platform Independent
- AI Code Review
- Automatic knowledge retrieving
- Symbol based code search for retrieving knowledge
- Vector based document search for retrieving knowledge
- Generate summary of changes
- Generate commit message
- Prompt customization
- Slack notification
- Single binary executable by
bun build --compile
- GitHub Actions integration. (See wiki page to setup actions.)
Build and install a binary:
# if you don't have bun installed, install it first.
# With macOS:
# brew install bun
bun install
bun run build
cp ./dist/aica path-to-your-bin-directory
Setup environment variables:
export OPENAI_API_KEY=your_api_key
export OPENAI_MODEL=gpt-4-turbo-2024-04-09 # optional
# review the diff from HEAD
aica review
# review specific files
aica review src/main.ts
# review the files matching the specific glob pattern
aica review "src/**/*.ts"
# summarize the diff from HEAD
aica summary-diff
# generate a one-line commit message based on the diff from HEAD
aica commit-message