gitpr-cli 0.0.38__tar.gz → 1.1.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-0.0.38 → gitpr_cli-1.1.0}/PKG-INFO +55 -70
- {gitpr_cli-0.0.38 → gitpr_cli-1.1.0}/README.md +472 -487
- {gitpr_cli-0.0.38 → gitpr_cli-1.1.0}/gitpr_cli.egg-info/PKG-INFO +55 -70
- {gitpr_cli-0.0.38 → gitpr_cli-1.1.0}/gitpr_cli.egg-info/SOURCES.txt +40 -2
- {gitpr_cli-0.0.38 → gitpr_cli-1.1.0}/src/blame_engine.py +111 -1
- gitpr_cli-1.1.0/src/changelog_builder.py +199 -0
- gitpr_cli-1.1.0/src/commit_classifier.py +133 -0
- gitpr_cli-1.1.0/src/config.py +858 -0
- gitpr_cli-1.1.0/src/config_schema.py +986 -0
- {gitpr_cli-0.0.38 → gitpr_cli-1.1.0}/src/core.py +399 -109
- gitpr_cli-1.1.0/src/diff_parser.py +159 -0
- gitpr_cli-1.1.0/src/doc_links.py +28 -0
- gitpr_cli-1.1.0/src/github_api.py +112 -0
- {gitpr_cli-0.0.38 → gitpr_cli-1.1.0}/src/i18n.py +18 -3
- gitpr_cli-1.1.0/src/infrastructure/__init__.py +1 -0
- gitpr_cli-1.1.0/src/infrastructure/scm/__init__.py +51 -0
- gitpr_cli-1.1.0/src/infrastructure/scm/azure_devops_provider.py +388 -0
- gitpr_cli-1.1.0/src/infrastructure/scm/base.py +238 -0
- gitpr_cli-1.1.0/src/infrastructure/scm/bitbucket_provider.py +326 -0
- gitpr_cli-1.1.0/src/infrastructure/scm/factory.py +97 -0
- gitpr_cli-1.1.0/src/infrastructure/scm/github_provider.py +400 -0
- gitpr_cli-1.1.0/src/infrastructure/scm/gitlab_provider.py +335 -0
- {gitpr_cli-0.0.38 → gitpr_cli-1.1.0}/src/linter_wizard.py +6 -2
- {gitpr_cli-0.0.38 → gitpr_cli-1.1.0}/src/main.py +617 -114
- {gitpr_cli-0.0.38 → gitpr_cli-1.1.0}/src/mcp_server.py +24 -0
- gitpr_cli-1.1.0/src/release_engine.py +590 -0
- gitpr_cli-1.1.0/src/reviewer_suggestion.py +242 -0
- {gitpr_cli-0.0.38 → gitpr_cli-1.1.0}/src/spinner.py +15 -5
- gitpr_cli-1.1.0/src/suggest_reviewers.py +139 -0
- gitpr_cli-1.1.0/src/tui_issue.py +281 -0
- {gitpr_cli-0.0.38 → gitpr_cli-1.1.0}/src/ui/chat_app.py +1 -1
- gitpr_cli-1.1.0/src/ui/config_app.py +1835 -0
- {gitpr_cli-0.0.38 → gitpr_cli-1.1.0}/src/ui/help_screen.py +1 -1
- gitpr_cli-1.1.0/src/ui/issue_app.py +236 -0
- {gitpr_cli-0.0.38 → gitpr_cli-1.1.0}/src/ui/pr_publish_app.py +216 -52
- gitpr_cli-1.1.0/src/updater.py +145 -0
- gitpr_cli-1.1.0/src/usage_log.py +175 -0
- gitpr_cli-1.1.0/src/version_bump.py +87 -0
- gitpr_cli-1.1.0/tests/test_blame_engine_ranges.py +140 -0
- gitpr_cli-1.1.0/tests/test_changelog_builder.py +185 -0
- gitpr_cli-1.1.0/tests/test_commit_classifier.py +174 -0
- gitpr_cli-1.1.0/tests/test_config_app.py +1647 -0
- gitpr_cli-1.1.0/tests/test_config_cli.py +116 -0
- gitpr_cli-1.1.0/tests/test_config_schema.py +459 -0
- gitpr_cli-1.1.0/tests/test_config_store.py +189 -0
- gitpr_cli-1.1.0/tests/test_config_suggest_reviewers.py +82 -0
- gitpr_cli-1.1.0/tests/test_config_validation.py +317 -0
- {gitpr_cli-0.0.38 → gitpr_cli-1.1.0}/tests/test_core.py +217 -0
- gitpr_cli-1.1.0/tests/test_diff_parser.py +204 -0
- {gitpr_cli-0.0.38 → gitpr_cli-1.1.0}/tests/test_i18n.py +20 -5
- gitpr_cli-1.1.0/tests/test_linter_presets.py +92 -0
- gitpr_cli-1.1.0/tests/test_main_suggest_reviewers.py +110 -0
- {gitpr_cli-0.0.38 → gitpr_cli-1.1.0}/tests/test_mcp_server.py +40 -0
- {gitpr_cli-0.0.38 → gitpr_cli-1.1.0}/tests/test_pr_publish_app.py +255 -0
- {gitpr_cli-0.0.38 → gitpr_cli-1.1.0}/tests/test_pr_publish_linter_modal.py +11 -2
- gitpr_cli-1.1.0/tests/test_release_cli.py +155 -0
- gitpr_cli-1.1.0/tests/test_release_engine.py +536 -0
- gitpr_cli-1.1.0/tests/test_reviewer_suggestion.py +234 -0
- gitpr_cli-1.1.0/tests/test_skill_command.py +162 -0
- gitpr_cli-1.1.0/tests/test_skill_context.py +101 -0
- {gitpr_cli-0.0.38 → gitpr_cli-1.1.0}/tests/test_smart_excludes.py +37 -0
- gitpr_cli-1.1.0/tests/test_suggest_reviewers.py +358 -0
- {gitpr_cli-0.0.38 → gitpr_cli-1.1.0}/tests/test_thinking_words.py +31 -0
- gitpr_cli-1.1.0/tests/test_updater.py +231 -0
- gitpr_cli-1.1.0/tests/test_usage_log.py +254 -0
- gitpr_cli-1.1.0/tests/test_version_bump.py +121 -0
- gitpr_cli-0.0.38/src/config.py +0 -438
- gitpr_cli-0.0.38/src/github_api.py +0 -162
- gitpr_cli-0.0.38/src/tui_issue.py +0 -148
- gitpr_cli-0.0.38/src/ui/issue_app.py +0 -159
- gitpr_cli-0.0.38/src/updater.py +0 -200
- gitpr_cli-0.0.38/tests/test_github_api.py +0 -384
- gitpr_cli-0.0.38/tests/test_skill_command.py +0 -58
- {gitpr_cli-0.0.38 → gitpr_cli-1.1.0}/LICENSE +0 -0
- {gitpr_cli-0.0.38 → gitpr_cli-1.1.0}/gitpr_cli.egg-info/dependency_links.txt +0 -0
- {gitpr_cli-0.0.38 → gitpr_cli-1.1.0}/gitpr_cli.egg-info/entry_points.txt +0 -0
- {gitpr_cli-0.0.38 → gitpr_cli-1.1.0}/gitpr_cli.egg-info/requires.txt +0 -0
- {gitpr_cli-0.0.38 → gitpr_cli-1.1.0}/gitpr_cli.egg-info/top_level.txt +0 -0
- {gitpr_cli-0.0.38 → gitpr_cli-1.1.0}/pyproject.toml +0 -0
- {gitpr_cli-0.0.38 → gitpr_cli-1.1.0}/setup.cfg +0 -0
- {gitpr_cli-0.0.38 → gitpr_cli-1.1.0}/src/__init__.py +0 -0
- {gitpr_cli-0.0.38 → gitpr_cli-1.1.0}/src/ai_providers.py +0 -0
- {gitpr_cli-0.0.38 → gitpr_cli-1.1.0}/src/cache.py +0 -0
- {gitpr_cli-0.0.38 → gitpr_cli-1.1.0}/src/chat_memory.py +0 -0
- {gitpr_cli-0.0.38 → gitpr_cli-1.1.0}/src/issue_engine.py +0 -0
- {gitpr_cli-0.0.38 → gitpr_cli-1.1.0}/src/linter_engine.py +0 -0
- {gitpr_cli-0.0.38 → gitpr_cli-1.1.0}/src/metrics.py +0 -0
- {gitpr_cli-0.0.38 → gitpr_cli-1.1.0}/src/net.py +0 -0
- {gitpr_cli-0.0.38 → gitpr_cli-1.1.0}/src/security.py +0 -0
- {gitpr_cli-0.0.38 → gitpr_cli-1.1.0}/src/ui/__init__.py +0 -0
- {gitpr_cli-0.0.38 → gitpr_cli-1.1.0}/src/ui/linter_app.py +0 -0
- {gitpr_cli-0.0.38 → gitpr_cli-1.1.0}/src/ui/metrics_app.py +0 -0
- {gitpr_cli-0.0.38 → gitpr_cli-1.1.0}/src/ui/pr_publish_help.py +0 -0
- {gitpr_cli-0.0.38 → gitpr_cli-1.1.0}/tests/test_blame_metrics.py +0 -0
- {gitpr_cli-0.0.38 → gitpr_cli-1.1.0}/tests/test_chat_backend.py +0 -0
- {gitpr_cli-0.0.38 → gitpr_cli-1.1.0}/tests/test_external_linters.py +0 -0
- {gitpr_cli-0.0.38 → gitpr_cli-1.1.0}/tests/test_install_wizard.py +0 -0
- {gitpr_cli-0.0.38 → gitpr_cli-1.1.0}/tests/test_issue_engine.py +0 -0
- {gitpr_cli-0.0.38 → gitpr_cli-1.1.0}/tests/test_linter_metrics.py +0 -0
- {gitpr_cli-0.0.38 → gitpr_cli-1.1.0}/tests/test_mcp_prompts.py +0 -0
- {gitpr_cli-0.0.38 → gitpr_cli-1.1.0}/tests/test_mcp_server_e2e.py +0 -0
- {gitpr_cli-0.0.38 → gitpr_cli-1.1.0}/tests/test_metrics.py +0 -0
- {gitpr_cli-0.0.38 → gitpr_cli-1.1.0}/tests/test_net_timeouts.py +0 -0
- {gitpr_cli-0.0.38 → gitpr_cli-1.1.0}/tests/test_plugins.py +0 -0
- {gitpr_cli-0.0.38 → gitpr_cli-1.1.0}/tests/test_pre_save.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: gitpr-cli
|
|
3
|
-
Version:
|
|
3
|
+
Version: 1.1.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
|
|
@@ -26,7 +26,7 @@ Dynamic: license-file
|
|
|
26
26
|
|
|
27
27
|
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
28
|
|
|
29
|
-
🌐 **Website:** [gitpr.natanfiuza.dev.br](https://gitpr.natanfiuza.dev.br/) · 📂 **Repository:** [github.com/
|
|
29
|
+
🌐 **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)
|
|
30
30
|
|
|
31
31
|
----
|
|
32
32
|
|
|
@@ -66,27 +66,6 @@ This project was developed in Python and uses the following main libraries:
|
|
|
66
66
|
* [**Requests**](https://pypi.org/project/requests/): Elegant and robust library for HTTP requests, used to communicate with the GitHub REST API.
|
|
67
67
|
* [**MCP**](https://pypi.org/project/mcp/): Official Python SDK for the Model Context Protocol, enabling GitPR to integrate directly with AI-powered editors and IDEs.
|
|
68
68
|
|
|
69
|
-
----
|
|
70
|
-
|
|
71
|
-
## 📦 How to Compile the Executable Locally
|
|
72
|
-
|
|
73
|
-
If you want to generate your own binary from the source code, we use **PyInstaller**. Make sure you are in the project root directory with the virtual environment configured.
|
|
74
|
-
|
|
75
|
-
1. Install development dependencies (if you haven't already):
|
|
76
|
-
```bash
|
|
77
|
-
pipenv install --dev
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
2. Run the build command pointing to our entry point (`run.py`):
|
|
81
|
-
```bash
|
|
82
|
-
pipenv run pyinstaller --noconfirm --onefile --icon=icon.ico --name gitpr run.py
|
|
83
|
-
```
|
|
84
|
-
> **Technical note:** The `--onefile` flag ensures all Python, libraries, and dependencies are compressed into a single binary, while `--paths src` helps the compiler find our `core.py` and `config.py` files. 🛠️
|
|
85
|
-
|
|
86
|
-
After running this command, PyInstaller will create some folders (`build` and `dist`).
|
|
87
|
-
Your final ready-to-use file will be inside the **`dist/`** folder named `gitpr` (or `gitpr.exe` on Windows).
|
|
88
|
-
|
|
89
|
-
|
|
90
69
|
----
|
|
91
70
|
|
|
92
71
|
## 🧪 Running Tests
|
|
@@ -107,11 +86,13 @@ Pytest will automatically detect files inside the `tests/` folder and display a
|
|
|
107
86
|
----
|
|
108
87
|
## **⚙️ Installation and Configuration**
|
|
109
88
|
|
|
110
|
-
### **
|
|
89
|
+
### **Installing from PyPI (Recommended)**
|
|
111
90
|
|
|
112
|
-
1.
|
|
113
|
-
|
|
114
|
-
|
|
91
|
+
1. Install the package with pip:
|
|
92
|
+
```bash
|
|
93
|
+
pip install gitpr-cli
|
|
94
|
+
```
|
|
95
|
+
2. On the first run, the wizard will guide you:
|
|
115
96
|
```bash
|
|
116
97
|
$ gitpr
|
|
117
98
|
```
|
|
@@ -126,11 +107,13 @@ Pytest will automatically detect files inside the `tests/` folder and display a
|
|
|
126
107
|
```
|
|
127
108
|
*Note: Your configuration will be securely saved in the `~/.gitpr/.env` file.*
|
|
128
109
|
|
|
110
|
+
*Note (updates): GitPR is distributed exclusively through PyPI. On every run it checks whether a newer version has been published, and when one exists it **blocks the execution** and asks you to run `pip install --upgrade gitpr-cli`. See [auto-update.md](docs/auto-update.md).*
|
|
111
|
+
|
|
129
112
|
> **🔒 Security Note:** GitPR CLI uses symmetric encryption (Fernet). Your API key is stored as a hash in the `.env` file, and the master key for decryption is automatically generated in `~/.gitpr/secret.key`. **Never share your secret.key file.**
|
|
130
113
|
|
|
131
114
|
### From Source Code
|
|
132
115
|
|
|
133
|
-
1. Clone the repository: `git clone https://github.com/
|
|
116
|
+
1. Clone the repository: `git clone https://github.com/gitpr-cli/gitpr.git.git`
|
|
134
117
|
|
|
135
118
|
2. Enter the folder: `cd gitpr`
|
|
136
119
|
|
|
@@ -162,11 +145,11 @@ You can pass the following *flags* for specific actions:
|
|
|
162
145
|
* `--lang <code>`: Forces the interface language for this execution (e.g.: `en_us`, `pt_br`). Overrides `GITPR_LANG` in `.env` without persisting the change.
|
|
163
146
|
* `-ch` or `--chat`: Opens the **Interactive Pair Programming Chat** — a TUI terminal where the AI sees your current diff and maintains a contextual conversation. Features memory per branch, slash commands (`/explain`, `/tests`, `/optimize`, `/clear`), auto-patching (F5), diff refresh (F2), and session export (F6).
|
|
164
147
|
* `-l` or `--linter`: Runs **only the local static linter** (no AI calls). Ideal for use in CI/CD pipelines to block non-compliant code.
|
|
165
|
-
* `--status`: Lists uncommitted file changes categorized as **new**, **modified**, and **deleted** — fast, no AI, no network. 📖 [Full docs](https://github.com/
|
|
166
|
-
* `--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/
|
|
167
|
-
* `--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/
|
|
148
|
+
* `--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
|
+
* `--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)
|
|
150
|
+
* `--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)
|
|
168
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 12 annotated tools, 15 resources, and 7 pre-built prompts directly inside your IDE. Also available as the standalone `gitpr-mcp` command.
|
|
169
|
-
* `--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/
|
|
152
|
+
* `--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)
|
|
170
153
|
* `--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.
|
|
171
154
|
* `-ih` or `--installhooks`: Automatically installs **local Git Hooks** (`pre-commit` and `prepare-commit-msg`) in your repository.
|
|
172
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`) at the project root.
|
|
@@ -174,9 +157,9 @@ You can pass the following *flags* for specific actions:
|
|
|
174
157
|
* **New Code Issue (`gitpr -is`):** Reads the current `git diff`. **Why use:** Ideal for quickly documenting the task you just finished programming, before committing.
|
|
175
158
|
* **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.
|
|
176
159
|
* **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.
|
|
177
|
-
* **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 via REST API. Before generation, it checks for unstaged files 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/
|
|
160
|
+
* **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 via REST API. Before generation, it checks for unstaged files 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)
|
|
178
161
|
* `-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.
|
|
179
|
-
* `-u` or `--update`: Checks
|
|
162
|
+
* `-u` or `--update`: Checks the latest version of GitPR on PyPI and shows how to update it (Auto-Updater).
|
|
180
163
|
|
|
181
164
|
> **⚙️ Technical Note (--hook):** GitPR has a hidden flag `--hook <file>` that is triggered exclusively by the Git Hooks system in the background. It allows the AI to inject the suggested message directly into Git's temporary file, without cluttering your terminal.
|
|
182
165
|
>
|
|
@@ -186,7 +169,7 @@ You can pass the following *flags* for specific actions:
|
|
|
186
169
|
|
|
187
170
|
When your diff is too large for a single AI call (over ~90k estimated tokens), GitPR automatically splits it into batches by file, asks the AI for a technical summary of each part (Map), and unifies everything into the final commit message, review, or PR description (Reduce). No flags needed — it activates on demand and shows the progress in the console.
|
|
188
171
|
|
|
189
|
-
📚 Full documentation: [docs/map-reduce-diff.md](https://github.com/
|
|
172
|
+
📚 Full documentation: [docs/map-reduce-diff.md](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/map-reduce-diff.md)
|
|
190
173
|
|
|
191
174
|
## 🛡️ Local Linter (Static Analysis)
|
|
192
175
|
|
|
@@ -233,7 +216,7 @@ Co-Authored-By: Gitpr-cli <gitpr@natanfiuza.dev.br>
|
|
|
233
216
|
|
|
234
217
|
The trailer is appended programmatically (never by the AI) in all flows: console suggestion (`gitpr -c`), the `prepare-commit-msg` hook, auto-commit (`--no-edit`), the PR publication TUI, and the MCP `generate_commit_message` tool. It is idempotent — never duplicated when the message already contains it — and is hidden from the TUI edit screen, injected only when the commit is executed.
|
|
235
218
|
|
|
236
|
-
📖 **Full documentation:** [docs/commit-message-ia.md](https://github.com/
|
|
219
|
+
📖 **Full documentation:** [docs/commit-message-ia.md](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/commit-message-ia.md)
|
|
237
220
|
|
|
238
221
|
## 🧠 Multi-Model Architecture (AI-Agnostic)
|
|
239
222
|
|
|
@@ -268,15 +251,15 @@ GitPR automatically detects your system language and displays messages in your n
|
|
|
268
251
|
|
|
269
252
|
To force a specific language, set `GITPR_LANG=pt_br` or `GITPR_LANG=en` in `~/.gitpr/.env`.
|
|
270
253
|
|
|
271
|
-
> 📖 **Full developer guide:** [docs/i18n_explanation.md](https://github.com/
|
|
254
|
+
> 📖 **Full developer guide:** [docs/i18n_explanation.md](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/i18n_explanation.md) — architecture, usage patterns, circular import precautions, and how to add new languages.
|
|
272
255
|
|
|
273
256
|
## 🔄 Hook Scripts Versioning & Auto-Sync
|
|
274
257
|
|
|
275
258
|
GitPR includes an automatic versioning system for Git hook scripts (`pre-commit`, `prepare-commit-msg`, `pre-push`, `post-checkout`, `post-merge`). Every time you run `gitpr`, the system silently checks whether your installed hooks match the latest version and automatically updates them if needed — all while respecting your language preference.
|
|
276
259
|
|
|
277
260
|
**How it works:**
|
|
278
|
-
1. Reads `SCRIPTS_VERSION` and `
|
|
279
|
-
2. Compares with the latest version (`__scripts_version__`) shipped with your GitPR release
|
|
261
|
+
1. Reads `SCRIPTS_VERSION` and `SCRIPTS_INSTALLED_LANG` from `~/.gitpr/.env`
|
|
262
|
+
2. Compares with the latest version (`__scripts_version__`) shipped with your GitPR release, and with the language you asked for (`SCRIPTS_LANG`, empty = follow the interface language)
|
|
280
263
|
3. If versions or language differ → automatically downloads and updates hooks
|
|
281
264
|
4. If everything matches → skips entirely (single `.env` read, zero network I/O)
|
|
282
265
|
|
|
@@ -326,7 +309,7 @@ gitpr-mcp --install auto # Auto-detect and install for all found
|
|
|
326
309
|
The installer creates the config directory if needed, merges with any existing
|
|
327
310
|
config (never overwrites other servers), and is safe to run multiple times.
|
|
328
311
|
|
|
329
|
-
> Manual setup is also supported — see [docs/mcp-integration.md](https://github.com/
|
|
312
|
+
> Manual setup is also supported — see [docs/mcp-integration.md](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/mcp-integration.md)
|
|
330
313
|
> for the JSON config format for each editor.
|
|
331
314
|
|
|
332
315
|
Once configured, use natural language in your editor's AI chat:
|
|
@@ -370,17 +353,17 @@ gitpr-mcp --tool analyze_blame --tool-args '{"file_path":"src/main.py","start_li
|
|
|
370
353
|
|
|
371
354
|
This is useful for scripting, CI/CD pipelines, and one-off queries where you don't need a persistent MCP server. JSON output goes to stdout; all diagnostic messages go to stderr — safe for piping.
|
|
372
355
|
|
|
373
|
-
📖 **Full documentation:** [docs/mcp-integration.md](https://github.com/
|
|
356
|
+
📖 **Full documentation:** [docs/mcp-integration.md](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/mcp-integration.md) — available in 5 languages (EN, PT-BR, PT-PT, ES, FR).
|
|
374
357
|
|
|
375
|
-
> 💬 **MCP Prompts** — GitPR also exposes 7 pre-defined message templates (prompts) for common flows like "Review PR", "Generate Commit Message", and "Create Issue from Diff". See the [MCP Prompts guide](https://github.com/
|
|
358
|
+
> 💬 **MCP Prompts** — GitPR also exposes 7 pre-defined message templates (prompts) for common flows like "Review PR", "Generate Commit Message", and "Create Issue from Diff". See the [MCP Prompts guide](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/mcp-prompts.md) for the full list.
|
|
376
359
|
|
|
377
360
|
## 🎯 Smart Excludes (Token Optimization)
|
|
378
361
|
|
|
379
362
|
GitPR automatically removes non-code files from your `git diff` before sending them to the AI — reducing token consumption and API costs with **zero configuration** required.
|
|
380
363
|
|
|
381
364
|
**Two layers of exclusions:**
|
|
382
|
-
- **Lockfiles & generated files:** `package-lock.json`, `*.min.js`, `*.map`, `*.pyc`, `*.svg`, and 30+ more patterns defined in [`gitpr.smart-excludes.json`](https://github.com/
|
|
383
|
-
- **Documentation prose:** `*.md`, `*.txt`, `*.rst`, `*.adoc`, `*.tex`, and 20+ more extensions defined in [`gitpr.docs-smart-excludes.json`](https://github.com/
|
|
365
|
+
- **Lockfiles & generated files:** `package-lock.json`, `*.min.js`, `*.map`, `*.pyc`, `*.svg`, and 30+ more patterns defined in [`gitpr.smart-excludes.json`](https://github.com/gitpr-cli/gitpr.git/blob/main/templates/gitpr.smart-excludes.json)
|
|
366
|
+
- **Documentation prose:** `*.md`, `*.txt`, `*.rst`, `*.adoc`, `*.tex`, and 20+ more extensions defined in [`gitpr.docs-smart-excludes.json`](https://github.com/gitpr-cli/gitpr.git/blob/main/templates/gitpr.docs-smart-excludes.json)
|
|
384
367
|
|
|
385
368
|
**Documentation tracking:** Even though documentation content is excluded from the diff, GitPR still tells the AI _which_ documentation files changed by injecting their paths as metadata into the system instructions. The AI has full context about doc updates without consuming tokens on their prose.
|
|
386
369
|
|
|
@@ -406,7 +389,7 @@ GitPR automatically removes non-code files from your `git diff` before sending t
|
|
|
406
389
|
|
|
407
390
|
Add framework-specific build artifacts, generated folders, or any pattern that only applies to this project. The file is safe to commit — your team gets the same exclusions.
|
|
408
391
|
|
|
409
|
-
> 📖 **Full documentation:** [docs/smart-excludes.md](https://github.com/
|
|
392
|
+
> 📖 **Full documentation:** [docs/smart-excludes.md](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/smart-excludes.md) — available in 5 languages (EN, PT-BR, PT-PT, FR, ES).
|
|
410
393
|
|
|
411
394
|
## 📁 Output Directory Structure
|
|
412
395
|
|
|
@@ -434,37 +417,38 @@ If you want to implement GitPR as an automated quality barrier in your team, che
|
|
|
434
417
|
|
|
435
418
|
### Chat & Interactive Features
|
|
436
419
|
|
|
437
|
-
* [**🧠 Interactive Chat (Pair Programming)**](https://github.com/
|
|
420
|
+
* [**🧠 Interactive Chat (Pair Programming)**](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/understanding_chat_functionality.md) — How to use the AI chat with memory, slash commands, auto-patch, and session export.
|
|
438
421
|
|
|
439
422
|
### DevOps & CI/CD
|
|
440
423
|
|
|
441
|
-
* [**Local Git Hooks (Shift-Left)**](https://github.com/
|
|
442
|
-
* [**Hook Scripts Versioning & Auto-Sync**](https://github.com/
|
|
443
|
-
* [**Customizable Static Linter**](https://github.com/
|
|
444
|
-
* [**CI/CD Integration (GitHub Actions)**](https://github.com/
|
|
424
|
+
* [**Local Git Hooks (Shift-Left)**](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/git-hooks-locais.md) — How to use `gitpr --installhooks` to create guardrails on the developer's machine and use AI to automatically write commit messages.
|
|
425
|
+
* [**Hook Scripts Versioning & Auto-Sync**](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/hooks-versioning.md) — How the automatic versioning and i18n-aware synchronization system keeps your Git hooks up to date.
|
|
426
|
+
* [**Customizable Static Linter**](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/linter-regras-customizadas.md) — How to create validation rules in `.gitpr.linter.yml`, bridge external linters (ESLint, PHPCS, Stylelint), and generate Markdown reports for CI/CD and pre-commit hooks.
|
|
427
|
+
* [**CI/CD Integration (GitHub Actions)**](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/github-ci-linter.md) — How to run GitPR in the pipeline to block "Merge" of PRs with violations.
|
|
445
428
|
|
|
446
429
|
### Core Features
|
|
447
430
|
|
|
448
|
-
* [**Pull Request (Default Mode)**](https://github.com/
|
|
449
|
-
* [**Pull Request Publisher TUI**](https://github.com/
|
|
450
|
-
* [**AI Code Review**](https://github.com/
|
|
451
|
-
* [**AI Commit Messages**](https://github.com/
|
|
452
|
-
* [**Issue Generation and TUI Interface**](https://github.com/
|
|
453
|
-
* [**Code Archaeologist (Git Blame)**](https://github.com/
|
|
454
|
-
* [**Skills and Templates System**](https://github.com/
|
|
431
|
+
* [**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
|
+
* [**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`) and file auditing (`--input`).
|
|
434
|
+
* [**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
|
+
* [**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
|
+
* [**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
|
+
* [**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.
|
|
455
439
|
|
|
456
440
|
### Configuration & Infrastructure
|
|
457
441
|
|
|
458
|
-
* [**Install Wizard**](https://github.com/
|
|
459
|
-
* [**AI Providers**](https://github.com/
|
|
460
|
-
* [**Auto-Updater**](https://github.com/
|
|
461
|
-
* [**Architecture**](https://github.com/
|
|
462
|
-
* [**GitHub Token (PAT) Integration and Security**](https://github.com/
|
|
463
|
-
* [**Internationalization (i18n)**](https://github.com/
|
|
464
|
-
* [**MCP Integration**](https://github.com/
|
|
465
|
-
* [**MCP Prompts**](https://github.com/
|
|
466
|
-
* [**MCP Tool Annotations**](https://github.com/
|
|
467
|
-
* [**Metrics & Telemetry**](https://github.com/
|
|
442
|
+
* [**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
|
+
* [**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
|
+
* [**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.
|
|
445
|
+
* [**Architecture**](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/ARCHITECTURE.md) — Project architecture, design patterns, and technical stack overview.
|
|
446
|
+
* [**GitHub Token (PAT) Integration and Security**](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/github-pat-integration.md) — Understand how GitPR creates issues directly in the repository with authentication.
|
|
447
|
+
* [**Internationalization (i18n)**](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/i18n_explanation.md) — Architecture, usage patterns, and how to add new languages.
|
|
448
|
+
* [**MCP Integration**](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/mcp-integration.md) — Connect GitPR to VS Code, Cursor, and Claude Desktop via Model Context Protocol.
|
|
449
|
+
* [**MCP Prompts**](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/mcp-prompts.md) — Pre-built message templates (7 prompts, 35 language variants) for common GitPR workflows in your editor's AI chat.
|
|
450
|
+
* [**MCP Tool Annotations**](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/mcp-annotations.md) — IDE integration hints (`readOnlyHint`, `destructiveHint`) for smarter UI behavior and safer tool execution.
|
|
451
|
+
* [**Metrics & Telemetry**](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/metricas-telemetria.md) — Local offline analytics for team usage metrics, exportable CSV reports, and interactive TUI dashboard.
|
|
468
452
|
|
|
469
453
|
## ⚡ Local Cache System (Quota Savings)
|
|
470
454
|
|
|
@@ -475,9 +459,10 @@ If you run the same command again without changing the code, GitPR intercepts th
|
|
|
475
459
|
|
|
476
460
|
Never worry about manually downloading new versions again. GitPR has a Connection Guardian and a built-in updater:
|
|
477
461
|
* It checks network availability before starting so it doesn't block your offline workflow.
|
|
478
|
-
* On each execution, it
|
|
479
|
-
*
|
|
480
|
-
*
|
|
462
|
+
* On each execution, it checks PyPI for a newer published version (cached for 24 hours).
|
|
463
|
+
* When a newer version exists, it **blocks the execution** and asks you to run `pip install --upgrade gitpr-cli`.
|
|
464
|
+
* You can force the check at any time with `gitpr --update` or `gitpr -u` — it shows the upgrade command without installing anything.
|
|
465
|
+
* Scripts, Git hooks, the MCP server and the contextual help are never blocked.
|
|
481
466
|
|
|
482
467
|
## Publishing to PyPI
|
|
483
468
|
|