Skip to main content

AI Code Review

AI Code Review is an automated AI-powered code review CLI, compatible with various LLM providers, designed for integration with Azure DevOps, whether in the cloud or on-premises. It allows you to run a review on demand or as part of a pipeline triggered before a commit or when a pull request is created.

Features

  • AI Pull Request review (pr-review)
  • Structured PR comments (inline + general summary)
  • dry-run mode to validate without posting
  • PR listing with filters (list-prs)
  • Configuration exclusively via config.yaml
  • Providers LLM: OpenAI, Azure OpenAI, Gemini, Claude, Ollama, GitHub Copilot, AWS Bedrock
  • Diff filtering by excluded path prefixes (excluded_paths) and/or file extensions (file_extensions_filter)
  • Prompt token estimation with LiteLLM (Total Prompt)

Documentation

Output Review Format

Review Output Format Example

During a PR review, the terminal also displays Total Prompt, an estimate of the input tokens in the complete payload sent to the configured provider. The provider comes from llm.provider and the model comes from llm.model or its default one. If LiteLLM cannot resolve the provider/model combination, the tool tries the model without a provider prefix and then uses local tiktoken as a final fallback.

Installation

Install from PyPI: s

pip install code-review-ai-cli

After installing the package, generate ready-to-edit configuration files in your working directory:

ai-review init

This copies two bundled templates:

  • config.yaml — all available options with inline documentation
  • review_prompt.md — default review style rules, injected into every LLM prompt

The tool looks for config.yaml in the current working directory at runtime. You can also pass a different path with --config:

ai-review pr-review --config ~/configs/ai-review.yaml

If you plan to run the test suite locally, also install development dependencies:

pip install "code-review-ai-cli[dev]"

Minimal Example

Example config.yaml:

llm:
  provider: openai
  model: gpt-4o

openai:
  api_key: sk-xxxx

tfs:
  base_url: https://dev.azure.com/your-organization
  project: ProjectName
  pat: xxxxxxxxx
  verify_ssl: true
  # ca_bundle: C:/certs/corporate-root-ca.pem

review:
  verbosity: detailed
  scope: diff_only
  custom_prompt_file: review_prompt.md
  # file limit sent to the LLM
  max_diff_files: 50
  # per-file limit
  max_diff_lines: 2000
  # extension allowlist (empty list = all files)
  file_extensions_filter: [".cs", ".ts", ".py"]
  # exclude path prefixes from the diff (applied before file_extensions_filter)
  # leading slash is optional; add trailing slash for exact folder boundary
  excluded_paths: ["libs/generated"]

pr:
  auto_post_comments: false
  dry_run: false
  comment_mode: structured

output:
  format: terminal
  file: ""
  color: true

Available VS Code Tasks

  • AI Review: Pull Request (Interactive)
  • AI Review: PR (Dry-Run)
  • AI Review: List Active PRs
  • AI Review: Interactive Mode

Licence

This project is licensed under the Apache Licence 2.0 — see the LICENSE.

Metadata

Release files for code-review-ai-cli 2.2.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for code-review-ai-cli 2.2.3
File Size Uploaded
code_review_ai_cli-2.2.3.tar.gz 82.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for code-review-ai-cli 2.2.3
File Interpreter ABI Platform
code_review_ai_cli-2.2.3-py3-none-any.whl Python 3 none any Details

Total release size: 141.5 kB

Release files / code_review_ai_cli-2.2.3.tar.gz

Download URL code_review_ai_cli-2.2.3.tar.gz
Size 82.8 kB
Tags Source
SHA-256 checksum
How to use checksums
d02867a47c21394581ac11c0cf6e3761caf9492a3f69869e37b4b8816f1cd0cb
BLAKE2b-256 checksum
How to use checksums
42193b39f6f781bb933c5cb3ee39639123c4fdf9cc5e565286deef7e10b8d1df
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / code_review_ai_cli-2.2.3-py3-none-any.whl

Download URL code_review_ai_cli-2.2.3-py3-none-any.whl
Size 58.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6543d138da5d540afb9a541682ca00640f6b62803164031a0f7435da1395708a
BLAKE2b-256 checksum
How to use checksums
37110d5e2207b816b409479f8ed3ba922856053fbdb5a118c306b3cd8622bb67
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

2.2.6

2 release files

2.2.5

2 release files

2.2.4

2 release files

This release

2.2.3 This release

2 release files

2.2.2

2 release files

2.2.1

2 release files

2.2.0

2 release files

2.1.0

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.3.6

2 release files

1.3.5

2 release files

1.3.4

2 release files

1.3.3

2 release files

1.3.2

2 release files

1.3.1

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page