gitpr-cli 1.0.0__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-1.0.0 → gitpr_cli-1.1.0}/PKG-INFO +17 -33
- {gitpr_cli-1.0.0 → gitpr_cli-1.1.0}/README.md +16 -32
- {gitpr_cli-1.0.0 → gitpr_cli-1.1.0}/gitpr_cli.egg-info/PKG-INFO +17 -33
- {gitpr_cli-1.0.0 → gitpr_cli-1.1.0}/gitpr_cli.egg-info/SOURCES.txt +12 -0
- {gitpr_cli-1.0.0 → gitpr_cli-1.1.0}/src/config.py +284 -1
- gitpr_cli-1.1.0/src/config_schema.py +986 -0
- {gitpr_cli-1.0.0 → gitpr_cli-1.1.0}/src/core.py +84 -49
- gitpr_cli-1.1.0/src/doc_links.py +28 -0
- {gitpr_cli-1.0.0 → gitpr_cli-1.1.0}/src/i18n.py +18 -3
- {gitpr_cli-1.0.0 → gitpr_cli-1.1.0}/src/linter_wizard.py +6 -2
- {gitpr_cli-1.0.0 → gitpr_cli-1.1.0}/src/main.py +49 -26
- {gitpr_cli-1.0.0 → gitpr_cli-1.1.0}/src/mcp_server.py +7 -0
- {gitpr_cli-1.0.0 → gitpr_cli-1.1.0}/src/spinner.py +15 -5
- gitpr_cli-1.1.0/src/ui/config_app.py +1835 -0
- 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/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_validation.py +317 -0
- {gitpr_cli-1.0.0 → gitpr_cli-1.1.0}/tests/test_core.py +138 -0
- {gitpr_cli-1.0.0 → gitpr_cli-1.1.0}/tests/test_i18n.py +14 -3
- gitpr_cli-1.1.0/tests/test_linter_presets.py +92 -0
- {gitpr_cli-1.0.0 → gitpr_cli-1.1.0}/tests/test_mcp_server.py +17 -0
- {gitpr_cli-1.0.0 → gitpr_cli-1.1.0}/tests/test_skill_context.py +33 -0
- {gitpr_cli-1.0.0 → gitpr_cli-1.1.0}/tests/test_smart_excludes.py +37 -0
- {gitpr_cli-1.0.0 → 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.0.0/src/updater.py +0 -200
- {gitpr_cli-1.0.0 → gitpr_cli-1.1.0}/LICENSE +0 -0
- {gitpr_cli-1.0.0 → gitpr_cli-1.1.0}/gitpr_cli.egg-info/dependency_links.txt +0 -0
- {gitpr_cli-1.0.0 → gitpr_cli-1.1.0}/gitpr_cli.egg-info/entry_points.txt +0 -0
- {gitpr_cli-1.0.0 → gitpr_cli-1.1.0}/gitpr_cli.egg-info/requires.txt +0 -0
- {gitpr_cli-1.0.0 → gitpr_cli-1.1.0}/gitpr_cli.egg-info/top_level.txt +0 -0
- {gitpr_cli-1.0.0 → gitpr_cli-1.1.0}/pyproject.toml +0 -0
- {gitpr_cli-1.0.0 → gitpr_cli-1.1.0}/setup.cfg +0 -0
- {gitpr_cli-1.0.0 → gitpr_cli-1.1.0}/src/__init__.py +0 -0
- {gitpr_cli-1.0.0 → gitpr_cli-1.1.0}/src/ai_providers.py +0 -0
- {gitpr_cli-1.0.0 → gitpr_cli-1.1.0}/src/blame_engine.py +0 -0
- {gitpr_cli-1.0.0 → gitpr_cli-1.1.0}/src/cache.py +0 -0
- {gitpr_cli-1.0.0 → gitpr_cli-1.1.0}/src/changelog_builder.py +0 -0
- {gitpr_cli-1.0.0 → gitpr_cli-1.1.0}/src/chat_memory.py +0 -0
- {gitpr_cli-1.0.0 → gitpr_cli-1.1.0}/src/commit_classifier.py +0 -0
- {gitpr_cli-1.0.0 → gitpr_cli-1.1.0}/src/diff_parser.py +0 -0
- {gitpr_cli-1.0.0 → gitpr_cli-1.1.0}/src/github_api.py +0 -0
- {gitpr_cli-1.0.0 → gitpr_cli-1.1.0}/src/infrastructure/__init__.py +0 -0
- {gitpr_cli-1.0.0 → gitpr_cli-1.1.0}/src/infrastructure/scm/__init__.py +0 -0
- {gitpr_cli-1.0.0 → gitpr_cli-1.1.0}/src/infrastructure/scm/azure_devops_provider.py +0 -0
- {gitpr_cli-1.0.0 → gitpr_cli-1.1.0}/src/infrastructure/scm/base.py +0 -0
- {gitpr_cli-1.0.0 → gitpr_cli-1.1.0}/src/infrastructure/scm/bitbucket_provider.py +0 -0
- {gitpr_cli-1.0.0 → gitpr_cli-1.1.0}/src/infrastructure/scm/factory.py +0 -0
- {gitpr_cli-1.0.0 → gitpr_cli-1.1.0}/src/infrastructure/scm/github_provider.py +0 -0
- {gitpr_cli-1.0.0 → gitpr_cli-1.1.0}/src/infrastructure/scm/gitlab_provider.py +0 -0
- {gitpr_cli-1.0.0 → gitpr_cli-1.1.0}/src/issue_engine.py +0 -0
- {gitpr_cli-1.0.0 → gitpr_cli-1.1.0}/src/linter_engine.py +0 -0
- {gitpr_cli-1.0.0 → gitpr_cli-1.1.0}/src/metrics.py +0 -0
- {gitpr_cli-1.0.0 → gitpr_cli-1.1.0}/src/net.py +0 -0
- {gitpr_cli-1.0.0 → gitpr_cli-1.1.0}/src/release_engine.py +0 -0
- {gitpr_cli-1.0.0 → gitpr_cli-1.1.0}/src/reviewer_suggestion.py +0 -0
- {gitpr_cli-1.0.0 → gitpr_cli-1.1.0}/src/security.py +0 -0
- {gitpr_cli-1.0.0 → gitpr_cli-1.1.0}/src/suggest_reviewers.py +0 -0
- {gitpr_cli-1.0.0 → gitpr_cli-1.1.0}/src/tui_issue.py +0 -0
- {gitpr_cli-1.0.0 → gitpr_cli-1.1.0}/src/ui/__init__.py +0 -0
- {gitpr_cli-1.0.0 → gitpr_cli-1.1.0}/src/ui/chat_app.py +0 -0
- {gitpr_cli-1.0.0 → gitpr_cli-1.1.0}/src/ui/help_screen.py +0 -0
- {gitpr_cli-1.0.0 → gitpr_cli-1.1.0}/src/ui/issue_app.py +0 -0
- {gitpr_cli-1.0.0 → gitpr_cli-1.1.0}/src/ui/linter_app.py +0 -0
- {gitpr_cli-1.0.0 → gitpr_cli-1.1.0}/src/ui/metrics_app.py +0 -0
- {gitpr_cli-1.0.0 → gitpr_cli-1.1.0}/src/ui/pr_publish_app.py +0 -0
- {gitpr_cli-1.0.0 → gitpr_cli-1.1.0}/src/ui/pr_publish_help.py +0 -0
- {gitpr_cli-1.0.0 → gitpr_cli-1.1.0}/src/version_bump.py +0 -0
- {gitpr_cli-1.0.0 → gitpr_cli-1.1.0}/tests/test_blame_engine_ranges.py +0 -0
- {gitpr_cli-1.0.0 → gitpr_cli-1.1.0}/tests/test_blame_metrics.py +0 -0
- {gitpr_cli-1.0.0 → gitpr_cli-1.1.0}/tests/test_changelog_builder.py +0 -0
- {gitpr_cli-1.0.0 → gitpr_cli-1.1.0}/tests/test_chat_backend.py +0 -0
- {gitpr_cli-1.0.0 → gitpr_cli-1.1.0}/tests/test_commit_classifier.py +0 -0
- {gitpr_cli-1.0.0 → gitpr_cli-1.1.0}/tests/test_config_suggest_reviewers.py +0 -0
- {gitpr_cli-1.0.0 → gitpr_cli-1.1.0}/tests/test_diff_parser.py +0 -0
- {gitpr_cli-1.0.0 → gitpr_cli-1.1.0}/tests/test_external_linters.py +0 -0
- {gitpr_cli-1.0.0 → gitpr_cli-1.1.0}/tests/test_install_wizard.py +0 -0
- {gitpr_cli-1.0.0 → gitpr_cli-1.1.0}/tests/test_issue_engine.py +0 -0
- {gitpr_cli-1.0.0 → gitpr_cli-1.1.0}/tests/test_linter_metrics.py +0 -0
- {gitpr_cli-1.0.0 → gitpr_cli-1.1.0}/tests/test_main_suggest_reviewers.py +0 -0
- {gitpr_cli-1.0.0 → gitpr_cli-1.1.0}/tests/test_mcp_prompts.py +0 -0
- {gitpr_cli-1.0.0 → gitpr_cli-1.1.0}/tests/test_mcp_server_e2e.py +0 -0
- {gitpr_cli-1.0.0 → gitpr_cli-1.1.0}/tests/test_metrics.py +0 -0
- {gitpr_cli-1.0.0 → gitpr_cli-1.1.0}/tests/test_net_timeouts.py +0 -0
- {gitpr_cli-1.0.0 → gitpr_cli-1.1.0}/tests/test_plugins.py +0 -0
- {gitpr_cli-1.0.0 → gitpr_cli-1.1.0}/tests/test_pr_publish_app.py +0 -0
- {gitpr_cli-1.0.0 → gitpr_cli-1.1.0}/tests/test_pr_publish_linter_modal.py +0 -0
- {gitpr_cli-1.0.0 → gitpr_cli-1.1.0}/tests/test_pre_save.py +0 -0
- {gitpr_cli-1.0.0 → gitpr_cli-1.1.0}/tests/test_release_cli.py +0 -0
- {gitpr_cli-1.0.0 → gitpr_cli-1.1.0}/tests/test_release_engine.py +0 -0
- {gitpr_cli-1.0.0 → gitpr_cli-1.1.0}/tests/test_reviewer_suggestion.py +0 -0
- {gitpr_cli-1.0.0 → gitpr_cli-1.1.0}/tests/test_skill_command.py +0 -0
- {gitpr_cli-1.0.0 → gitpr_cli-1.1.0}/tests/test_suggest_reviewers.py +0 -0
- {gitpr_cli-1.0.0 → gitpr_cli-1.1.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.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
|
|
@@ -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,6 +107,8 @@ 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
|
|
@@ -176,7 +159,7 @@ You can pass the following *flags* for specific actions:
|
|
|
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
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
|
>
|
|
@@ -275,8 +258,8 @@ To force a specific language, set `GITPR_LANG=pt_br` or `GITPR_LANG=en` in `~/.g
|
|
|
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
|
|
|
@@ -458,7 +441,7 @@ If you want to implement GitPR as an automated quality barrier in your team, che
|
|
|
458
441
|
|
|
459
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.
|
|
460
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.
|
|
461
|
-
* [**Auto-Updater**](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/auto-update.md) — How GitPR's automatic update
|
|
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.
|
|
462
445
|
* [**Architecture**](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/ARCHITECTURE.md) — Project architecture, design patterns, and technical stack overview.
|
|
463
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.
|
|
464
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.
|
|
@@ -476,9 +459,10 @@ If you run the same command again without changing the code, GitPR intercepts th
|
|
|
476
459
|
|
|
477
460
|
Never worry about manually downloading new versions again. GitPR has a Connection Guardian and a built-in updater:
|
|
478
461
|
* It checks network availability before starting so it doesn't block your offline workflow.
|
|
479
|
-
* On each execution, it
|
|
480
|
-
*
|
|
481
|
-
*
|
|
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.
|
|
482
466
|
|
|
483
467
|
## Publishing to PyPI
|
|
484
468
|
|
|
@@ -47,27 +47,6 @@ This project was developed in Python and uses the following main libraries:
|
|
|
47
47
|
* [**Requests**](https://pypi.org/project/requests/): Elegant and robust library for HTTP requests, used to communicate with the GitHub REST API.
|
|
48
48
|
* [**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.
|
|
49
49
|
|
|
50
|
-
----
|
|
51
|
-
|
|
52
|
-
## 📦 How to Compile the Executable Locally
|
|
53
|
-
|
|
54
|
-
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.
|
|
55
|
-
|
|
56
|
-
1. Install development dependencies (if you haven't already):
|
|
57
|
-
```bash
|
|
58
|
-
pipenv install --dev
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
2. Run the build command pointing to our entry point (`run.py`):
|
|
62
|
-
```bash
|
|
63
|
-
pipenv run pyinstaller --noconfirm --onefile --icon=icon.ico --name gitpr run.py
|
|
64
|
-
```
|
|
65
|
-
> **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. 🛠️
|
|
66
|
-
|
|
67
|
-
After running this command, PyInstaller will create some folders (`build` and `dist`).
|
|
68
|
-
Your final ready-to-use file will be inside the **`dist/`** folder named `gitpr` (or `gitpr.exe` on Windows).
|
|
69
|
-
|
|
70
|
-
|
|
71
50
|
----
|
|
72
51
|
|
|
73
52
|
## 🧪 Running Tests
|
|
@@ -88,11 +67,13 @@ Pytest will automatically detect files inside the `tests/` folder and display a
|
|
|
88
67
|
----
|
|
89
68
|
## **⚙️ Installation and Configuration**
|
|
90
69
|
|
|
91
|
-
### **
|
|
70
|
+
### **Installing from PyPI (Recommended)**
|
|
92
71
|
|
|
93
|
-
1.
|
|
94
|
-
|
|
95
|
-
|
|
72
|
+
1. Install the package with pip:
|
|
73
|
+
```bash
|
|
74
|
+
pip install gitpr-cli
|
|
75
|
+
```
|
|
76
|
+
2. On the first run, the wizard will guide you:
|
|
96
77
|
```bash
|
|
97
78
|
$ gitpr
|
|
98
79
|
```
|
|
@@ -107,6 +88,8 @@ Pytest will automatically detect files inside the `tests/` folder and display a
|
|
|
107
88
|
```
|
|
108
89
|
*Note: Your configuration will be securely saved in the `~/.gitpr/.env` file.*
|
|
109
90
|
|
|
91
|
+
*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).*
|
|
92
|
+
|
|
110
93
|
> **🔒 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.**
|
|
111
94
|
|
|
112
95
|
### From Source Code
|
|
@@ -157,7 +140,7 @@ You can pass the following *flags* for specific actions:
|
|
|
157
140
|
* **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.
|
|
158
141
|
* **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)
|
|
159
142
|
* `-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.
|
|
160
|
-
* `-u` or `--update`: Checks
|
|
143
|
+
* `-u` or `--update`: Checks the latest version of GitPR on PyPI and shows how to update it (Auto-Updater).
|
|
161
144
|
|
|
162
145
|
> **⚙️ 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.
|
|
163
146
|
>
|
|
@@ -256,8 +239,8 @@ To force a specific language, set `GITPR_LANG=pt_br` or `GITPR_LANG=en` in `~/.g
|
|
|
256
239
|
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.
|
|
257
240
|
|
|
258
241
|
**How it works:**
|
|
259
|
-
1. Reads `SCRIPTS_VERSION` and `
|
|
260
|
-
2. Compares with the latest version (`__scripts_version__`) shipped with your GitPR release
|
|
242
|
+
1. Reads `SCRIPTS_VERSION` and `SCRIPTS_INSTALLED_LANG` from `~/.gitpr/.env`
|
|
243
|
+
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)
|
|
261
244
|
3. If versions or language differ → automatically downloads and updates hooks
|
|
262
245
|
4. If everything matches → skips entirely (single `.env` read, zero network I/O)
|
|
263
246
|
|
|
@@ -439,7 +422,7 @@ If you want to implement GitPR as an automated quality barrier in your team, che
|
|
|
439
422
|
|
|
440
423
|
* [**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.
|
|
441
424
|
* [**AI Providers**](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/providers-ia.md) — Configuration and selection between Google Gemini, DeepSeek, and Ollama.
|
|
442
|
-
* [**Auto-Updater**](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/auto-update.md) — How GitPR's automatic update
|
|
425
|
+
* [**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.
|
|
443
426
|
* [**Architecture**](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/ARCHITECTURE.md) — Project architecture, design patterns, and technical stack overview.
|
|
444
427
|
* [**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.
|
|
445
428
|
* [**Internationalization (i18n)**](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/i18n_explanation.md) — Architecture, usage patterns, and how to add new languages.
|
|
@@ -457,9 +440,10 @@ If you run the same command again without changing the code, GitPR intercepts th
|
|
|
457
440
|
|
|
458
441
|
Never worry about manually downloading new versions again. GitPR has a Connection Guardian and a built-in updater:
|
|
459
442
|
* It checks network availability before starting so it doesn't block your offline workflow.
|
|
460
|
-
* On each execution, it
|
|
461
|
-
*
|
|
462
|
-
*
|
|
443
|
+
* On each execution, it checks PyPI for a newer published version (cached for 24 hours).
|
|
444
|
+
* When a newer version exists, it **blocks the execution** and asks you to run `pip install --upgrade gitpr-cli`.
|
|
445
|
+
* You can force the check at any time with `gitpr --update` or `gitpr -u` — it shows the upgrade command without installing anything.
|
|
446
|
+
* Scripts, Git hooks, the MCP server and the contextual help are never blocked.
|
|
463
447
|
|
|
464
448
|
## Publishing to PyPI
|
|
465
449
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: gitpr-cli
|
|
3
|
-
Version: 1.
|
|
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
|
|
@@ -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,6 +107,8 @@ 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
|
|
@@ -176,7 +159,7 @@ You can pass the following *flags* for specific actions:
|
|
|
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
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
|
>
|
|
@@ -275,8 +258,8 @@ To force a specific language, set `GITPR_LANG=pt_br` or `GITPR_LANG=en` in `~/.g
|
|
|
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
|
|
|
@@ -458,7 +441,7 @@ If you want to implement GitPR as an automated quality barrier in your team, che
|
|
|
458
441
|
|
|
459
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.
|
|
460
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.
|
|
461
|
-
* [**Auto-Updater**](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/auto-update.md) — How GitPR's automatic update
|
|
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.
|
|
462
445
|
* [**Architecture**](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/ARCHITECTURE.md) — Project architecture, design patterns, and technical stack overview.
|
|
463
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.
|
|
464
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.
|
|
@@ -476,9 +459,10 @@ If you run the same command again without changing the code, GitPR intercepts th
|
|
|
476
459
|
|
|
477
460
|
Never worry about manually downloading new versions again. GitPR has a Connection Guardian and a built-in updater:
|
|
478
461
|
* It checks network availability before starting so it doesn't block your offline workflow.
|
|
479
|
-
* On each execution, it
|
|
480
|
-
*
|
|
481
|
-
*
|
|
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.
|
|
482
466
|
|
|
483
467
|
## Publishing to PyPI
|
|
484
468
|
|
|
@@ -15,8 +15,10 @@ src/changelog_builder.py
|
|
|
15
15
|
src/chat_memory.py
|
|
16
16
|
src/commit_classifier.py
|
|
17
17
|
src/config.py
|
|
18
|
+
src/config_schema.py
|
|
18
19
|
src/core.py
|
|
19
20
|
src/diff_parser.py
|
|
21
|
+
src/doc_links.py
|
|
20
22
|
src/github_api.py
|
|
21
23
|
src/i18n.py
|
|
22
24
|
src/issue_engine.py
|
|
@@ -33,6 +35,7 @@ src/spinner.py
|
|
|
33
35
|
src/suggest_reviewers.py
|
|
34
36
|
src/tui_issue.py
|
|
35
37
|
src/updater.py
|
|
38
|
+
src/usage_log.py
|
|
36
39
|
src/version_bump.py
|
|
37
40
|
src/infrastructure/__init__.py
|
|
38
41
|
src/infrastructure/scm/__init__.py
|
|
@@ -44,6 +47,7 @@ src/infrastructure/scm/github_provider.py
|
|
|
44
47
|
src/infrastructure/scm/gitlab_provider.py
|
|
45
48
|
src/ui/__init__.py
|
|
46
49
|
src/ui/chat_app.py
|
|
50
|
+
src/ui/config_app.py
|
|
47
51
|
src/ui/help_screen.py
|
|
48
52
|
src/ui/issue_app.py
|
|
49
53
|
src/ui/linter_app.py
|
|
@@ -55,7 +59,12 @@ tests/test_blame_metrics.py
|
|
|
55
59
|
tests/test_changelog_builder.py
|
|
56
60
|
tests/test_chat_backend.py
|
|
57
61
|
tests/test_commit_classifier.py
|
|
62
|
+
tests/test_config_app.py
|
|
63
|
+
tests/test_config_cli.py
|
|
64
|
+
tests/test_config_schema.py
|
|
65
|
+
tests/test_config_store.py
|
|
58
66
|
tests/test_config_suggest_reviewers.py
|
|
67
|
+
tests/test_config_validation.py
|
|
59
68
|
tests/test_core.py
|
|
60
69
|
tests/test_diff_parser.py
|
|
61
70
|
tests/test_external_linters.py
|
|
@@ -63,6 +72,7 @@ tests/test_i18n.py
|
|
|
63
72
|
tests/test_install_wizard.py
|
|
64
73
|
tests/test_issue_engine.py
|
|
65
74
|
tests/test_linter_metrics.py
|
|
75
|
+
tests/test_linter_presets.py
|
|
66
76
|
tests/test_main_suggest_reviewers.py
|
|
67
77
|
tests/test_mcp_prompts.py
|
|
68
78
|
tests/test_mcp_server.py
|
|
@@ -81,4 +91,6 @@ tests/test_skill_context.py
|
|
|
81
91
|
tests/test_smart_excludes.py
|
|
82
92
|
tests/test_suggest_reviewers.py
|
|
83
93
|
tests/test_thinking_words.py
|
|
94
|
+
tests/test_updater.py
|
|
95
|
+
tests/test_usage_log.py
|
|
84
96
|
tests/test_version_bump.py
|