Skip to main content

Automated AI-powered code review CLI for Azure DevOps / TFS Pull Requests

Project description

AI Code Review CLI

Automated code review tool with Pull Request integration for Azure DevOps/TFS and support for multiple LLM providers. Documentation where docs/index.md for complete guides on CLI usage, LLM configuration, and architecture.

Features

  • AI Pull Request Review — Automated code analysis with configurable LLM providers
  • Structured Comments — Inline suggestions + general summary comments
  • Dry-run Mode — Validate reviews before posting
  • Multiple LLM Providers — OpenAI, Azure OpenAI, Gemini, Claude, Ollama, GitHub Copilot, AWS Bedrock
  • Smart Filtering — Filter by file extensions, limit diff size
  • Customizable Prompts — Markdown-based review guidelines
  • Interactive CLI — Menu-driven selection and confirmation

Installation & Quick Start

1. Install Package

From PyPI:

pip install code-review-ai-cli

With optional LLM SDK extras:

pip install "code-review-ai-cli[bedrock]"    # AWS Bedrock
pip install "code-review-ai-cli[openai]"     # OpenAI SDK
pip install "code-review-ai-cli[gemini]"     # Google Gemini SDK
pip install "code-review-ai-cli[claude]"     # Anthropic Claude SDK
pip install "code-review-ai-cli[all]"        # All optional SDKs

For development:

pip install -r requirements.txt
pip install "code-review-ai-cli[dev]"        # Test suite + linting

2. Initialize Configuration

Generate config templates in your project directory:

ai-review init

Creates:

  • config.yaml — LLM and review settings
  • review_prompt.md — Customizable review guidelines

3. Run Your First Review

# List active PRs
ai-review list-prs

# Review a specific PR
ai-review pr-review 42

# Dry-run (preview without posting)
ai-review pr-review 42 --dry-run

Configuration File

After ai-review init, edit config.yaml:

llm:
  provider: bedrock                    # or: openai, gemini, claude, etc.
  model: anthropic.claude-3-5-sonnet-20240620-v1:0

bedrock:
  region: us-east-1

tfs:
  base_url: https://dev.azure.com/your-org
  project: YourProject
  pat: xxxxxxxxx

review:
  language: pt
  verbosity: detailed                  # or: quick, security
  file_extensions_filter: [".cs", ".ts", ".py"]
  max_diff_files: 50

Development & Testing

This is a standard Python project with the following structure:

src/
  ai_review.py        # CLI entry point
  config.py           # Configuration management
  llm_client.py       # LLM provider abstraction
  tfs_client.py       # Azure DevOps integration
  git_utils.py        # Git diff processing
  formatter.py        # Output formatting (terminal, markdown, JSON)

tests/
  test_*.py           # Unit and integration tests

Run Tests

python -m pytest --cov=src --cov-report=term

Code Quality

Project follows PEP8 with Black formatter and Ruff linter:

# Format code
black src/ tests/

# Lint
ruff check src/ tests/

# Type checking (if using mypy)
mypy src/

VS Code Integration

Predefined tasks for quick execution in VS Code:

Available Tasks

  1. AI Review: Pull Request (Interactive)
  • Interactive mode with main menu
  • Run with: Ctrl+Shift+B → Select task
  1. AI Review: PR (Dry-Run)
  • Dry-run for a specific PR
  • Prompts for PR ID
  1. AI Review: List Active PRs
  • Lists active PRs
  • Quick diagnostics
  1. AI Review: Interactive Mode
  • Full tool menu
  • Runs in background

How to run tasks

In VS Code:

  1. Ctrl+Shift+P → "Tasks: Run Task"
  2. Select the desired task
  3. Fill in parameters if needed

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

code_review_ai_cli-1.0.2.tar.gz (61.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

code_review_ai_cli-1.0.2-py3-none-any.whl (45.4 kB view details)

Uploaded Python 3

File details

Details for the file code_review_ai_cli-1.0.2.tar.gz.

File metadata

  • Download URL: code_review_ai_cli-1.0.2.tar.gz
  • Upload date:
  • Size: 61.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for code_review_ai_cli-1.0.2.tar.gz
Algorithm Hash digest
SHA256 ac36bd7949ed11f766de5212b554225689315b7672fc47be68b86280cd154a05
MD5 bffcc23581b355f47c92667afb5a4de6
BLAKE2b-256 417a231ab146abce96fd9fceb054e9e057cbe0887e82795249e093958fe0e958

See more details on using hashes here.

File details

Details for the file code_review_ai_cli-1.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for code_review_ai_cli-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ebee90d87e6ab89a103b1821097523a149ebac95db7518880f13198167902976
MD5 154a6dd11ad8244aa067a1362d70b9a8
BLAKE2b-256 acaa681aadbe03f01ec7230a89320aaaba6ed4a35ab8401e4052f0176640a978

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page