AI Code Review Pro is a powerful, extensible CLI tool and GitHub Action that automates code review using OpenAI’s language models. It helps teams maintain code quality, enforce style guidelines, and catch potential bugs before merging.
- Modular Architecture: Core engine, CLI layer, plugin system and output handlers are decoupled.
- Multi-Language Support: JavaScript, TypeScript, Python, Go, Rust, Java (easily extendable).
- Plugin System: Write and share custom linting and style rules.
- Flexible Outputs: Terminal, JSON, HTML, Markdown report formats.
- Configurable Thresholds: Control sensitivity for style, security and best-practice suggestions.
- GitHub Action: Automatically review pull requests on opened,synchronize, orreopenedevents.
- Detailed Logs & Metrics: Structured logging via Winston, metrics for review duration and issue counts.
- Built-In Testing: Jest-based test suite to validate parser and plugin behavior.
- Node.js v16 or later
- npm v8 or later
- An OpenAI API Key (GPT-4 capable)
- GitHub repository with mainbranch
- 
Clone the repository git clone https://github.com/nuekkis/AI-Code-Review.git cd AI-Code-Review
- 
Install dependencies npm install 
- 
Copy environment template cp .env.example .env 
- 
Set your OpenAI key in .envOPENAI_API_KEY=sk-...
- 
Initialize default configuration npx AI-Code-Review-Pro init 
- 
Run a review on your source folder npx AI-Code-Review-Pro review src/ --output html,json 
- 
View report - Terminal output summarized
- review-report.htmlautogenerated in project root
 
Usage: ai-review-pro [options] [command]
Commands:
  review <path>       Review code at specified file or directory
  init                Generate default `aireview.config.js`
  plugin:install <plugin>
                      Install a plugin from npm or local path
  help [command]      Display help for command
Options:
  -V, --version       output the version number
  -h, --help          display help for command- 
Review single file npx AI-Code-Review-Pro review src/index.js 
- 
Review with JSON output npx AI-Code-Review-Pro review src/ -o json 
- 
Install community plugin npx AI-Code-Review-Pro plugin:install @my-org/review-plugin-security 
Default config file: aireview.config.js in project root.
module.exports = {
  openaiModel: 'gpt-4o-mini',    // Model name
  threshold: 0.75,               // Confidence threshold (0.0 - 1.0)
  languages: ['js','ts','py'],   // Extensions to review
  output: ['terminal','html'],   // Output formats
  plugins: [                     // Plugins to load
    './plugins/sample-plugin.js'
  ],
  rules: {                       // Built-in rule overrides
    'no-todo-comments': true,
    'max-line-length': 120
  }
};- openaiModel: Change to any supported OpenAI model.
- threshold: Lower thresholds generate more suggestions.
- languages: File extensions to include.
- output: terminal,json,html,markdown.
Create a plugin by extending the base Plugin class:
import { Plugin } from 'ai-review-pro/src/plugins/base.js';
export default class MyCustomPlugin extends Plugin {
  apply(review) {
    const { text, issues } = review;
    if (/eval\(/.test(text)) {
      review.addIssue({
        message: 'Avoid using eval(), it may introduce security risks.',
        severity: 'error',
      });
    }
  }
}- Place plugin file under plugins/
- Reference in pluginsarray of config
- Plugins can manipulate review.issuesand metadata
- Terminal: Colorized summary
- JSON: Raw data for integrations
- HTML: Styled report with sections per file
- Markdown: For GitHub PR comments
All reports are saved in ./review-report.[ext] by default.
Using Winston for structured logs:
{
  level: 'info',
  transports: [new winston.transports.Console()]
}Metrics collected:
- Review start/end timestamps
- Files processed count
- Total issues found
Run unit tests:
npm testIncludes parser and plugin behavior tests. Coverage reports generated under coverage/.
- Fork the repo
- Create feature branch: git checkout -b feature/my-feature
- Commit changes: git commit -m 'Add new plugin support'
- Push: git push origin feature/my-feature
- Open a Pull Request
Please follow the Code of Conduct and Contributor Guidelines.
MIT © 2025 IceLater
Q: How do I exclude files or directories?
A: Add a .aireviewignore file with glob patterns to exclude.
Q: Can I review only staged changes?
A: Yes, use --staged flag in review command (coming soon).
Q: Which OpenAI models are supported?
A: Any model available through your API key; default is gpt-4o-mini.