gitpr-cli 0.0.26__tar.gz → 0.0.28__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.26/gitpr_cli.egg-info → gitpr_cli-0.0.28}/PKG-INFO +80 -2
- gitpr_cli-0.0.26/PKG-INFO → gitpr_cli-0.0.28/README.md +329 -270
- gitpr_cli-0.0.26/README.md → gitpr_cli-0.0.28/gitpr_cli.egg-info/PKG-INFO +348 -252
- {gitpr_cli-0.0.26 → gitpr_cli-0.0.28}/gitpr_cli.egg-info/SOURCES.txt +7 -1
- {gitpr_cli-0.0.26 → gitpr_cli-0.0.28}/gitpr_cli.egg-info/entry_points.txt +1 -0
- {gitpr_cli-0.0.26 → gitpr_cli-0.0.28}/gitpr_cli.egg-info/requires.txt +1 -0
- {gitpr_cli-0.0.26 → gitpr_cli-0.0.28}/pyproject.toml +4 -2
- {gitpr_cli-0.0.26 → gitpr_cli-0.0.28}/src/ai_providers.py +59 -1
- {gitpr_cli-0.0.26 → gitpr_cli-0.0.28}/src/blame_engine.py +2 -2
- {gitpr_cli-0.0.26 → gitpr_cli-0.0.28}/src/core.py +239 -26
- {gitpr_cli-0.0.26 → gitpr_cli-0.0.28}/src/issue_engine.py +1 -1
- {gitpr_cli-0.0.26 → gitpr_cli-0.0.28}/src/main.py +29 -3
- gitpr_cli-0.0.28/src/mcp_server.py +969 -0
- {gitpr_cli-0.0.26 → gitpr_cli-0.0.28}/src/spinner.py +22 -6
- {gitpr_cli-0.0.26 → gitpr_cli-0.0.28}/src/updater.py +2 -2
- gitpr_cli-0.0.28/tests/test_install_wizard.py +98 -0
- gitpr_cli-0.0.28/tests/test_mcp_server.py +403 -0
- gitpr_cli-0.0.28/tests/test_pre_save.py +66 -0
- gitpr_cli-0.0.28/tests/test_smart_excludes.py +71 -0
- gitpr_cli-0.0.28/tests/test_thinking_words.py +52 -0
- {gitpr_cli-0.0.26 → gitpr_cli-0.0.28}/LICENSE +0 -0
- {gitpr_cli-0.0.26 → gitpr_cli-0.0.28}/gitpr_cli.egg-info/dependency_links.txt +0 -0
- {gitpr_cli-0.0.26 → gitpr_cli-0.0.28}/gitpr_cli.egg-info/top_level.txt +0 -0
- {gitpr_cli-0.0.26 → gitpr_cli-0.0.28}/setup.cfg +0 -0
- {gitpr_cli-0.0.26 → gitpr_cli-0.0.28}/src/__init__.py +0 -0
- {gitpr_cli-0.0.26 → gitpr_cli-0.0.28}/src/cache.py +0 -0
- {gitpr_cli-0.0.26 → gitpr_cli-0.0.28}/src/chat_memory.py +0 -0
- {gitpr_cli-0.0.26 → gitpr_cli-0.0.28}/src/config.py +0 -0
- {gitpr_cli-0.0.26 → gitpr_cli-0.0.28}/src/i18n.py +0 -0
- {gitpr_cli-0.0.26 → gitpr_cli-0.0.28}/src/linter_engine.py +0 -0
- {gitpr_cli-0.0.26 → gitpr_cli-0.0.28}/src/security.py +0 -0
- {gitpr_cli-0.0.26 → gitpr_cli-0.0.28}/src/tui_issue.py +0 -0
- {gitpr_cli-0.0.26 → gitpr_cli-0.0.28}/src/ui/__init__.py +0 -0
- {gitpr_cli-0.0.26 → gitpr_cli-0.0.28}/src/ui/chat_app.py +0 -0
- {gitpr_cli-0.0.26 → gitpr_cli-0.0.28}/src/ui/help_screen.py +0 -0
- {gitpr_cli-0.0.26 → gitpr_cli-0.0.28}/src/ui/issue_app.py +0 -0
- {gitpr_cli-0.0.26 → gitpr_cli-0.0.28}/tests/test_chat_backend.py +0 -0
- {gitpr_cli-0.0.26 → gitpr_cli-0.0.28}/tests/test_core.py +0 -0
- {gitpr_cli-0.0.26 → gitpr_cli-0.0.28}/tests/test_skill_command.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: gitpr-cli
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.28
|
|
4
4
|
Summary: Automação de PRs, Commits e Code Review com IA (Gemini e DeepSeek)
|
|
5
5
|
Author-email: Natan Fiuza <contato@natanfiuza.dev.br>
|
|
6
6
|
Requires-Python: >=3.10
|
|
@@ -14,12 +14,20 @@ Requires-Dist: cryptography
|
|
|
14
14
|
Requires-Dist: pyyaml
|
|
15
15
|
Requires-Dist: textual
|
|
16
16
|
Requires-Dist: requests
|
|
17
|
+
Requires-Dist: mcp>=1.0.0
|
|
17
18
|
Dynamic: license-file
|
|
18
19
|
|
|
20
|
+
|
|
19
21
|
# **GitPR CLI 🚀**
|
|
20
22
|
|
|
23
|
+
<p align="center">
|
|
24
|
+
<img src="https://raw.githubusercontent.com/natanfiuza/gitpr/main/docs/logo.png" alt="GitPR Logo" width="150">
|
|
25
|
+
</p>
|
|
26
|
+
|
|
21
27
|
GitPR CLI is a command-line automation tool that uses **Google Gemini** and **DeepSeek** 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.
|
|
22
28
|
|
|
29
|
+
🌐 **Website:** [gitpr.natanfiuza.dev.br](https://gitpr.natanfiuza.dev.br/) · 📂 **Repository:** [github.com/natanfiuza/gitpr](https://github.com/natanfiuza/gitpr)
|
|
30
|
+
|
|
23
31
|
## **🛠️ Technologies and Libraries Used**
|
|
24
32
|
|
|
25
33
|
This project was developed in Python and uses the following main libraries:
|
|
@@ -33,6 +41,7 @@ This project was developed in Python and uses the following main libraries:
|
|
|
33
41
|
* [**PyYAML**](https://pyyaml.org/): Used to read and process the custom static analysis rules from the `.gitpr.linter.yml` file.
|
|
34
42
|
* [**Textual**](https://textual.textualize.io/): Powerful library for creating Terminal Graphical Interfaces (TUI), used in the interactive issue generation and editing panel.
|
|
35
43
|
* [**Requests**](https://pypi.org/project/requests/): Elegant and robust library for HTTP requests, used to communicate with the GitHub REST API.
|
|
44
|
+
* [**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.
|
|
36
45
|
|
|
37
46
|
----
|
|
38
47
|
|
|
@@ -130,6 +139,8 @@ You can pass the following *flags* for specific actions:
|
|
|
130
139
|
* `--lang <code>`: Forces the interface language for this execution (e.g.: `en_us`, `pt_br`). Overrides `GITPR_LANG` in `.env` without persisting the change.
|
|
131
140
|
* `-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).
|
|
132
141
|
* `-l` or `--linter`: Runs **only the local static linter** (no AI calls). Ideal for use in CI/CD pipelines to block non-compliant code.
|
|
142
|
+
* `--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 tools directly inside your IDE. Also available as the standalone `gitpr-mcp` command.
|
|
143
|
+
* `--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.
|
|
133
144
|
* `-ih` or `--installhooks`: Automatically installs **local Git Hooks** (`pre-commit` and `prepare-commit-msg`) in your repository.
|
|
134
145
|
* `-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.
|
|
135
146
|
* `-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:
|
|
@@ -140,6 +151,14 @@ You can pass the following *flags* for specific actions:
|
|
|
140
151
|
* `-u` or `--update`: Checks and installs the latest version of GitPR (Auto-Updater).
|
|
141
152
|
|
|
142
153
|
> **⚙️ 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.
|
|
154
|
+
>
|
|
155
|
+
> **⚙️ Technical Note (--pre-save):** GitPR has a hidden debug flag `--pre-save` that can be combined with any AI command (e.g.: `gitpr -c --pre-save`). Before each AI call, it saves the full payload that will be sent to the model (system instruction + prompt + character counters) to a `_{action}-{datetime}.json` file in the current folder, and then proceeds normally. Useful for inspecting very large prompts. Note: when the response comes from the local cache, no call is made and no file is generated.
|
|
156
|
+
|
|
157
|
+
### 📦 Huge Diffs (Map-Reduce)
|
|
158
|
+
|
|
159
|
+
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.
|
|
160
|
+
|
|
161
|
+
📚 Full documentation: [docs/map-reduce-diff.md](https://github.com/natanfiuza/gitpr/blob/main/docs/map-reduce-diff.md)
|
|
143
162
|
|
|
144
163
|
## 🛡️ Local Linter (Static Analysis)
|
|
145
164
|
|
|
@@ -194,7 +213,64 @@ GitPR automatically detects your system language and displays messages in your n
|
|
|
194
213
|
|
|
195
214
|
To force a specific language, set `GITPR_LANG=pt_br` or `GITPR_LANG=en` in `~/.gitpr/.env`.
|
|
196
215
|
|
|
197
|
-
> 📖 **Full developer guide:** [docs/i18n_explanation.md](docs/i18n_explanation.md) — architecture, usage patterns, circular import precautions, and how to add new languages.
|
|
216
|
+
> 📖 **Full developer guide:** [docs/i18n_explanation.md](https://github.com/natanfiuza/gitpr/blob/main/docs/i18n_explanation.md) — architecture, usage patterns, circular import precautions, and how to add new languages.
|
|
217
|
+
|
|
218
|
+
## 🔌 MCP Integration (Model Context Protocol)
|
|
219
|
+
|
|
220
|
+
GitPR can run as an **MCP server**, exposing its AI-powered capabilities as tools that your editor's AI assistant can invoke directly — no terminal needed. This enables a fully integrated workflow where you can generate commit messages, review code, run linters, trace code origins, and create issues without leaving your IDE.
|
|
221
|
+
|
|
222
|
+
### Supported Editors
|
|
223
|
+
|
|
224
|
+
| Editor | Config File |
|
|
225
|
+
| ------ | ----------- |
|
|
226
|
+
| **VS Code** | `.vscode/mcp.json` |
|
|
227
|
+
| **Cursor** | `.cursor/mcp.json` |
|
|
228
|
+
| **Claude Code** | `.mcp.json` |
|
|
229
|
+
| **Claude Desktop** | `claude_desktop_config.json` |
|
|
230
|
+
| **Zed** | `settings.json` |
|
|
231
|
+
|
|
232
|
+
### Quick Setup
|
|
233
|
+
|
|
234
|
+
Use the built-in installer to configure your editor automatically:
|
|
235
|
+
|
|
236
|
+
```bash
|
|
237
|
+
gitpr-mcp --install vscode # Creates .vscode/mcp.json
|
|
238
|
+
gitpr-mcp --install cursor # Creates .cursor/mcp.json
|
|
239
|
+
gitpr-mcp --install claude-code # Creates .mcp.json
|
|
240
|
+
gitpr-mcp --install claude # Updates Claude Desktop config
|
|
241
|
+
gitpr-mcp --install zed # Updates Zed settings
|
|
242
|
+
gitpr-mcp --install auto # Auto-detect and install for all found
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
The installer creates the config directory if needed, merges with any existing
|
|
246
|
+
config (never overwrites other servers), and is safe to run multiple times.
|
|
247
|
+
|
|
248
|
+
> Manual setup is also supported — see [docs/mcp-integration.md](https://github.com/natanfiuza/gitpr/blob/main/docs/mcp-integration.md)
|
|
249
|
+
> for the JSON config format for each editor.
|
|
250
|
+
|
|
251
|
+
Once configured, use natural language in your editor's AI chat:
|
|
252
|
+
|
|
253
|
+
* *"Review my current changes"* → calls `review_code`
|
|
254
|
+
* *"Generate a commit message"* → calls `generate_commit_message`
|
|
255
|
+
* *"Create a PR description"* → calls `generate_pr_description`
|
|
256
|
+
* *"Run the linter on my diff"* → calls `run_linter`
|
|
257
|
+
|
|
258
|
+
### Available MCP Tools
|
|
259
|
+
|
|
260
|
+
| Tool | Description |
|
|
261
|
+
| ---- | ----------- |
|
|
262
|
+
| `get_git_context` | Current branch, repository name, and remote URL |
|
|
263
|
+
| `analyze_diff` | Git diff of uncommitted changes |
|
|
264
|
+
| `get_full_diff` | Full diff against origin/main |
|
|
265
|
+
| `generate_commit_message` | AI-generated Conventional Commits message |
|
|
266
|
+
| `review_code` | AI code review of local changes |
|
|
267
|
+
| `full_review` | AI code review of all changes since origin/main |
|
|
268
|
+
| `generate_pr_description` | Complete PR description (title + body) |
|
|
269
|
+
| `run_linter` | Static linter against `.gitpr.linter.yml` |
|
|
270
|
+
| `analyze_blame` | Git blame + AI classification |
|
|
271
|
+
| `generate_issue` | Structured issue from diff, history, or blame |
|
|
272
|
+
|
|
273
|
+
📖 **Full documentation:** [docs/mcp-integration.md](https://github.com/natanfiuza/gitpr/blob/main/docs/mcp-integration.md) — available in 5 languages (EN, PT-BR, PT-PT, ES, FR).
|
|
198
274
|
|
|
199
275
|
## 📚 Technical Documentation and Advanced Guides
|
|
200
276
|
|
|
@@ -225,10 +301,12 @@ If you want to implement GitPR as an automated quality barrier in your team, che
|
|
|
225
301
|
|
|
226
302
|
### Configuration & Infrastructure
|
|
227
303
|
|
|
304
|
+
* [**Install Wizard**](https://github.com/natanfiuza/gitpr/blob/main/docs/install-wizard.md) — Step-by-step guided setup for configuring GitPR in a new project.
|
|
228
305
|
* [**AI Providers**](https://github.com/natanfiuza/gitpr/blob/main/docs/providers-ia.md) — Configuration and selection between Google Gemini, DeepSeek, and Ollama.
|
|
229
306
|
* [**Auto-Updater**](https://github.com/natanfiuza/gitpr/blob/main/docs/auto-update.md) — How GitPR's automatic update (hot-swap) works.
|
|
230
307
|
* [**GitHub Token (PAT) Integration and Security**](https://github.com/natanfiuza/gitpr/blob/main/docs/github-pat-integration.md) — Understand how GitPR creates issues directly in the repository with authentication.
|
|
231
308
|
* [**Internationalization (i18n)**](https://github.com/natanfiuza/gitpr/blob/main/docs/i18n_explanation.md) — Architecture, usage patterns, and how to add new languages.
|
|
309
|
+
* [**MCP Integration**](https://github.com/natanfiuza/gitpr/blob/main/docs/mcp-integration.md) — Connect GitPR to VS Code, Cursor, and Claude Desktop via Model Context Protocol.
|
|
232
310
|
|
|
233
311
|
## ⚡ Local Cache System (Quota Savings)
|
|
234
312
|
|