gitpr-cli 0.0.27__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.
Files changed (39) hide show
  1. {gitpr_cli-0.0.27/gitpr_cli.egg-info → gitpr_cli-0.0.28}/PKG-INFO +69 -4
  2. gitpr_cli-0.0.27/PKG-INFO → gitpr_cli-0.0.28/README.md +329 -283
  3. gitpr_cli-0.0.27/README.md → gitpr_cli-0.0.28/gitpr_cli.egg-info/PKG-INFO +348 -265
  4. {gitpr_cli-0.0.27 → gitpr_cli-0.0.28}/gitpr_cli.egg-info/SOURCES.txt +3 -0
  5. {gitpr_cli-0.0.27 → gitpr_cli-0.0.28}/gitpr_cli.egg-info/entry_points.txt +1 -0
  6. {gitpr_cli-0.0.27 → gitpr_cli-0.0.28}/gitpr_cli.egg-info/requires.txt +1 -0
  7. {gitpr_cli-0.0.27 → gitpr_cli-0.0.28}/pyproject.toml +4 -2
  8. {gitpr_cli-0.0.27 → gitpr_cli-0.0.28}/src/core.py +91 -8
  9. {gitpr_cli-0.0.27 → gitpr_cli-0.0.28}/src/main.py +23 -3
  10. gitpr_cli-0.0.28/src/mcp_server.py +969 -0
  11. {gitpr_cli-0.0.27 → gitpr_cli-0.0.28}/src/updater.py +2 -2
  12. gitpr_cli-0.0.28/tests/test_install_wizard.py +98 -0
  13. gitpr_cli-0.0.28/tests/test_mcp_server.py +403 -0
  14. {gitpr_cli-0.0.27 → gitpr_cli-0.0.28}/LICENSE +0 -0
  15. {gitpr_cli-0.0.27 → gitpr_cli-0.0.28}/gitpr_cli.egg-info/dependency_links.txt +0 -0
  16. {gitpr_cli-0.0.27 → gitpr_cli-0.0.28}/gitpr_cli.egg-info/top_level.txt +0 -0
  17. {gitpr_cli-0.0.27 → gitpr_cli-0.0.28}/setup.cfg +0 -0
  18. {gitpr_cli-0.0.27 → gitpr_cli-0.0.28}/src/__init__.py +0 -0
  19. {gitpr_cli-0.0.27 → gitpr_cli-0.0.28}/src/ai_providers.py +0 -0
  20. {gitpr_cli-0.0.27 → gitpr_cli-0.0.28}/src/blame_engine.py +0 -0
  21. {gitpr_cli-0.0.27 → gitpr_cli-0.0.28}/src/cache.py +0 -0
  22. {gitpr_cli-0.0.27 → gitpr_cli-0.0.28}/src/chat_memory.py +0 -0
  23. {gitpr_cli-0.0.27 → gitpr_cli-0.0.28}/src/config.py +0 -0
  24. {gitpr_cli-0.0.27 → gitpr_cli-0.0.28}/src/i18n.py +0 -0
  25. {gitpr_cli-0.0.27 → gitpr_cli-0.0.28}/src/issue_engine.py +0 -0
  26. {gitpr_cli-0.0.27 → gitpr_cli-0.0.28}/src/linter_engine.py +0 -0
  27. {gitpr_cli-0.0.27 → gitpr_cli-0.0.28}/src/security.py +0 -0
  28. {gitpr_cli-0.0.27 → gitpr_cli-0.0.28}/src/spinner.py +0 -0
  29. {gitpr_cli-0.0.27 → gitpr_cli-0.0.28}/src/tui_issue.py +0 -0
  30. {gitpr_cli-0.0.27 → gitpr_cli-0.0.28}/src/ui/__init__.py +0 -0
  31. {gitpr_cli-0.0.27 → gitpr_cli-0.0.28}/src/ui/chat_app.py +0 -0
  32. {gitpr_cli-0.0.27 → gitpr_cli-0.0.28}/src/ui/help_screen.py +0 -0
  33. {gitpr_cli-0.0.27 → gitpr_cli-0.0.28}/src/ui/issue_app.py +0 -0
  34. {gitpr_cli-0.0.27 → gitpr_cli-0.0.28}/tests/test_chat_backend.py +0 -0
  35. {gitpr_cli-0.0.27 → gitpr_cli-0.0.28}/tests/test_core.py +0 -0
  36. {gitpr_cli-0.0.27 → gitpr_cli-0.0.28}/tests/test_pre_save.py +0 -0
  37. {gitpr_cli-0.0.27 → gitpr_cli-0.0.28}/tests/test_skill_command.py +0 -0
  38. {gitpr_cli-0.0.27 → gitpr_cli-0.0.28}/tests/test_smart_excludes.py +0 -0
  39. {gitpr_cli-0.0.27 → gitpr_cli-0.0.28}/tests/test_thinking_words.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gitpr-cli
3
- Version: 0.0.27
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,17 +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
 
19
20
 
20
21
  # **GitPR CLI 🚀**
21
22
 
22
23
  <p align="center">
23
- <img src="docs/logo.png" alt="GitPR Logo" width="200">
24
+ <img src="https://raw.githubusercontent.com/natanfiuza/gitpr/main/docs/logo.png" alt="GitPR Logo" width="150">
24
25
  </p>
25
26
 
26
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.
27
28
 
29
+ 🌐 **Website:** [gitpr.natanfiuza.dev.br](https://gitpr.natanfiuza.dev.br/) · 📂 **Repository:** [github.com/natanfiuza/gitpr](https://github.com/natanfiuza/gitpr)
30
+
28
31
  ## **🛠️ Technologies and Libraries Used**
29
32
 
30
33
  This project was developed in Python and uses the following main libraries:
@@ -38,6 +41,7 @@ This project was developed in Python and uses the following main libraries:
38
41
  * [**PyYAML**](https://pyyaml.org/): Used to read and process the custom static analysis rules from the `.gitpr.linter.yml` file.
39
42
  * [**Textual**](https://textual.textualize.io/): Powerful library for creating Terminal Graphical Interfaces (TUI), used in the interactive issue generation and editing panel.
40
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.
41
45
 
42
46
  ----
43
47
 
@@ -135,6 +139,8 @@ You can pass the following *flags* for specific actions:
135
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.
136
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).
137
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.
138
144
  * `-ih` or `--installhooks`: Automatically installs **local Git Hooks** (`pre-commit` and `prepare-commit-msg`) in your repository.
139
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.
140
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:
@@ -152,7 +158,7 @@ You can pass the following *flags* for specific actions:
152
158
 
153
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.
154
160
 
155
- 📚 Full documentation: [docs/map-reduce-diff.md](docs/map-reduce-diff.md)
161
+ 📚 Full documentation: [docs/map-reduce-diff.md](https://github.com/natanfiuza/gitpr/blob/main/docs/map-reduce-diff.md)
156
162
 
157
163
  ## 🛡️ Local Linter (Static Analysis)
158
164
 
@@ -207,7 +213,64 @@ GitPR automatically detects your system language and displays messages in your n
207
213
 
208
214
  To force a specific language, set `GITPR_LANG=pt_br` or `GITPR_LANG=en` in `~/.gitpr/.env`.
209
215
 
210
- > 📖 **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).
211
274
 
212
275
  ## 📚 Technical Documentation and Advanced Guides
213
276
 
@@ -238,10 +301,12 @@ If you want to implement GitPR as an automated quality barrier in your team, che
238
301
 
239
302
  ### Configuration & Infrastructure
240
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.
241
305
  * [**AI Providers**](https://github.com/natanfiuza/gitpr/blob/main/docs/providers-ia.md) — Configuration and selection between Google Gemini, DeepSeek, and Ollama.
242
306
  * [**Auto-Updater**](https://github.com/natanfiuza/gitpr/blob/main/docs/auto-update.md) — How GitPR's automatic update (hot-swap) works.
243
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.
244
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.
245
310
 
246
311
  ## ⚡ Local Cache System (Quota Savings)
247
312