ai-code-review-tool
v1.1.3
Published
An AI tool for automated code review against the master branch.
Readme
AI Code Review Tool
This project is an AI-powered code review tool that automatically checks code changes in the current branch against the master branch. It uses Google Gemini or OpenAI models to review your code and outputs whether your changes pass or not.
Table of Contents
Installation
Clone the repository and install dependencies:
git clone <repository-url>
cd ai-code-review-tool
npm installAs an npm package
Install in another project via npm:
npm install ai-code-review-toolUsage
Local usage
Run the application locally:
node src/index.jsCLI usage (recommended)
If installed as a package, use the CLI command:
npx ai-review-codeOr add to your npm scripts:
"scripts": {
"ai-review-code": "ai-review-code"
}Then run:
npm run ai-review-codeThis will trigger the code review process, comparing the current branch's changes against the master branch and printing the AI review result.
Environment Variables
Create a .env file in your project root and add your API keys:
GOOGLE_API_KEY=your_google_genai_key
OPENAI_API_KEY=your_openai_keyAt least one key is required. The tool will use Gemini by default if GOOGLE_API_KEY is set.
Example Workflow
- Make changes in your code.
- Commit your changes.
- Run the review command as shown above.
- The tool will output whether the changes "✅ Passed" or "❌ Not Passed" with a short reason.
Contributing
Contributions are welcome! Please submit a pull request or open an issue for suggestions or improvements.
License
This project is licensed under the MIT License. See the LICENSE file for details.
