code-review-ai-cli 1.0.1__tar.gz → 1.0.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- code_review_ai_cli-1.0.2/PKG-INFO +195 -0
- code_review_ai_cli-1.0.2/README.md +158 -0
- code_review_ai_cli-1.0.2/code_review_ai_cli.egg-info/PKG-INFO +195 -0
- {code_review_ai_cli-1.0.1 → code_review_ai_cli-1.0.2}/pyproject.toml +1 -1
- {code_review_ai_cli-1.0.1 → code_review_ai_cli-1.0.2}/src/config.py +16 -7
- {code_review_ai_cli-1.0.1 → code_review_ai_cli-1.0.2}/src/llm_client.py +274 -10
- {code_review_ai_cli-1.0.1 → code_review_ai_cli-1.0.2}/src/prompts/config.yaml.template +5 -5
- {code_review_ai_cli-1.0.1 → code_review_ai_cli-1.0.2}/tests/test_config.py +39 -1
- {code_review_ai_cli-1.0.1 → code_review_ai_cli-1.0.2}/tests/test_llm_client.py +177 -9
- code_review_ai_cli-1.0.1/PKG-INFO +0 -418
- code_review_ai_cli-1.0.1/README.md +0 -381
- code_review_ai_cli-1.0.1/code_review_ai_cli.egg-info/PKG-INFO +0 -418
- {code_review_ai_cli-1.0.1 → code_review_ai_cli-1.0.2}/code_review_ai_cli.egg-info/SOURCES.txt +0 -0
- {code_review_ai_cli-1.0.1 → code_review_ai_cli-1.0.2}/code_review_ai_cli.egg-info/dependency_links.txt +0 -0
- {code_review_ai_cli-1.0.1 → code_review_ai_cli-1.0.2}/code_review_ai_cli.egg-info/entry_points.txt +0 -0
- {code_review_ai_cli-1.0.1 → code_review_ai_cli-1.0.2}/code_review_ai_cli.egg-info/requires.txt +0 -0
- {code_review_ai_cli-1.0.1 → code_review_ai_cli-1.0.2}/code_review_ai_cli.egg-info/top_level.txt +0 -0
- {code_review_ai_cli-1.0.1 → code_review_ai_cli-1.0.2}/setup.cfg +0 -0
- {code_review_ai_cli-1.0.1 → code_review_ai_cli-1.0.2}/src/__init__.py +0 -0
- {code_review_ai_cli-1.0.1 → code_review_ai_cli-1.0.2}/src/ai_review.py +0 -0
- {code_review_ai_cli-1.0.1 → code_review_ai_cli-1.0.2}/src/formatter.py +0 -0
- {code_review_ai_cli-1.0.1 → code_review_ai_cli-1.0.2}/src/git_utils.py +0 -0
- {code_review_ai_cli-1.0.1 → code_review_ai_cli-1.0.2}/src/prompts/review_prompt.md.template +0 -0
- {code_review_ai_cli-1.0.1 → code_review_ai_cli-1.0.2}/src/tfs_client.py +0 -0
- {code_review_ai_cli-1.0.1 → code_review_ai_cli-1.0.2}/tests/test_ai_review.py +0 -0
- {code_review_ai_cli-1.0.1 → code_review_ai_cli-1.0.2}/tests/test_formatter.py +0 -0
- {code_review_ai_cli-1.0.1 → code_review_ai_cli-1.0.2}/tests/test_git_utils.py +0 -0
- {code_review_ai_cli-1.0.1 → code_review_ai_cli-1.0.2}/tests/test_tfs_client.py +0 -0
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: code-review-ai-cli
|
|
3
|
+
Version: 1.0.2
|
|
4
|
+
Summary: Automated AI-powered code review CLI for Azure DevOps / TFS Pull Requests
|
|
5
|
+
License: MIT
|
|
6
|
+
Keywords: code-review,ai,azure-devops,tfs,pull-request,llm
|
|
7
|
+
Classifier: Development Status :: 4 - Beta
|
|
8
|
+
Classifier: Environment :: Console
|
|
9
|
+
Classifier: Intended Audience :: Developers
|
|
10
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
15
|
+
Classifier: Topic :: Software Development :: Quality Assurance
|
|
16
|
+
Requires-Python: >=3.10
|
|
17
|
+
Description-Content-Type: text/markdown
|
|
18
|
+
Requires-Dist: requests>=2.28.0
|
|
19
|
+
Requires-Dist: PyYAML>=6.0
|
|
20
|
+
Provides-Extra: bedrock
|
|
21
|
+
Requires-Dist: boto3>=1.34.0; extra == "bedrock"
|
|
22
|
+
Provides-Extra: openai
|
|
23
|
+
Requires-Dist: openai>=1.0.0; extra == "openai"
|
|
24
|
+
Provides-Extra: gemini
|
|
25
|
+
Requires-Dist: google-generativeai>=0.3.0; extra == "gemini"
|
|
26
|
+
Provides-Extra: claude
|
|
27
|
+
Requires-Dist: anthropic>=0.18.0; extra == "claude"
|
|
28
|
+
Provides-Extra: all
|
|
29
|
+
Requires-Dist: boto3>=1.34.0; extra == "all"
|
|
30
|
+
Requires-Dist: openai>=1.0.0; extra == "all"
|
|
31
|
+
Requires-Dist: google-generativeai>=0.3.0; extra == "all"
|
|
32
|
+
Requires-Dist: anthropic>=0.18.0; extra == "all"
|
|
33
|
+
Provides-Extra: dev
|
|
34
|
+
Requires-Dist: pytest>=8.3.0; extra == "dev"
|
|
35
|
+
Requires-Dist: pytest-cov>=5.0.0; extra == "dev"
|
|
36
|
+
Requires-Dist: pytest-mock>=3.14.0; extra == "dev"
|
|
37
|
+
|
|
38
|
+
# AI Code Review CLI
|
|
39
|
+
|
|
40
|
+
Automated code review tool with Pull Request integration for Azure DevOps/TFS and support for multiple LLM providers.
|
|
41
|
+
**Documentation where** [docs/index.md](docs/index.md) for complete guides on CLI usage, LLM configuration, and architecture.
|
|
42
|
+
|
|
43
|
+
## Features
|
|
44
|
+
|
|
45
|
+
- **AI Pull Request Review** — Automated code analysis with configurable LLM providers
|
|
46
|
+
- **Structured Comments** — Inline suggestions + general summary comments
|
|
47
|
+
- **Dry-run Mode** — Validate reviews before posting
|
|
48
|
+
- **Multiple LLM Providers** — OpenAI, Azure OpenAI, Gemini, Claude, Ollama, GitHub Copilot, AWS Bedrock
|
|
49
|
+
- **Smart Filtering** — Filter by file extensions, limit diff size
|
|
50
|
+
- **Customizable Prompts** — Markdown-based review guidelines
|
|
51
|
+
- **Interactive CLI** — Menu-driven selection and confirmation
|
|
52
|
+
|
|
53
|
+
## Installation & Quick Start
|
|
54
|
+
|
|
55
|
+
### 1. Install Package
|
|
56
|
+
|
|
57
|
+
From PyPI:
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
pip install code-review-ai-cli
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
With optional LLM SDK extras:
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
pip install "code-review-ai-cli[bedrock]" # AWS Bedrock
|
|
67
|
+
pip install "code-review-ai-cli[openai]" # OpenAI SDK
|
|
68
|
+
pip install "code-review-ai-cli[gemini]" # Google Gemini SDK
|
|
69
|
+
pip install "code-review-ai-cli[claude]" # Anthropic Claude SDK
|
|
70
|
+
pip install "code-review-ai-cli[all]" # All optional SDKs
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
For development:
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
pip install -r requirements.txt
|
|
77
|
+
pip install "code-review-ai-cli[dev]" # Test suite + linting
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### 2. Initialize Configuration
|
|
81
|
+
|
|
82
|
+
Generate config templates in your project directory:
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
ai-review init
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Creates:
|
|
89
|
+
- `config.yaml` — LLM and review settings
|
|
90
|
+
- `review_prompt.md` — Customizable review guidelines
|
|
91
|
+
|
|
92
|
+
### 3. Run Your First Review
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
# List active PRs
|
|
96
|
+
ai-review list-prs
|
|
97
|
+
|
|
98
|
+
# Review a specific PR
|
|
99
|
+
ai-review pr-review 42
|
|
100
|
+
|
|
101
|
+
# Dry-run (preview without posting)
|
|
102
|
+
ai-review pr-review 42 --dry-run
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## Configuration File
|
|
106
|
+
|
|
107
|
+
After `ai-review init`, edit `config.yaml`:
|
|
108
|
+
|
|
109
|
+
```yaml
|
|
110
|
+
llm:
|
|
111
|
+
provider: bedrock # or: openai, gemini, claude, etc.
|
|
112
|
+
model: anthropic.claude-3-5-sonnet-20240620-v1:0
|
|
113
|
+
|
|
114
|
+
bedrock:
|
|
115
|
+
region: us-east-1
|
|
116
|
+
|
|
117
|
+
tfs:
|
|
118
|
+
base_url: https://dev.azure.com/your-org
|
|
119
|
+
project: YourProject
|
|
120
|
+
pat: xxxxxxxxx
|
|
121
|
+
|
|
122
|
+
review:
|
|
123
|
+
language: pt
|
|
124
|
+
verbosity: detailed # or: quick, security
|
|
125
|
+
file_extensions_filter: [".cs", ".ts", ".py"]
|
|
126
|
+
max_diff_files: 50
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
## Development & Testing
|
|
130
|
+
|
|
131
|
+
This is a standard Python project with the following structure:
|
|
132
|
+
|
|
133
|
+
```
|
|
134
|
+
src/
|
|
135
|
+
ai_review.py # CLI entry point
|
|
136
|
+
config.py # Configuration management
|
|
137
|
+
llm_client.py # LLM provider abstraction
|
|
138
|
+
tfs_client.py # Azure DevOps integration
|
|
139
|
+
git_utils.py # Git diff processing
|
|
140
|
+
formatter.py # Output formatting (terminal, markdown, JSON)
|
|
141
|
+
|
|
142
|
+
tests/
|
|
143
|
+
test_*.py # Unit and integration tests
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
### Run Tests
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
python -m pytest --cov=src --cov-report=term
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
### Code Quality
|
|
153
|
+
|
|
154
|
+
Project follows PEP8 with Black formatter and Ruff linter:
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
# Format code
|
|
158
|
+
black src/ tests/
|
|
159
|
+
|
|
160
|
+
# Lint
|
|
161
|
+
ruff check src/ tests/
|
|
162
|
+
|
|
163
|
+
# Type checking (if using mypy)
|
|
164
|
+
mypy src/
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
## VS Code Integration
|
|
169
|
+
|
|
170
|
+
Predefined tasks for quick execution in VS Code:
|
|
171
|
+
|
|
172
|
+
### Available Tasks
|
|
173
|
+
|
|
174
|
+
1. **AI Review: Pull Request (Interactive)**
|
|
175
|
+
- Interactive mode with main menu
|
|
176
|
+
- Run with: `Ctrl+Shift+B` → Select task
|
|
177
|
+
|
|
178
|
+
2. **AI Review: PR (Dry-Run)**
|
|
179
|
+
- Dry-run for a specific PR
|
|
180
|
+
- Prompts for PR ID
|
|
181
|
+
|
|
182
|
+
3. **AI Review: List Active PRs**
|
|
183
|
+
- Lists active PRs
|
|
184
|
+
- Quick diagnostics
|
|
185
|
+
|
|
186
|
+
4. **AI Review: Interactive Mode**
|
|
187
|
+
- Full tool menu
|
|
188
|
+
- Runs in background
|
|
189
|
+
|
|
190
|
+
### How to run tasks
|
|
191
|
+
|
|
192
|
+
In VS Code:
|
|
193
|
+
1. `Ctrl+Shift+P` → "Tasks: Run Task"
|
|
194
|
+
2. Select the desired task
|
|
195
|
+
3. Fill in parameters if needed
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
# AI Code Review CLI
|
|
2
|
+
|
|
3
|
+
Automated code review tool with Pull Request integration for Azure DevOps/TFS and support for multiple LLM providers.
|
|
4
|
+
**Documentation where** [docs/index.md](docs/index.md) for complete guides on CLI usage, LLM configuration, and architecture.
|
|
5
|
+
|
|
6
|
+
## Features
|
|
7
|
+
|
|
8
|
+
- **AI Pull Request Review** — Automated code analysis with configurable LLM providers
|
|
9
|
+
- **Structured Comments** — Inline suggestions + general summary comments
|
|
10
|
+
- **Dry-run Mode** — Validate reviews before posting
|
|
11
|
+
- **Multiple LLM Providers** — OpenAI, Azure OpenAI, Gemini, Claude, Ollama, GitHub Copilot, AWS Bedrock
|
|
12
|
+
- **Smart Filtering** — Filter by file extensions, limit diff size
|
|
13
|
+
- **Customizable Prompts** — Markdown-based review guidelines
|
|
14
|
+
- **Interactive CLI** — Menu-driven selection and confirmation
|
|
15
|
+
|
|
16
|
+
## Installation & Quick Start
|
|
17
|
+
|
|
18
|
+
### 1. Install Package
|
|
19
|
+
|
|
20
|
+
From PyPI:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
pip install code-review-ai-cli
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
With optional LLM SDK extras:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
pip install "code-review-ai-cli[bedrock]" # AWS Bedrock
|
|
30
|
+
pip install "code-review-ai-cli[openai]" # OpenAI SDK
|
|
31
|
+
pip install "code-review-ai-cli[gemini]" # Google Gemini SDK
|
|
32
|
+
pip install "code-review-ai-cli[claude]" # Anthropic Claude SDK
|
|
33
|
+
pip install "code-review-ai-cli[all]" # All optional SDKs
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
For development:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
pip install -r requirements.txt
|
|
40
|
+
pip install "code-review-ai-cli[dev]" # Test suite + linting
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### 2. Initialize Configuration
|
|
44
|
+
|
|
45
|
+
Generate config templates in your project directory:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
ai-review init
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Creates:
|
|
52
|
+
- `config.yaml` — LLM and review settings
|
|
53
|
+
- `review_prompt.md` — Customizable review guidelines
|
|
54
|
+
|
|
55
|
+
### 3. Run Your First Review
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
# List active PRs
|
|
59
|
+
ai-review list-prs
|
|
60
|
+
|
|
61
|
+
# Review a specific PR
|
|
62
|
+
ai-review pr-review 42
|
|
63
|
+
|
|
64
|
+
# Dry-run (preview without posting)
|
|
65
|
+
ai-review pr-review 42 --dry-run
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Configuration File
|
|
69
|
+
|
|
70
|
+
After `ai-review init`, edit `config.yaml`:
|
|
71
|
+
|
|
72
|
+
```yaml
|
|
73
|
+
llm:
|
|
74
|
+
provider: bedrock # or: openai, gemini, claude, etc.
|
|
75
|
+
model: anthropic.claude-3-5-sonnet-20240620-v1:0
|
|
76
|
+
|
|
77
|
+
bedrock:
|
|
78
|
+
region: us-east-1
|
|
79
|
+
|
|
80
|
+
tfs:
|
|
81
|
+
base_url: https://dev.azure.com/your-org
|
|
82
|
+
project: YourProject
|
|
83
|
+
pat: xxxxxxxxx
|
|
84
|
+
|
|
85
|
+
review:
|
|
86
|
+
language: pt
|
|
87
|
+
verbosity: detailed # or: quick, security
|
|
88
|
+
file_extensions_filter: [".cs", ".ts", ".py"]
|
|
89
|
+
max_diff_files: 50
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## Development & Testing
|
|
93
|
+
|
|
94
|
+
This is a standard Python project with the following structure:
|
|
95
|
+
|
|
96
|
+
```
|
|
97
|
+
src/
|
|
98
|
+
ai_review.py # CLI entry point
|
|
99
|
+
config.py # Configuration management
|
|
100
|
+
llm_client.py # LLM provider abstraction
|
|
101
|
+
tfs_client.py # Azure DevOps integration
|
|
102
|
+
git_utils.py # Git diff processing
|
|
103
|
+
formatter.py # Output formatting (terminal, markdown, JSON)
|
|
104
|
+
|
|
105
|
+
tests/
|
|
106
|
+
test_*.py # Unit and integration tests
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Run Tests
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
python -m pytest --cov=src --cov-report=term
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### Code Quality
|
|
116
|
+
|
|
117
|
+
Project follows PEP8 with Black formatter and Ruff linter:
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
# Format code
|
|
121
|
+
black src/ tests/
|
|
122
|
+
|
|
123
|
+
# Lint
|
|
124
|
+
ruff check src/ tests/
|
|
125
|
+
|
|
126
|
+
# Type checking (if using mypy)
|
|
127
|
+
mypy src/
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
## VS Code Integration
|
|
132
|
+
|
|
133
|
+
Predefined tasks for quick execution in VS Code:
|
|
134
|
+
|
|
135
|
+
### Available Tasks
|
|
136
|
+
|
|
137
|
+
1. **AI Review: Pull Request (Interactive)**
|
|
138
|
+
- Interactive mode with main menu
|
|
139
|
+
- Run with: `Ctrl+Shift+B` → Select task
|
|
140
|
+
|
|
141
|
+
2. **AI Review: PR (Dry-Run)**
|
|
142
|
+
- Dry-run for a specific PR
|
|
143
|
+
- Prompts for PR ID
|
|
144
|
+
|
|
145
|
+
3. **AI Review: List Active PRs**
|
|
146
|
+
- Lists active PRs
|
|
147
|
+
- Quick diagnostics
|
|
148
|
+
|
|
149
|
+
4. **AI Review: Interactive Mode**
|
|
150
|
+
- Full tool menu
|
|
151
|
+
- Runs in background
|
|
152
|
+
|
|
153
|
+
### How to run tasks
|
|
154
|
+
|
|
155
|
+
In VS Code:
|
|
156
|
+
1. `Ctrl+Shift+P` → "Tasks: Run Task"
|
|
157
|
+
2. Select the desired task
|
|
158
|
+
3. Fill in parameters if needed
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: code-review-ai-cli
|
|
3
|
+
Version: 1.0.2
|
|
4
|
+
Summary: Automated AI-powered code review CLI for Azure DevOps / TFS Pull Requests
|
|
5
|
+
License: MIT
|
|
6
|
+
Keywords: code-review,ai,azure-devops,tfs,pull-request,llm
|
|
7
|
+
Classifier: Development Status :: 4 - Beta
|
|
8
|
+
Classifier: Environment :: Console
|
|
9
|
+
Classifier: Intended Audience :: Developers
|
|
10
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
15
|
+
Classifier: Topic :: Software Development :: Quality Assurance
|
|
16
|
+
Requires-Python: >=3.10
|
|
17
|
+
Description-Content-Type: text/markdown
|
|
18
|
+
Requires-Dist: requests>=2.28.0
|
|
19
|
+
Requires-Dist: PyYAML>=6.0
|
|
20
|
+
Provides-Extra: bedrock
|
|
21
|
+
Requires-Dist: boto3>=1.34.0; extra == "bedrock"
|
|
22
|
+
Provides-Extra: openai
|
|
23
|
+
Requires-Dist: openai>=1.0.0; extra == "openai"
|
|
24
|
+
Provides-Extra: gemini
|
|
25
|
+
Requires-Dist: google-generativeai>=0.3.0; extra == "gemini"
|
|
26
|
+
Provides-Extra: claude
|
|
27
|
+
Requires-Dist: anthropic>=0.18.0; extra == "claude"
|
|
28
|
+
Provides-Extra: all
|
|
29
|
+
Requires-Dist: boto3>=1.34.0; extra == "all"
|
|
30
|
+
Requires-Dist: openai>=1.0.0; extra == "all"
|
|
31
|
+
Requires-Dist: google-generativeai>=0.3.0; extra == "all"
|
|
32
|
+
Requires-Dist: anthropic>=0.18.0; extra == "all"
|
|
33
|
+
Provides-Extra: dev
|
|
34
|
+
Requires-Dist: pytest>=8.3.0; extra == "dev"
|
|
35
|
+
Requires-Dist: pytest-cov>=5.0.0; extra == "dev"
|
|
36
|
+
Requires-Dist: pytest-mock>=3.14.0; extra == "dev"
|
|
37
|
+
|
|
38
|
+
# AI Code Review CLI
|
|
39
|
+
|
|
40
|
+
Automated code review tool with Pull Request integration for Azure DevOps/TFS and support for multiple LLM providers.
|
|
41
|
+
**Documentation where** [docs/index.md](docs/index.md) for complete guides on CLI usage, LLM configuration, and architecture.
|
|
42
|
+
|
|
43
|
+
## Features
|
|
44
|
+
|
|
45
|
+
- **AI Pull Request Review** — Automated code analysis with configurable LLM providers
|
|
46
|
+
- **Structured Comments** — Inline suggestions + general summary comments
|
|
47
|
+
- **Dry-run Mode** — Validate reviews before posting
|
|
48
|
+
- **Multiple LLM Providers** — OpenAI, Azure OpenAI, Gemini, Claude, Ollama, GitHub Copilot, AWS Bedrock
|
|
49
|
+
- **Smart Filtering** — Filter by file extensions, limit diff size
|
|
50
|
+
- **Customizable Prompts** — Markdown-based review guidelines
|
|
51
|
+
- **Interactive CLI** — Menu-driven selection and confirmation
|
|
52
|
+
|
|
53
|
+
## Installation & Quick Start
|
|
54
|
+
|
|
55
|
+
### 1. Install Package
|
|
56
|
+
|
|
57
|
+
From PyPI:
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
pip install code-review-ai-cli
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
With optional LLM SDK extras:
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
pip install "code-review-ai-cli[bedrock]" # AWS Bedrock
|
|
67
|
+
pip install "code-review-ai-cli[openai]" # OpenAI SDK
|
|
68
|
+
pip install "code-review-ai-cli[gemini]" # Google Gemini SDK
|
|
69
|
+
pip install "code-review-ai-cli[claude]" # Anthropic Claude SDK
|
|
70
|
+
pip install "code-review-ai-cli[all]" # All optional SDKs
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
For development:
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
pip install -r requirements.txt
|
|
77
|
+
pip install "code-review-ai-cli[dev]" # Test suite + linting
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### 2. Initialize Configuration
|
|
81
|
+
|
|
82
|
+
Generate config templates in your project directory:
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
ai-review init
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Creates:
|
|
89
|
+
- `config.yaml` — LLM and review settings
|
|
90
|
+
- `review_prompt.md` — Customizable review guidelines
|
|
91
|
+
|
|
92
|
+
### 3. Run Your First Review
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
# List active PRs
|
|
96
|
+
ai-review list-prs
|
|
97
|
+
|
|
98
|
+
# Review a specific PR
|
|
99
|
+
ai-review pr-review 42
|
|
100
|
+
|
|
101
|
+
# Dry-run (preview without posting)
|
|
102
|
+
ai-review pr-review 42 --dry-run
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## Configuration File
|
|
106
|
+
|
|
107
|
+
After `ai-review init`, edit `config.yaml`:
|
|
108
|
+
|
|
109
|
+
```yaml
|
|
110
|
+
llm:
|
|
111
|
+
provider: bedrock # or: openai, gemini, claude, etc.
|
|
112
|
+
model: anthropic.claude-3-5-sonnet-20240620-v1:0
|
|
113
|
+
|
|
114
|
+
bedrock:
|
|
115
|
+
region: us-east-1
|
|
116
|
+
|
|
117
|
+
tfs:
|
|
118
|
+
base_url: https://dev.azure.com/your-org
|
|
119
|
+
project: YourProject
|
|
120
|
+
pat: xxxxxxxxx
|
|
121
|
+
|
|
122
|
+
review:
|
|
123
|
+
language: pt
|
|
124
|
+
verbosity: detailed # or: quick, security
|
|
125
|
+
file_extensions_filter: [".cs", ".ts", ".py"]
|
|
126
|
+
max_diff_files: 50
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
## Development & Testing
|
|
130
|
+
|
|
131
|
+
This is a standard Python project with the following structure:
|
|
132
|
+
|
|
133
|
+
```
|
|
134
|
+
src/
|
|
135
|
+
ai_review.py # CLI entry point
|
|
136
|
+
config.py # Configuration management
|
|
137
|
+
llm_client.py # LLM provider abstraction
|
|
138
|
+
tfs_client.py # Azure DevOps integration
|
|
139
|
+
git_utils.py # Git diff processing
|
|
140
|
+
formatter.py # Output formatting (terminal, markdown, JSON)
|
|
141
|
+
|
|
142
|
+
tests/
|
|
143
|
+
test_*.py # Unit and integration tests
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
### Run Tests
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
python -m pytest --cov=src --cov-report=term
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
### Code Quality
|
|
153
|
+
|
|
154
|
+
Project follows PEP8 with Black formatter and Ruff linter:
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
# Format code
|
|
158
|
+
black src/ tests/
|
|
159
|
+
|
|
160
|
+
# Lint
|
|
161
|
+
ruff check src/ tests/
|
|
162
|
+
|
|
163
|
+
# Type checking (if using mypy)
|
|
164
|
+
mypy src/
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
## VS Code Integration
|
|
169
|
+
|
|
170
|
+
Predefined tasks for quick execution in VS Code:
|
|
171
|
+
|
|
172
|
+
### Available Tasks
|
|
173
|
+
|
|
174
|
+
1. **AI Review: Pull Request (Interactive)**
|
|
175
|
+
- Interactive mode with main menu
|
|
176
|
+
- Run with: `Ctrl+Shift+B` → Select task
|
|
177
|
+
|
|
178
|
+
2. **AI Review: PR (Dry-Run)**
|
|
179
|
+
- Dry-run for a specific PR
|
|
180
|
+
- Prompts for PR ID
|
|
181
|
+
|
|
182
|
+
3. **AI Review: List Active PRs**
|
|
183
|
+
- Lists active PRs
|
|
184
|
+
- Quick diagnostics
|
|
185
|
+
|
|
186
|
+
4. **AI Review: Interactive Mode**
|
|
187
|
+
- Full tool menu
|
|
188
|
+
- Runs in background
|
|
189
|
+
|
|
190
|
+
### How to run tasks
|
|
191
|
+
|
|
192
|
+
In VS Code:
|
|
193
|
+
1. `Ctrl+Shift+P` → "Tasks: Run Task"
|
|
194
|
+
2. Select the desired task
|
|
195
|
+
3. Fill in parameters if needed
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "code-review-ai-cli"
|
|
7
|
-
version = "1.0.
|
|
7
|
+
version = "1.0.2"
|
|
8
8
|
description = "Automated AI-powered code review CLI for Azure DevOps / TFS Pull Requests"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.10"
|
|
@@ -291,11 +291,6 @@ class ReviewConfig:
|
|
|
291
291
|
"Provider 'bedrock' requires an AWS region.\n"
|
|
292
292
|
" Configure bedrock.region in config.yaml (e.g., us-east-1)."
|
|
293
293
|
)
|
|
294
|
-
if self.bedrock_access_key_id and not self.bedrock_secret_access_key:
|
|
295
|
-
issues.append(
|
|
296
|
-
"Provider 'bedrock': secret_access_key is missing.\n"
|
|
297
|
-
" Configure bedrock.secret_access_key when access_key_id is set."
|
|
298
|
-
)
|
|
299
294
|
if self.bedrock_secret_access_key and not self.bedrock_access_key_id:
|
|
300
295
|
issues.append(
|
|
301
296
|
"Provider 'bedrock': access_key_id is missing.\n"
|
|
@@ -329,7 +324,14 @@ class ReviewConfig:
|
|
|
329
324
|
return issues
|
|
330
325
|
|
|
331
326
|
def get_provider_info(self) -> str:
|
|
332
|
-
"""Returns formatted
|
|
327
|
+
"""Returns a formatted string describing the configured LLM provider.
|
|
328
|
+
|
|
329
|
+
For ``bedrock``, reports one of four credential modes: long-term API key
|
|
330
|
+
(Bearer), IAM explicit (SigV4), named profile, or default credential chain.
|
|
331
|
+
|
|
332
|
+
Returns:
|
|
333
|
+
Human-readable summary of provider, model, and credential status.
|
|
334
|
+
"""
|
|
333
335
|
provider = self.llm_provider
|
|
334
336
|
model = self.get_effective_model()
|
|
335
337
|
has_key = bool(self.api_key or self.get_effective_api_key())
|
|
@@ -338,7 +340,14 @@ class ReviewConfig:
|
|
|
338
340
|
url = self.get_effective_base_url()
|
|
339
341
|
return f"{provider} | {model} | URL: {url}"
|
|
340
342
|
if provider == "bedrock":
|
|
341
|
-
|
|
343
|
+
if self.bedrock_access_key_id and not self.bedrock_secret_access_key:
|
|
344
|
+
creds_mode = "long-term API key (Bearer)"
|
|
345
|
+
elif self.bedrock_access_key_id and self.bedrock_secret_access_key:
|
|
346
|
+
creds_mode = "IAM explicit (SigV4)"
|
|
347
|
+
elif self.bedrock_profile:
|
|
348
|
+
creds_mode = f"profile: {self.bedrock_profile}"
|
|
349
|
+
else:
|
|
350
|
+
creds_mode = "default credential chain"
|
|
342
351
|
region = self.bedrock_region or "(not configured)"
|
|
343
352
|
return f"{provider} | {model} | Region: {region} | Credentials: {creds_mode}"
|
|
344
353
|
else:
|