gitpr-cli 1.1.0__tar.gz → 1.3.0__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.
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/PKG-INFO +74 -16
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/README.md +73 -15
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/gitpr_cli.egg-info/PKG-INFO +74 -16
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/gitpr_cli.egg-info/SOURCES.txt +61 -1
- gitpr_cli-1.3.0/src/application/__init__.py +2 -0
- gitpr_cli-1.3.0/src/application/use_cases/__init__.py +8 -0
- gitpr_cli-1.3.0/src/application/use_cases/generate_pr_explanation.py +73 -0
- gitpr_cli-1.3.0/src/application/use_cases/generate_test_file.py +227 -0
- gitpr_cli-1.3.0/src/branding/__init__.py +1 -0
- gitpr_cli-1.3.0/src/branding/badge_builder.py +139 -0
- gitpr_cli-1.3.0/src/branding/badge_data.py +53 -0
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/src/cache.py +63 -2
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/src/changelog_builder.py +88 -15
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/src/config.py +217 -1
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/src/config_schema.py +167 -0
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/src/core.py +124 -4
- gitpr_cli-1.3.0/src/demo/__init__.py +7 -0
- gitpr_cli-1.3.0/src/demo/demo_runner.py +336 -0
- gitpr_cli-1.3.0/src/demo/fake_ai_provider.py +112 -0
- gitpr_cli-1.3.0/src/demo/scenarios/__init__.py +128 -0
- gitpr_cli-1.3.0/src/demo/scenarios/laravel_bug_fix.py +443 -0
- gitpr_cli-1.3.0/src/demo/scenarios/security_issue.py +511 -0
- gitpr_cli-1.3.0/src/diff_parser.py +321 -0
- gitpr_cli-1.3.0/src/domain/linter/__init__.py +8 -0
- gitpr_cli-1.3.0/src/domain/linter/sast_finding_mapper.py +79 -0
- gitpr_cli-1.3.0/src/domain/pr/__init__.py +14 -0
- gitpr_cli-1.3.0/src/domain/pr/explain_section_builder.py +124 -0
- gitpr_cli-1.3.0/src/domain/tests_generation/__init__.py +14 -0
- gitpr_cli-1.3.0/src/domain/tests_generation/framework_detector.py +120 -0
- gitpr_cli-1.3.0/src/domain/tests_generation/test_content_types.py +43 -0
- gitpr_cli-1.3.0/src/domain/tests_generation/test_scaffold_builder.py +92 -0
- gitpr_cli-1.3.0/src/fix/__init__.py +16 -0
- gitpr_cli-1.3.0/src/fix/apply_fix.py +479 -0
- gitpr_cli-1.3.0/src/fix/fix_history.py +153 -0
- gitpr_cli-1.3.0/src/fix/patch_applier.py +42 -0
- gitpr_cli-1.3.0/src/fix/patch_extractor.py +61 -0
- gitpr_cli-1.3.0/src/fix/patch_provenance.py +96 -0
- gitpr_cli-1.3.0/src/fix/patch_safety_classifier.py +101 -0
- gitpr_cli-1.3.0/src/fix/rollback_fix.py +69 -0
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/src/i18n.py +5 -1
- gitpr_cli-1.3.0/src/infrastructure/git/__init__.py +1 -0
- gitpr_cli-1.3.0/src/infrastructure/git/patch_applier.py +209 -0
- gitpr_cli-1.3.0/src/infrastructure/git/selective_stager.py +198 -0
- gitpr_cli-1.3.0/src/infrastructure/linter/external/__init__.py +9 -0
- gitpr_cli-1.3.0/src/infrastructure/linter/external/bandit_bridge.py +127 -0
- gitpr_cli-1.3.0/src/infrastructure/linter/external/base_bridge.py +105 -0
- gitpr_cli-1.3.0/src/infrastructure/linter/external/gitleaks_bridge.py +168 -0
- gitpr_cli-1.3.0/src/infrastructure/linter/external/semgrep_bridge.py +139 -0
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/src/infrastructure/scm/__init__.py +11 -0
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/src/infrastructure/scm/azure_devops_provider.py +13 -0
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/src/infrastructure/scm/base.py +29 -1
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/src/infrastructure/scm/bitbucket_provider.py +9 -0
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/src/infrastructure/scm/github_provider.py +77 -4
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/src/infrastructure/scm/gitlab_provider.py +50 -3
- gitpr_cli-1.3.0/src/infrastructure/scm/web_links.py +103 -0
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/src/linter_engine.py +135 -7
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/src/main.py +1105 -58
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/src/mcp_server.py +280 -1
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/src/release_engine.py +358 -22
- gitpr_cli-1.3.0/src/review/__init__.py +13 -0
- gitpr_cli-1.3.0/src/review/diff_normalizer.py +84 -0
- gitpr_cli-1.3.0/src/review/diff_source.py +69 -0
- gitpr_cli-1.3.0/src/review/remote_pr.py +319 -0
- gitpr_cli-1.3.0/src/review/render.py +75 -0
- gitpr_cli-1.3.0/src/reviewer_resolution.py +159 -0
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/src/reviewer_suggestion.py +19 -3
- gitpr_cli-1.3.0/src/security_ruleset.py +108 -0
- gitpr_cli-1.3.0/src/split/__init__.py +17 -0
- gitpr_cli-1.3.0/src/split/apply_split_plan.py +251 -0
- gitpr_cli-1.3.0/src/split/generate_split_plan.py +222 -0
- gitpr_cli-1.3.0/src/split/hunk_grouper.py +347 -0
- gitpr_cli-1.3.0/src/split/hunk_parser.py +256 -0
- gitpr_cli-1.3.0/src/split/split_plan.py +153 -0
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/src/suggest_reviewers.py +19 -12
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/src/ui/chat_app.py +38 -40
- gitpr_cli-1.3.0/src/ui/demo/__init__.py +1 -0
- gitpr_cli-1.3.0/src/ui/demo/demo_app.py +91 -0
- gitpr_cli-1.3.0/src/ui/demo/demo_help_screen.py +52 -0
- gitpr_cli-1.3.0/src/ui/demo/demo_screens.py +60 -0
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/src/ui/pr_publish_app.py +222 -38
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/src/updater.py +2 -2
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/tests/test_changelog_builder.py +108 -7
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/tests/test_config_app.py +3 -0
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/tests/test_core.py +12 -7
- gitpr_cli-1.3.0/tests/test_diff_parser.py +359 -0
- gitpr_cli-1.3.0/tests/test_explain_command.py +35 -0
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/tests/test_main_suggest_reviewers.py +40 -4
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/tests/test_mcp_server.py +227 -4
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/tests/test_metrics.py +21 -0
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/tests/test_net_timeouts.py +3 -3
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/tests/test_pr_publish_app.py +146 -5
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/tests/test_release_cli.py +1 -0
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/tests/test_release_engine.py +505 -0
- gitpr_cli-1.3.0/tests/test_reviewer_resolution.py +255 -0
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/tests/test_reviewer_suggestion.py +23 -0
- gitpr_cli-1.3.0/tests/test_security_ruleset.py +393 -0
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/tests/test_suggest_reviewers.py +32 -1
- gitpr_cli-1.3.0/tests/test_tests_command.py +45 -0
- gitpr_cli-1.3.0/tests/test_web_links.py +183 -0
- gitpr_cli-1.1.0/src/diff_parser.py +0 -159
- gitpr_cli-1.1.0/tests/test_diff_parser.py +0 -204
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/LICENSE +0 -0
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/gitpr_cli.egg-info/dependency_links.txt +0 -0
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/gitpr_cli.egg-info/entry_points.txt +0 -0
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/gitpr_cli.egg-info/requires.txt +0 -0
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/gitpr_cli.egg-info/top_level.txt +0 -0
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/pyproject.toml +0 -0
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/setup.cfg +0 -0
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/src/__init__.py +0 -0
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/src/ai_providers.py +0 -0
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/src/blame_engine.py +0 -0
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/src/chat_memory.py +0 -0
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/src/commit_classifier.py +0 -0
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/src/doc_links.py +0 -0
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/src/github_api.py +0 -0
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/src/infrastructure/__init__.py +0 -0
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/src/infrastructure/scm/factory.py +0 -0
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/src/issue_engine.py +0 -0
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/src/linter_wizard.py +0 -0
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/src/metrics.py +0 -0
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/src/net.py +0 -0
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/src/security.py +0 -0
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/src/spinner.py +0 -0
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/src/tui_issue.py +0 -0
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/src/ui/__init__.py +0 -0
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/src/ui/config_app.py +0 -0
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/src/ui/help_screen.py +0 -0
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/src/ui/issue_app.py +0 -0
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/src/ui/linter_app.py +0 -0
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/src/ui/metrics_app.py +0 -0
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/src/ui/pr_publish_help.py +0 -0
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/src/usage_log.py +0 -0
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/src/version_bump.py +0 -0
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/tests/test_blame_engine_ranges.py +0 -0
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/tests/test_blame_metrics.py +0 -0
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/tests/test_chat_backend.py +0 -0
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/tests/test_commit_classifier.py +0 -0
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/tests/test_config_cli.py +0 -0
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/tests/test_config_schema.py +0 -0
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/tests/test_config_store.py +0 -0
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/tests/test_config_suggest_reviewers.py +0 -0
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/tests/test_config_validation.py +0 -0
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/tests/test_external_linters.py +0 -0
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/tests/test_i18n.py +0 -0
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/tests/test_install_wizard.py +0 -0
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/tests/test_issue_engine.py +0 -0
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/tests/test_linter_metrics.py +0 -0
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/tests/test_linter_presets.py +0 -0
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/tests/test_mcp_prompts.py +0 -0
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/tests/test_mcp_server_e2e.py +0 -0
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/tests/test_plugins.py +0 -0
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/tests/test_pr_publish_linter_modal.py +0 -0
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/tests/test_pre_save.py +0 -0
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/tests/test_skill_command.py +0 -0
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/tests/test_skill_context.py +0 -0
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/tests/test_smart_excludes.py +0 -0
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/tests/test_thinking_words.py +0 -0
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/tests/test_updater.py +0 -0
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/tests/test_usage_log.py +0 -0
- {gitpr_cli-1.1.0 → gitpr_cli-1.3.0}/tests/test_version_bump.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: gitpr-cli
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.3.0
|
|
4
4
|
Summary: AI-powered PR automation, commit messages, and code review (Gemini, DeepSeek, and Ollama)
|
|
5
5
|
Author-email: Natan Fiuza <contato@natanfiuza.dev.br>
|
|
6
6
|
Requires-Python: >=3.10
|
|
@@ -24,6 +24,10 @@ Dynamic: license-file
|
|
|
24
24
|
<img src="https://raw.githubusercontent.com/natanfiuza/gitpr/main/docs/logo.png" alt="GitPR Logo" width="150">
|
|
25
25
|
</p>
|
|
26
26
|
|
|
27
|
+
<p align="center">
|
|
28
|
+
<a href="https://gitpr.natanfiuza.dev.br/"><img src="https://img.shields.io/badge/GitPR-quality--checked-blue" alt="GitPR"></a>
|
|
29
|
+
</p>
|
|
30
|
+
|
|
27
31
|
GitPR CLI is a command-line automation tool that uses **Google Gemini**, **DeepSeek**, and **Ollama** artificial intelligence to analyze your code changes (git diff) or entire files. The tool automatically generates commit messages in the *Conventional Commits* standard, detailed Pull Request descriptions, and deep Code Reviews aimed at reducing technical debt.
|
|
28
32
|
|
|
29
33
|
🌐 **Website:** [gitpr.natanfiuza.dev.br](https://gitpr.natanfiuza.dev.br/) · 📂 **Repository:** [https://github.com/gitpr-cli/gitpr.git](https://github.com/gitpr-cli/gitpr.git)
|
|
@@ -40,7 +44,18 @@ Install GitPR CLI using `pip`:
|
|
|
40
44
|
pip install gitpr-cli
|
|
41
45
|
```
|
|
42
46
|
|
|
43
|
-
### **2.
|
|
47
|
+
### **2. Seeing It Work (No Configuration)**
|
|
48
|
+
|
|
49
|
+
GitPR ships a guided tour over an example diff. It needs no API key, no Git repository and no connection:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
gitpr demo
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
> **Guided Tour:** Six screens walking through a real example — the diff, the commit message, the code review and the pull request description — with the answers recorded once and replayed. Add `--no-tui` for plain text, `--scenario security-issue` for the other example.
|
|
56
|
+
> 📖 **Full Documentation:** [https://gitpr.natanfiuza.dev.br/docs/demo?lang=en_us](https://gitpr.natanfiuza.dev.br/docs/demo?lang=en_us)
|
|
57
|
+
|
|
58
|
+
### **3. Initializing in a Repository**
|
|
44
59
|
|
|
45
60
|
To set up GitPR in a folder of a new repository, run:
|
|
46
61
|
|
|
@@ -113,15 +128,19 @@ Pytest will automatically detect files inside the `tests/` folder and display a
|
|
|
113
128
|
|
|
114
129
|
### From Source Code
|
|
115
130
|
|
|
116
|
-
1. Clone the repository: `git clone https://github.com/gitpr-cli/gitpr.git
|
|
131
|
+
1. Clone the repository: `git clone https://github.com/gitpr-cli/gitpr.git`
|
|
117
132
|
|
|
118
133
|
2. Enter the folder: `cd gitpr`
|
|
119
134
|
|
|
120
|
-
3.
|
|
135
|
+
3. Install in editable mode:
|
|
121
136
|
```bash
|
|
122
|
-
|
|
137
|
+
pip install -e .
|
|
123
138
|
```
|
|
124
|
-
4. Run:
|
|
139
|
+
4. Run: `gitpr`
|
|
140
|
+
|
|
141
|
+
> Prefer an isolated environment? Install the dependencies with `pipenv install google-genai openai python-dotenv click cryptography` and run `pipenv run python src/main.py` instead.
|
|
142
|
+
>
|
|
143
|
+
> **Note on the update gate:** a source install reports the version found in your checkout, so a tree behind the published release is stopped at startup. See [Installing GitPR from Source](docs/tutorial/install-from-source.md).
|
|
125
144
|
|
|
126
145
|
## **💻 How to Use**
|
|
127
146
|
|
|
@@ -137,6 +156,15 @@ The tool will sync with the remote (`git fetch`), compare your changes with the
|
|
|
137
156
|
### **Advanced Options and Commands**
|
|
138
157
|
You can pass the following *flags* for specific actions:
|
|
139
158
|
|
|
159
|
+
* `gitpr demo`: **Guided tour** over an example diff that ships with the tool — the commit message, the code review and the pull request description, produced by the real pipeline on a recorded example. Needs no API key, no Git repository and no connection, which makes it the first thing to run on a new machine. Use `--scenario <name>` for another example, `--lang <code>` for another language, `--no-tui` for plain text. 📖 [Full docs](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/demo.md)
|
|
160
|
+
* `gitpr badge`: **Adoption badge for your README.** Prints the Markdown snippet — `--readme` prints only the line, `--style` picks the shields.io style (`flat`, `flat-square`, `for-the-badge`). Nothing is written to your README. Published pull requests carry a badge of their own, with the linter counts of the diff; `GITPR_BADGE=false` turns it off. 📖 [Full docs](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/badge.md)
|
|
161
|
+
* `gitpr config`: **Interactive configuration screen.** Opens a master-detail TUI to view, edit, search, and validate all settings stored in `~/.gitpr/.env` (with secret encryption and live validation). 📖 [Full docs](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/config-tui.md)
|
|
162
|
+
* `gitpr release`: **Changelog and Release Notes generator.** Scans commits since the previous version, categorizes them according to Conventional Commits, suggests a semantic version bump, generates an AI executive summary, and optionally publishes the release to your forge. 📖 [Full docs](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/release-notes.md)
|
|
163
|
+
* `gitpr fix [<finding_id>]`: **Review findings patch application & rollback.** Turns findings from the last code review (`gitpr -r`) into safe, reviewable unified diffs. Includes safety classification (`safe`, `review_required`, `experimental`), `--all-safe` batching, `--force` validation, and `--rollback <patch-id>`. 📖 [Full docs](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/fix-command.md)
|
|
164
|
+
* `gitpr split`: **Atomic commit splitter.** Reads uncommitted working tree changes, groups hunks by intent using AI, and proposes ordered atomic commits without altering your working tree files (`--dry-run`, `--apply`). 📖 [Full docs](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/split-command.md)
|
|
165
|
+
* `gitpr tests generate`: **AI test suite generation & scaffolding.** Analyzes your diff, a target file (`--file`), or a review finding (`--finding`) and generates complete, executable test suites (supporting pytest, jest, vitest, phpunit, pest). Use `--apply` to write to disk.
|
|
166
|
+
* `gitpr explain`: **Reviewer Guide generator.** Generates a concise summary explaining what changed, why it changed, where reviewers should focus, and potential regression risks. 📖 [Full docs](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/pull-request-publication.md)
|
|
167
|
+
* `gitpr review-pr <pr_number>`: **Remote Pull Request review.** Fetches and reviews an open pull request directly from the forge (GitHub, GitLab, Bitbucket, Azure DevOps) without checking out the branch locally. Use `--post-comment` to post the review directly to the PR. 📖 [Full docs](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/review-pr.md)
|
|
140
168
|
* `-c` or `--commit`: Runs a local `git diff` and displays **only the suggested commit message**.
|
|
141
169
|
* `-r` or `--review`: Performs a detailed **Code Review** of local changes.
|
|
142
170
|
* `-f` or `--fullreview`: Performs a **Full Code Review** analyzing all changes since the remote branch.
|
|
@@ -147,17 +175,20 @@ You can pass the following *flags* for specific actions:
|
|
|
147
175
|
* `-l` or `--linter`: Runs **only the local static linter** (no AI calls). Ideal for use in CI/CD pipelines to block non-compliant code.
|
|
148
176
|
* `--status`: Lists uncommitted file changes categorized as **new**, **modified**, and **deleted** — fast, no AI, no network. 📖 [Full docs](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/git-status.md)
|
|
149
177
|
* `--no-unstaged-check`: Skips the unstaged files verification before AI processing for a single invocation. Equivalent to `GITPR_SKIP_UNSTAGED_CHECK=true` for one run. 📖 [Full docs](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/git-status.md)
|
|
178
|
+
* `--no-suggest-reviewers`: Disables the suggested reviewers computation in the interactive PR publisher (default ON). 📖 [Full docs](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/suggested-reviewers.md)
|
|
179
|
+
* `--explain`: Includes the Reviewer Guide section ("Explain my PR") in the Pull Request description.
|
|
180
|
+
* `--init`: **Interactive SCM forge wizard.** Detects the repository's forge (GitHub, GitLab, Bitbucket Cloud, Azure DevOps), configures the provider, and stores the access token encrypted. 📖 [Full docs](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/scm-multiforge.md)
|
|
150
181
|
* `--linter-setup`: **Interactive external linter wizard.** Guides you through installing and configuring external linters (ESLint, PHPCS, Stylelint) as a Checkstyle XML bridge. 📖 [Full docs](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/linter-regras-customizadas.md)
|
|
151
|
-
* `--mcp`: Starts GitPR as an **MCP server** (Model Context Protocol) on stdio transport. Enables integration with VS Code, Cursor, Claude Desktop, and other MCP-compatible editors — exposing all GitPR AI capabilities as
|
|
182
|
+
* `--mcp`: Starts GitPR as an **MCP server** (Model Context Protocol) on stdio transport. Enables integration with VS Code, Cursor, Claude Desktop, and other MCP-compatible editors — exposing all GitPR AI capabilities as 14 annotated tools, 18 resources, and 7 pre-built prompts directly inside your IDE. Also available as the standalone `gitpr-mcp` command.
|
|
152
183
|
* `--plugins`: Lists all **globally installed plugins** — custom linter packs from `~/.gitpr/plugins/linter/` and MCP prompt templates from `~/.gitpr/plugins/prompts/`. These plugins apply across all your projects without duplication. 📖 [Full docs](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/plugins-system.md)
|
|
153
184
|
* `--install`: **Interactive Setup Wizard.** Runs a guided 4-step setup: downloads skill templates, installs Git hooks, configures MCP for detected editors, and checks/requests your AI provider API key. Each step asks for confirmation before proceeding.
|
|
154
185
|
* `-ih` or `--installhooks`: Automatically installs **local Git Hooks** (`pre-commit` and `prepare-commit-msg`) in your repository.
|
|
155
|
-
* `-s` or `--skill`: Creates the AI context template files (`.gitpr.commit.md`, `.gitpr.pr.md`, `.gitpr.review.md`, `.gitpr.filereview.md`, `.gitpr.issue.md`, `.gitpr.blame.md`) and the Linter (`.gitpr.linter.yml`)
|
|
186
|
+
* `-s` or `--skill`: Creates the AI context template files (`.gitpr.commit.md`, `.gitpr.pr.md`, `.gitpr.review.md`, `.gitpr.filereview.md`, `.gitpr.issue.md`, `.gitpr.blame.md`) and the Linter (`.gitpr.linter.yml`) inside `.gitpr/skill/`.
|
|
156
187
|
* `-is` or `--issue`: Automatically generates a draft of a **standardized Issue** and opens an interactive interface (TUI) for editing or direct submission via REST API. This feature has **3 context engines** depending on the command combination:
|
|
157
188
|
* **New Code Issue (`gitpr -is`):** Reads the current `git diff`. **Why use:** Ideal for quickly documenting the task you just finished programming, before committing.
|
|
158
189
|
* **Epic/Release Issue (`gitpr -is -ht`):** Reads the full history of the current branch (Git Log + PR Cache). **Why use:** Ideal for generating consolidated documentation of an entire release or a large *feature* that took several days/commits to complete.
|
|
159
190
|
* **Archaeological/Technical Debt Issue (`gitpr -is -b file:lines`):** Reads the timeline of a specific business rule. **Why use:** Ideal for documenting technical debt, explaining how a legacy code block evolved and why it needs to be refactored.
|
|
160
|
-
|
|
191
|
+
* **PR Publisher (default):** Running `gitpr` generates the PR description with AI, saves the `.md` file to `.gitpr/reports/pr_desc/`, and opens an interactive terminal interface (TUI) to review, edit, and publish the Pull Request directly to GitHub, GitLab, Bitbucket, or Azure DevOps via REST API. Before generation, it checks for unstaged files, calculates suggested reviewers, and offers a modal to manage them. Use `--no-publish` to save only the PR file locally without opening the publisher, or `--no-edit` to auto-commit pending changes (with lint validation), auto-push, and publish immediately — handling existing PR updates, optional auto-merge, and clear error feedback when merge conflicts occur. Use `--base <branch>` to change the target branch. 📖 [Full docs](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/pull-request-publication.md)
|
|
161
192
|
* `-h` or `--help`: Shows the general help with all options. Use together with another flag for **contextual help** (e.g.: `gitpr -h --issue`, `gitpr -h --linter`) with a direct link to the detailed documentation of each feature.
|
|
162
193
|
* `-u` or `--update`: Checks the latest version of GitPR on PyPI and shows how to update it (Auto-Updater).
|
|
163
194
|
|
|
@@ -171,7 +202,7 @@ When your diff is too large for a single AI call (over ~90k estimated tokens), G
|
|
|
171
202
|
|
|
172
203
|
📚 Full documentation: [docs/map-reduce-diff.md](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/map-reduce-diff.md)
|
|
173
204
|
|
|
174
|
-
## 🛡️ Local Linter (Static Analysis)
|
|
205
|
+
## 🛡️ Local Linter (Static Analysis & Security)
|
|
175
206
|
|
|
176
207
|
GitPR CLI allows you to define strict rules that will be validated instantly during `--review` or `--fullreview`, without depending on AI. This is ideal for preventing common errors (like `console.log` or test IPs) from reaching the repository.
|
|
177
208
|
|
|
@@ -192,9 +223,9 @@ rules:
|
|
|
192
223
|
|
|
193
224
|
The Linter analyzes only the **added lines** in your `git diff`, ensuring a focused and extremely fast execution. If there are violations, they will appear highlighted at the top of your review file.
|
|
194
225
|
|
|
195
|
-
### External Linters (Checkstyle Bridge)
|
|
226
|
+
### External Linters & SAST Bridges (Checkstyle Bridge)
|
|
196
227
|
|
|
197
|
-
If your project already uses tools like ESLint, PHP_CodeSniffer or
|
|
228
|
+
If your project already uses tools like ESLint, PHP_CodeSniffer, Stylelint, Semgrep, Gitleaks, or Bandit, GitPR can act as a bridge — running them in the background and filtering errors **only for the lines you changed** in your current diff. Any linter or SAST scanner that emits reports in the `checkstyle` format is supported. In addition, GitPR includes embedded secret scanning rules to catch leaked API keys, tokens, and credentials before they leave your machine.
|
|
198
229
|
|
|
199
230
|
Instead of configuring the YAML manually, use the interactive wizard:
|
|
200
231
|
|
|
@@ -204,7 +235,7 @@ gitpr --linter-setup
|
|
|
204
235
|
|
|
205
236
|
The wizard shows pre-configured presets (PHPCS, ESLint, Stylelint — controlled remotely via `templates/gitpr.linter-presets.json`), guides you through the native installation command (e.g.: `npm install --save-dev eslint`), and injects the correct `external_linters` block into your `.gitpr.linter.yml`.
|
|
206
237
|
|
|
207
|
-
Every run — manual via `--linter` or automatic before commits — consolidates the Regex Rules and External Linters into a single Markdown report saved at `.gitpr/reports/linter/` (customizable via `OUTPUT_FILE_NAME_LINTER`). The report is generated only when violations are found — clean runs create no files.
|
|
238
|
+
Every run — manual via `--linter` or automatic before commits — consolidates the Regex Rules, Embedded Security Rules, and External Linters into a single Markdown report saved at `.gitpr/reports/linter/` (customizable via `OUTPUT_FILE_NAME_LINTER`). The report is generated only when violations are found — clean runs create no files.
|
|
208
239
|
|
|
209
240
|
## 🤝 Co-Author Signature
|
|
210
241
|
|
|
@@ -218,6 +249,22 @@ The trailer is appended programmatically (never by the AI) in all flows: console
|
|
|
218
249
|
|
|
219
250
|
📖 **Full documentation:** [docs/commit-message-ia.md](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/commit-message-ia.md)
|
|
220
251
|
|
|
252
|
+
## 🏷️ Pull Request Badge
|
|
253
|
+
|
|
254
|
+
Every pull request GitPR publishes carries a badge at the foot of the body, with what the local linter counted on that very diff:
|
|
255
|
+
|
|
256
|
+
```text
|
|
257
|
+
GitPR | 0 errors · 2 warnings
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
It is built from a real measurement, never from a claim: red when a blocking finding is there, yellow for advice, green when the rules found nothing — and **no badge at all when no linter rules are configured**, because a green badge over a diff nobody checked would say something GitPR cannot back. It is on by default; `GITPR_BADGE=false` turns it off, and `gitpr --skill` is what gives it rules to count.
|
|
261
|
+
|
|
262
|
+
For your own README there is a static badge. `gitpr badge --readme` prints the line and writes nothing — pasting it is your call:
|
|
263
|
+
|
|
264
|
+
[](https://gitpr.natanfiuza.dev.br/)
|
|
265
|
+
|
|
266
|
+
📖 **Full documentation:** [docs/badge.md](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/badge.md)
|
|
267
|
+
|
|
221
268
|
## 🧠 Multi-Model Architecture (AI-Agnostic)
|
|
222
269
|
|
|
223
270
|
GitPR is not tied to a single Artificial Intelligence. During initial setup, the user can choose their default engine. We currently support:
|
|
@@ -229,7 +276,7 @@ You can dynamically switch models by configuring the `GEMINI_API_MODEL_PRIMARY`
|
|
|
229
276
|
|
|
230
277
|
## 🎯 Customizable "Skills" System (Prompt Engineering)
|
|
231
278
|
|
|
232
|
-
Instead of hiding AI instructions in the source code, GitPR uses local Markdown files that act as *System Instructions*. When running `gitpr -s`, the following files are generated
|
|
279
|
+
Instead of hiding AI instructions in the source code, GitPR uses local Markdown files that act as *System Instructions*. When running `gitpr -s`, the following files are generated inside `.gitpr/skill/` to customize the AI's "persona" according to your company's business rules:
|
|
233
280
|
|
|
234
281
|
* `.gitpr.commit.md`: Rules for generating short commit messages.
|
|
235
282
|
* `.gitpr.pr.md`: Required topic structure for the Pull Request description.
|
|
@@ -335,6 +382,8 @@ Once configured, use natural language in your editor's AI chat:
|
|
|
335
382
|
| `generate_issue` | Structured issue from diff, history, or blame |
|
|
336
383
|
| `list_unstaged_files` | Uncommitted file changes categorized (new/modified/deleted) |
|
|
337
384
|
| `analyze_unstaged_diff` | Unstaged diff only (working tree vs index) |
|
|
385
|
+
| `list_fix_candidates` | Fix candidates of the last review: patch, classification, id (read-only) |
|
|
386
|
+
| `review_remote_pr` | AI review of a pull request already open on the forge, fetched by number (read-only) |
|
|
338
387
|
|
|
339
388
|
### Direct CLI Invocation
|
|
340
389
|
|
|
@@ -428,17 +477,26 @@ If you want to implement GitPR as an automated quality barrier in your team, che
|
|
|
428
477
|
|
|
429
478
|
### Core Features
|
|
430
479
|
|
|
480
|
+
* [**Guided Tour (gitpr demo)**](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/demo.md) — How the `gitpr demo` subcommand walks through the commit message, the code review and the pull request description over a recorded example, with no API key, no repository and no network.
|
|
481
|
+
* [**Pull Request Badge**](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/badge.md) — What the badge GitPR attaches to published pull requests says, where it is attached, when it is left out, and how to print the static one for your own README.
|
|
431
482
|
* [**Pull Request (Default Mode)**](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/pr-descricao-padrao.md) — Complete flow for generating PR descriptions without flags.
|
|
432
483
|
* [**Pull Request Publisher TUI**](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/pull-request-publication.md) — How to review and publish Pull Requests directly to GitHub from the terminal.
|
|
433
|
-
* [**AI Code Review**](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/code-review-ia.md) — Guide to review modes (`--review`, `--fullreview`)
|
|
484
|
+
* [**AI Code Review**](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/code-review-ia.md) — Guide to review modes (`--review`, `--fullreview`), file auditing (`--input`) and remote pull request review (`gitpr review-pr`).
|
|
485
|
+
* [**Remote Pull Request Review (gitpr review-pr)**](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/review-pr.md) — How the `gitpr review-pr` subcommand reviews a pull request that is already open on the forge, fetching its diff from the API without checking out its branch.
|
|
434
486
|
* [**AI Commit Messages**](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/commit-message-ia.md) — How to generate messages in the Conventional Commits standard and integrate with Git Hooks.
|
|
435
487
|
* [**Issue Generation and TUI Interface**](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/issue-tui-help.md) — How to use the terminal graphical interface (TUI) and the 3 context engines to manage structured Issues.
|
|
436
488
|
* [**Code Archaeologist (Git Blame)**](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/blame-arqueologo.md) — How to trace the origin of business rules with `git blame` and AI.
|
|
437
489
|
* [**Skills and Templates System**](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/skill-template.md) — How to customize AI behavior with `.gitpr.*.md` files.
|
|
438
|
-
* [**Release Notes & Changelog (gitpr release)**](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/release-notes.md) — How the `gitpr release` subcommand generates the changelog / release notes of a repository, suggests the next semantic version and publishes releases on the forge.
|
|
490
|
+
* [**Release Notes & Changelog (gitpr release)**](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/release-notes.md) — How the `gitpr release` subcommand generates the changelog / release notes of a repository from the delta of the previous version, links every commit, pull request and contributor, suggests the next semantic version and publishes releases on the forge.
|
|
491
|
+
* [**Fix Command (gitpr fix)**](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/fix-command.md) — How the `gitpr fix` subcommand turns the findings of the last review into patches you read before they touch your tree, classifies each one by safety, and undoes an applied patch on demand.
|
|
492
|
+
* [**Split Command (gitpr split)**](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/split-command.md) — How the `gitpr split` subcommand reads a working tree holding several concerns, groups the hunks by intent with AI, and turns them into ordered atomic commits without ever writing to your files.
|
|
439
493
|
|
|
440
494
|
### Configuration & Infrastructure
|
|
441
495
|
|
|
496
|
+
* [**Interactive Configuration TUI (gitpr config)**](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/config-tui.md) — Master-detail terminal interface to view, edit, and validate settings in `~/.gitpr/.env`.
|
|
497
|
+
* [**Multi-Forge SCM Integration**](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/scm-multiforge.md) — Unified SCM provider layer for GitHub, GitLab, Bitbucket Cloud, and Azure DevOps with `--init` wizard.
|
|
498
|
+
* [**Suggested Reviewers**](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/suggested-reviewers.md) — Automatic reviewer suggestion via Git blame of added lines mapped to forge logins.
|
|
499
|
+
* [**Usage Telemetry & Audit Log**](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/usage-log.md) — Local invocation logging and audit history for tracking CLI executions.
|
|
442
500
|
* [**Install Wizard**](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/install-wizard.md) — Step-by-step guided setup for configuring GitPR in a new project.
|
|
443
501
|
* [**AI Providers**](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/providers-ia.md) — Configuration and selection between Google Gemini, DeepSeek, and Ollama.
|
|
444
502
|
* [**Auto-Updater**](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/auto-update.md) — How GitPR's automatic update and the mandatory update block work.
|
|
@@ -5,6 +5,10 @@
|
|
|
5
5
|
<img src="https://raw.githubusercontent.com/natanfiuza/gitpr/main/docs/logo.png" alt="GitPR Logo" width="150">
|
|
6
6
|
</p>
|
|
7
7
|
|
|
8
|
+
<p align="center">
|
|
9
|
+
<a href="https://gitpr.natanfiuza.dev.br/"><img src="https://img.shields.io/badge/GitPR-quality--checked-blue" alt="GitPR"></a>
|
|
10
|
+
</p>
|
|
11
|
+
|
|
8
12
|
GitPR CLI is a command-line automation tool that uses **Google Gemini**, **DeepSeek**, and **Ollama** artificial intelligence to analyze your code changes (git diff) or entire files. The tool automatically generates commit messages in the *Conventional Commits* standard, detailed Pull Request descriptions, and deep Code Reviews aimed at reducing technical debt.
|
|
9
13
|
|
|
10
14
|
🌐 **Website:** [gitpr.natanfiuza.dev.br](https://gitpr.natanfiuza.dev.br/) · 📂 **Repository:** [https://github.com/gitpr-cli/gitpr.git](https://github.com/gitpr-cli/gitpr.git)
|
|
@@ -21,7 +25,18 @@ Install GitPR CLI using `pip`:
|
|
|
21
25
|
pip install gitpr-cli
|
|
22
26
|
```
|
|
23
27
|
|
|
24
|
-
### **2.
|
|
28
|
+
### **2. Seeing It Work (No Configuration)**
|
|
29
|
+
|
|
30
|
+
GitPR ships a guided tour over an example diff. It needs no API key, no Git repository and no connection:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
gitpr demo
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
> **Guided Tour:** Six screens walking through a real example — the diff, the commit message, the code review and the pull request description — with the answers recorded once and replayed. Add `--no-tui` for plain text, `--scenario security-issue` for the other example.
|
|
37
|
+
> 📖 **Full Documentation:** [https://gitpr.natanfiuza.dev.br/docs/demo?lang=en_us](https://gitpr.natanfiuza.dev.br/docs/demo?lang=en_us)
|
|
38
|
+
|
|
39
|
+
### **3. Initializing in a Repository**
|
|
25
40
|
|
|
26
41
|
To set up GitPR in a folder of a new repository, run:
|
|
27
42
|
|
|
@@ -94,15 +109,19 @@ Pytest will automatically detect files inside the `tests/` folder and display a
|
|
|
94
109
|
|
|
95
110
|
### From Source Code
|
|
96
111
|
|
|
97
|
-
1. Clone the repository: `git clone https://github.com/gitpr-cli/gitpr.git
|
|
112
|
+
1. Clone the repository: `git clone https://github.com/gitpr-cli/gitpr.git`
|
|
98
113
|
|
|
99
114
|
2. Enter the folder: `cd gitpr`
|
|
100
115
|
|
|
101
|
-
3.
|
|
116
|
+
3. Install in editable mode:
|
|
102
117
|
```bash
|
|
103
|
-
|
|
118
|
+
pip install -e .
|
|
104
119
|
```
|
|
105
|
-
4. Run:
|
|
120
|
+
4. Run: `gitpr`
|
|
121
|
+
|
|
122
|
+
> Prefer an isolated environment? Install the dependencies with `pipenv install google-genai openai python-dotenv click cryptography` and run `pipenv run python src/main.py` instead.
|
|
123
|
+
>
|
|
124
|
+
> **Note on the update gate:** a source install reports the version found in your checkout, so a tree behind the published release is stopped at startup. See [Installing GitPR from Source](docs/tutorial/install-from-source.md).
|
|
106
125
|
|
|
107
126
|
## **💻 How to Use**
|
|
108
127
|
|
|
@@ -118,6 +137,15 @@ The tool will sync with the remote (`git fetch`), compare your changes with the
|
|
|
118
137
|
### **Advanced Options and Commands**
|
|
119
138
|
You can pass the following *flags* for specific actions:
|
|
120
139
|
|
|
140
|
+
* `gitpr demo`: **Guided tour** over an example diff that ships with the tool — the commit message, the code review and the pull request description, produced by the real pipeline on a recorded example. Needs no API key, no Git repository and no connection, which makes it the first thing to run on a new machine. Use `--scenario <name>` for another example, `--lang <code>` for another language, `--no-tui` for plain text. 📖 [Full docs](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/demo.md)
|
|
141
|
+
* `gitpr badge`: **Adoption badge for your README.** Prints the Markdown snippet — `--readme` prints only the line, `--style` picks the shields.io style (`flat`, `flat-square`, `for-the-badge`). Nothing is written to your README. Published pull requests carry a badge of their own, with the linter counts of the diff; `GITPR_BADGE=false` turns it off. 📖 [Full docs](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/badge.md)
|
|
142
|
+
* `gitpr config`: **Interactive configuration screen.** Opens a master-detail TUI to view, edit, search, and validate all settings stored in `~/.gitpr/.env` (with secret encryption and live validation). 📖 [Full docs](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/config-tui.md)
|
|
143
|
+
* `gitpr release`: **Changelog and Release Notes generator.** Scans commits since the previous version, categorizes them according to Conventional Commits, suggests a semantic version bump, generates an AI executive summary, and optionally publishes the release to your forge. 📖 [Full docs](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/release-notes.md)
|
|
144
|
+
* `gitpr fix [<finding_id>]`: **Review findings patch application & rollback.** Turns findings from the last code review (`gitpr -r`) into safe, reviewable unified diffs. Includes safety classification (`safe`, `review_required`, `experimental`), `--all-safe` batching, `--force` validation, and `--rollback <patch-id>`. 📖 [Full docs](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/fix-command.md)
|
|
145
|
+
* `gitpr split`: **Atomic commit splitter.** Reads uncommitted working tree changes, groups hunks by intent using AI, and proposes ordered atomic commits without altering your working tree files (`--dry-run`, `--apply`). 📖 [Full docs](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/split-command.md)
|
|
146
|
+
* `gitpr tests generate`: **AI test suite generation & scaffolding.** Analyzes your diff, a target file (`--file`), or a review finding (`--finding`) and generates complete, executable test suites (supporting pytest, jest, vitest, phpunit, pest). Use `--apply` to write to disk.
|
|
147
|
+
* `gitpr explain`: **Reviewer Guide generator.** Generates a concise summary explaining what changed, why it changed, where reviewers should focus, and potential regression risks. 📖 [Full docs](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/pull-request-publication.md)
|
|
148
|
+
* `gitpr review-pr <pr_number>`: **Remote Pull Request review.** Fetches and reviews an open pull request directly from the forge (GitHub, GitLab, Bitbucket, Azure DevOps) without checking out the branch locally. Use `--post-comment` to post the review directly to the PR. 📖 [Full docs](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/review-pr.md)
|
|
121
149
|
* `-c` or `--commit`: Runs a local `git diff` and displays **only the suggested commit message**.
|
|
122
150
|
* `-r` or `--review`: Performs a detailed **Code Review** of local changes.
|
|
123
151
|
* `-f` or `--fullreview`: Performs a **Full Code Review** analyzing all changes since the remote branch.
|
|
@@ -128,17 +156,20 @@ You can pass the following *flags* for specific actions:
|
|
|
128
156
|
* `-l` or `--linter`: Runs **only the local static linter** (no AI calls). Ideal for use in CI/CD pipelines to block non-compliant code.
|
|
129
157
|
* `--status`: Lists uncommitted file changes categorized as **new**, **modified**, and **deleted** — fast, no AI, no network. 📖 [Full docs](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/git-status.md)
|
|
130
158
|
* `--no-unstaged-check`: Skips the unstaged files verification before AI processing for a single invocation. Equivalent to `GITPR_SKIP_UNSTAGED_CHECK=true` for one run. 📖 [Full docs](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/git-status.md)
|
|
159
|
+
* `--no-suggest-reviewers`: Disables the suggested reviewers computation in the interactive PR publisher (default ON). 📖 [Full docs](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/suggested-reviewers.md)
|
|
160
|
+
* `--explain`: Includes the Reviewer Guide section ("Explain my PR") in the Pull Request description.
|
|
161
|
+
* `--init`: **Interactive SCM forge wizard.** Detects the repository's forge (GitHub, GitLab, Bitbucket Cloud, Azure DevOps), configures the provider, and stores the access token encrypted. 📖 [Full docs](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/scm-multiforge.md)
|
|
131
162
|
* `--linter-setup`: **Interactive external linter wizard.** Guides you through installing and configuring external linters (ESLint, PHPCS, Stylelint) as a Checkstyle XML bridge. 📖 [Full docs](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/linter-regras-customizadas.md)
|
|
132
|
-
* `--mcp`: Starts GitPR as an **MCP server** (Model Context Protocol) on stdio transport. Enables integration with VS Code, Cursor, Claude Desktop, and other MCP-compatible editors — exposing all GitPR AI capabilities as
|
|
163
|
+
* `--mcp`: Starts GitPR as an **MCP server** (Model Context Protocol) on stdio transport. Enables integration with VS Code, Cursor, Claude Desktop, and other MCP-compatible editors — exposing all GitPR AI capabilities as 14 annotated tools, 18 resources, and 7 pre-built prompts directly inside your IDE. Also available as the standalone `gitpr-mcp` command.
|
|
133
164
|
* `--plugins`: Lists all **globally installed plugins** — custom linter packs from `~/.gitpr/plugins/linter/` and MCP prompt templates from `~/.gitpr/plugins/prompts/`. These plugins apply across all your projects without duplication. 📖 [Full docs](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/plugins-system.md)
|
|
134
165
|
* `--install`: **Interactive Setup Wizard.** Runs a guided 4-step setup: downloads skill templates, installs Git hooks, configures MCP for detected editors, and checks/requests your AI provider API key. Each step asks for confirmation before proceeding.
|
|
135
166
|
* `-ih` or `--installhooks`: Automatically installs **local Git Hooks** (`pre-commit` and `prepare-commit-msg`) in your repository.
|
|
136
|
-
* `-s` or `--skill`: Creates the AI context template files (`.gitpr.commit.md`, `.gitpr.pr.md`, `.gitpr.review.md`, `.gitpr.filereview.md`, `.gitpr.issue.md`, `.gitpr.blame.md`) and the Linter (`.gitpr.linter.yml`)
|
|
167
|
+
* `-s` or `--skill`: Creates the AI context template files (`.gitpr.commit.md`, `.gitpr.pr.md`, `.gitpr.review.md`, `.gitpr.filereview.md`, `.gitpr.issue.md`, `.gitpr.blame.md`) and the Linter (`.gitpr.linter.yml`) inside `.gitpr/skill/`.
|
|
137
168
|
* `-is` or `--issue`: Automatically generates a draft of a **standardized Issue** and opens an interactive interface (TUI) for editing or direct submission via REST API. This feature has **3 context engines** depending on the command combination:
|
|
138
169
|
* **New Code Issue (`gitpr -is`):** Reads the current `git diff`. **Why use:** Ideal for quickly documenting the task you just finished programming, before committing.
|
|
139
170
|
* **Epic/Release Issue (`gitpr -is -ht`):** Reads the full history of the current branch (Git Log + PR Cache). **Why use:** Ideal for generating consolidated documentation of an entire release or a large *feature* that took several days/commits to complete.
|
|
140
171
|
* **Archaeological/Technical Debt Issue (`gitpr -is -b file:lines`):** Reads the timeline of a specific business rule. **Why use:** Ideal for documenting technical debt, explaining how a legacy code block evolved and why it needs to be refactored.
|
|
141
|
-
|
|
172
|
+
* **PR Publisher (default):** Running `gitpr` generates the PR description with AI, saves the `.md` file to `.gitpr/reports/pr_desc/`, and opens an interactive terminal interface (TUI) to review, edit, and publish the Pull Request directly to GitHub, GitLab, Bitbucket, or Azure DevOps via REST API. Before generation, it checks for unstaged files, calculates suggested reviewers, and offers a modal to manage them. Use `--no-publish` to save only the PR file locally without opening the publisher, or `--no-edit` to auto-commit pending changes (with lint validation), auto-push, and publish immediately — handling existing PR updates, optional auto-merge, and clear error feedback when merge conflicts occur. Use `--base <branch>` to change the target branch. 📖 [Full docs](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/pull-request-publication.md)
|
|
142
173
|
* `-h` or `--help`: Shows the general help with all options. Use together with another flag for **contextual help** (e.g.: `gitpr -h --issue`, `gitpr -h --linter`) with a direct link to the detailed documentation of each feature.
|
|
143
174
|
* `-u` or `--update`: Checks the latest version of GitPR on PyPI and shows how to update it (Auto-Updater).
|
|
144
175
|
|
|
@@ -152,7 +183,7 @@ When your diff is too large for a single AI call (over ~90k estimated tokens), G
|
|
|
152
183
|
|
|
153
184
|
📚 Full documentation: [docs/map-reduce-diff.md](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/map-reduce-diff.md)
|
|
154
185
|
|
|
155
|
-
## 🛡️ Local Linter (Static Analysis)
|
|
186
|
+
## 🛡️ Local Linter (Static Analysis & Security)
|
|
156
187
|
|
|
157
188
|
GitPR CLI allows you to define strict rules that will be validated instantly during `--review` or `--fullreview`, without depending on AI. This is ideal for preventing common errors (like `console.log` or test IPs) from reaching the repository.
|
|
158
189
|
|
|
@@ -173,9 +204,9 @@ rules:
|
|
|
173
204
|
|
|
174
205
|
The Linter analyzes only the **added lines** in your `git diff`, ensuring a focused and extremely fast execution. If there are violations, they will appear highlighted at the top of your review file.
|
|
175
206
|
|
|
176
|
-
### External Linters (Checkstyle Bridge)
|
|
207
|
+
### External Linters & SAST Bridges (Checkstyle Bridge)
|
|
177
208
|
|
|
178
|
-
If your project already uses tools like ESLint, PHP_CodeSniffer or
|
|
209
|
+
If your project already uses tools like ESLint, PHP_CodeSniffer, Stylelint, Semgrep, Gitleaks, or Bandit, GitPR can act as a bridge — running them in the background and filtering errors **only for the lines you changed** in your current diff. Any linter or SAST scanner that emits reports in the `checkstyle` format is supported. In addition, GitPR includes embedded secret scanning rules to catch leaked API keys, tokens, and credentials before they leave your machine.
|
|
179
210
|
|
|
180
211
|
Instead of configuring the YAML manually, use the interactive wizard:
|
|
181
212
|
|
|
@@ -185,7 +216,7 @@ gitpr --linter-setup
|
|
|
185
216
|
|
|
186
217
|
The wizard shows pre-configured presets (PHPCS, ESLint, Stylelint — controlled remotely via `templates/gitpr.linter-presets.json`), guides you through the native installation command (e.g.: `npm install --save-dev eslint`), and injects the correct `external_linters` block into your `.gitpr.linter.yml`.
|
|
187
218
|
|
|
188
|
-
Every run — manual via `--linter` or automatic before commits — consolidates the Regex Rules and External Linters into a single Markdown report saved at `.gitpr/reports/linter/` (customizable via `OUTPUT_FILE_NAME_LINTER`). The report is generated only when violations are found — clean runs create no files.
|
|
219
|
+
Every run — manual via `--linter` or automatic before commits — consolidates the Regex Rules, Embedded Security Rules, and External Linters into a single Markdown report saved at `.gitpr/reports/linter/` (customizable via `OUTPUT_FILE_NAME_LINTER`). The report is generated only when violations are found — clean runs create no files.
|
|
189
220
|
|
|
190
221
|
## 🤝 Co-Author Signature
|
|
191
222
|
|
|
@@ -199,6 +230,22 @@ The trailer is appended programmatically (never by the AI) in all flows: console
|
|
|
199
230
|
|
|
200
231
|
📖 **Full documentation:** [docs/commit-message-ia.md](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/commit-message-ia.md)
|
|
201
232
|
|
|
233
|
+
## 🏷️ Pull Request Badge
|
|
234
|
+
|
|
235
|
+
Every pull request GitPR publishes carries a badge at the foot of the body, with what the local linter counted on that very diff:
|
|
236
|
+
|
|
237
|
+
```text
|
|
238
|
+
GitPR | 0 errors · 2 warnings
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
It is built from a real measurement, never from a claim: red when a blocking finding is there, yellow for advice, green when the rules found nothing — and **no badge at all when no linter rules are configured**, because a green badge over a diff nobody checked would say something GitPR cannot back. It is on by default; `GITPR_BADGE=false` turns it off, and `gitpr --skill` is what gives it rules to count.
|
|
242
|
+
|
|
243
|
+
For your own README there is a static badge. `gitpr badge --readme` prints the line and writes nothing — pasting it is your call:
|
|
244
|
+
|
|
245
|
+
[](https://gitpr.natanfiuza.dev.br/)
|
|
246
|
+
|
|
247
|
+
📖 **Full documentation:** [docs/badge.md](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/badge.md)
|
|
248
|
+
|
|
202
249
|
## 🧠 Multi-Model Architecture (AI-Agnostic)
|
|
203
250
|
|
|
204
251
|
GitPR is not tied to a single Artificial Intelligence. During initial setup, the user can choose their default engine. We currently support:
|
|
@@ -210,7 +257,7 @@ You can dynamically switch models by configuring the `GEMINI_API_MODEL_PRIMARY`
|
|
|
210
257
|
|
|
211
258
|
## 🎯 Customizable "Skills" System (Prompt Engineering)
|
|
212
259
|
|
|
213
|
-
Instead of hiding AI instructions in the source code, GitPR uses local Markdown files that act as *System Instructions*. When running `gitpr -s`, the following files are generated
|
|
260
|
+
Instead of hiding AI instructions in the source code, GitPR uses local Markdown files that act as *System Instructions*. When running `gitpr -s`, the following files are generated inside `.gitpr/skill/` to customize the AI's "persona" according to your company's business rules:
|
|
214
261
|
|
|
215
262
|
* `.gitpr.commit.md`: Rules for generating short commit messages.
|
|
216
263
|
* `.gitpr.pr.md`: Required topic structure for the Pull Request description.
|
|
@@ -316,6 +363,8 @@ Once configured, use natural language in your editor's AI chat:
|
|
|
316
363
|
| `generate_issue` | Structured issue from diff, history, or blame |
|
|
317
364
|
| `list_unstaged_files` | Uncommitted file changes categorized (new/modified/deleted) |
|
|
318
365
|
| `analyze_unstaged_diff` | Unstaged diff only (working tree vs index) |
|
|
366
|
+
| `list_fix_candidates` | Fix candidates of the last review: patch, classification, id (read-only) |
|
|
367
|
+
| `review_remote_pr` | AI review of a pull request already open on the forge, fetched by number (read-only) |
|
|
319
368
|
|
|
320
369
|
### Direct CLI Invocation
|
|
321
370
|
|
|
@@ -409,17 +458,26 @@ If you want to implement GitPR as an automated quality barrier in your team, che
|
|
|
409
458
|
|
|
410
459
|
### Core Features
|
|
411
460
|
|
|
461
|
+
* [**Guided Tour (gitpr demo)**](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/demo.md) — How the `gitpr demo` subcommand walks through the commit message, the code review and the pull request description over a recorded example, with no API key, no repository and no network.
|
|
462
|
+
* [**Pull Request Badge**](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/badge.md) — What the badge GitPR attaches to published pull requests says, where it is attached, when it is left out, and how to print the static one for your own README.
|
|
412
463
|
* [**Pull Request (Default Mode)**](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/pr-descricao-padrao.md) — Complete flow for generating PR descriptions without flags.
|
|
413
464
|
* [**Pull Request Publisher TUI**](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/pull-request-publication.md) — How to review and publish Pull Requests directly to GitHub from the terminal.
|
|
414
|
-
* [**AI Code Review**](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/code-review-ia.md) — Guide to review modes (`--review`, `--fullreview`)
|
|
465
|
+
* [**AI Code Review**](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/code-review-ia.md) — Guide to review modes (`--review`, `--fullreview`), file auditing (`--input`) and remote pull request review (`gitpr review-pr`).
|
|
466
|
+
* [**Remote Pull Request Review (gitpr review-pr)**](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/review-pr.md) — How the `gitpr review-pr` subcommand reviews a pull request that is already open on the forge, fetching its diff from the API without checking out its branch.
|
|
415
467
|
* [**AI Commit Messages**](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/commit-message-ia.md) — How to generate messages in the Conventional Commits standard and integrate with Git Hooks.
|
|
416
468
|
* [**Issue Generation and TUI Interface**](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/issue-tui-help.md) — How to use the terminal graphical interface (TUI) and the 3 context engines to manage structured Issues.
|
|
417
469
|
* [**Code Archaeologist (Git Blame)**](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/blame-arqueologo.md) — How to trace the origin of business rules with `git blame` and AI.
|
|
418
470
|
* [**Skills and Templates System**](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/skill-template.md) — How to customize AI behavior with `.gitpr.*.md` files.
|
|
419
|
-
* [**Release Notes & Changelog (gitpr release)**](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/release-notes.md) — How the `gitpr release` subcommand generates the changelog / release notes of a repository, suggests the next semantic version and publishes releases on the forge.
|
|
471
|
+
* [**Release Notes & Changelog (gitpr release)**](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/release-notes.md) — How the `gitpr release` subcommand generates the changelog / release notes of a repository from the delta of the previous version, links every commit, pull request and contributor, suggests the next semantic version and publishes releases on the forge.
|
|
472
|
+
* [**Fix Command (gitpr fix)**](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/fix-command.md) — How the `gitpr fix` subcommand turns the findings of the last review into patches you read before they touch your tree, classifies each one by safety, and undoes an applied patch on demand.
|
|
473
|
+
* [**Split Command (gitpr split)**](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/split-command.md) — How the `gitpr split` subcommand reads a working tree holding several concerns, groups the hunks by intent with AI, and turns them into ordered atomic commits without ever writing to your files.
|
|
420
474
|
|
|
421
475
|
### Configuration & Infrastructure
|
|
422
476
|
|
|
477
|
+
* [**Interactive Configuration TUI (gitpr config)**](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/config-tui.md) — Master-detail terminal interface to view, edit, and validate settings in `~/.gitpr/.env`.
|
|
478
|
+
* [**Multi-Forge SCM Integration**](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/scm-multiforge.md) — Unified SCM provider layer for GitHub, GitLab, Bitbucket Cloud, and Azure DevOps with `--init` wizard.
|
|
479
|
+
* [**Suggested Reviewers**](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/suggested-reviewers.md) — Automatic reviewer suggestion via Git blame of added lines mapped to forge logins.
|
|
480
|
+
* [**Usage Telemetry & Audit Log**](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/usage-log.md) — Local invocation logging and audit history for tracking CLI executions.
|
|
423
481
|
* [**Install Wizard**](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/install-wizard.md) — Step-by-step guided setup for configuring GitPR in a new project.
|
|
424
482
|
* [**AI Providers**](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/providers-ia.md) — Configuration and selection between Google Gemini, DeepSeek, and Ollama.
|
|
425
483
|
* [**Auto-Updater**](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/auto-update.md) — How GitPR's automatic update and the mandatory update block work.
|