gitpr-cli 0.0.30__tar.gz → 0.0.32__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 (49) hide show
  1. {gitpr_cli-0.0.30/gitpr_cli.egg-info → gitpr_cli-0.0.32}/PKG-INFO +69 -1
  2. gitpr_cli-0.0.30/PKG-INFO → gitpr_cli-0.0.32/README.md +402 -353
  3. gitpr_cli-0.0.30/README.md → gitpr_cli-0.0.32/gitpr_cli.egg-info/PKG-INFO +421 -334
  4. {gitpr_cli-0.0.30 → gitpr_cli-0.0.32}/gitpr_cli.egg-info/SOURCES.txt +3 -0
  5. {gitpr_cli-0.0.30 → gitpr_cli-0.0.32}/pyproject.toml +11 -2
  6. {gitpr_cli-0.0.30 → gitpr_cli-0.0.32}/src/ai_providers.py +5 -0
  7. {gitpr_cli-0.0.30 → gitpr_cli-0.0.32}/src/blame_engine.py +5 -1
  8. {gitpr_cli-0.0.30 → gitpr_cli-0.0.32}/src/config.py +30 -2
  9. {gitpr_cli-0.0.30 → gitpr_cli-0.0.32}/src/core.py +327 -25
  10. {gitpr_cli-0.0.30 → gitpr_cli-0.0.32}/src/i18n.py +10 -10
  11. {gitpr_cli-0.0.30 → gitpr_cli-0.0.32}/src/issue_engine.py +24 -4
  12. {gitpr_cli-0.0.30 → gitpr_cli-0.0.32}/src/linter_engine.py +3 -0
  13. {gitpr_cli-0.0.30 → gitpr_cli-0.0.32}/src/main.py +55 -13
  14. gitpr_cli-0.0.32/src/metrics.py +588 -0
  15. {gitpr_cli-0.0.30 → gitpr_cli-0.0.32}/src/spinner.py +6 -6
  16. gitpr_cli-0.0.32/src/tui_issue.py +122 -0
  17. {gitpr_cli-0.0.30 → gitpr_cli-0.0.32}/src/ui/issue_app.py +16 -4
  18. gitpr_cli-0.0.32/src/ui/metrics_app.py +434 -0
  19. {gitpr_cli-0.0.30 → gitpr_cli-0.0.32}/src/updater.py +7 -2
  20. gitpr_cli-0.0.32/tests/test_blame_metrics.py +140 -0
  21. gitpr_cli-0.0.32/tests/test_linter_metrics.py +116 -0
  22. gitpr_cli-0.0.32/tests/test_metrics.py +833 -0
  23. gitpr_cli-0.0.32/tests/test_smart_excludes.py +234 -0
  24. gitpr_cli-0.0.30/src/metrics.py +0 -266
  25. gitpr_cli-0.0.30/src/tui_issue.py +0 -37
  26. gitpr_cli-0.0.30/src/ui/metrics_app.py +0 -168
  27. gitpr_cli-0.0.30/tests/test_smart_excludes.py +0 -71
  28. {gitpr_cli-0.0.30 → gitpr_cli-0.0.32}/LICENSE +0 -0
  29. {gitpr_cli-0.0.30 → gitpr_cli-0.0.32}/gitpr_cli.egg-info/dependency_links.txt +0 -0
  30. {gitpr_cli-0.0.30 → gitpr_cli-0.0.32}/gitpr_cli.egg-info/entry_points.txt +0 -0
  31. {gitpr_cli-0.0.30 → gitpr_cli-0.0.32}/gitpr_cli.egg-info/requires.txt +0 -0
  32. {gitpr_cli-0.0.30 → gitpr_cli-0.0.32}/gitpr_cli.egg-info/top_level.txt +0 -0
  33. {gitpr_cli-0.0.30 → gitpr_cli-0.0.32}/setup.cfg +0 -0
  34. {gitpr_cli-0.0.30 → gitpr_cli-0.0.32}/src/__init__.py +0 -0
  35. {gitpr_cli-0.0.30 → gitpr_cli-0.0.32}/src/cache.py +0 -0
  36. {gitpr_cli-0.0.30 → gitpr_cli-0.0.32}/src/chat_memory.py +0 -0
  37. {gitpr_cli-0.0.30 → gitpr_cli-0.0.32}/src/mcp_server.py +0 -0
  38. {gitpr_cli-0.0.30 → gitpr_cli-0.0.32}/src/security.py +0 -0
  39. {gitpr_cli-0.0.30 → gitpr_cli-0.0.32}/src/ui/__init__.py +0 -0
  40. {gitpr_cli-0.0.30 → gitpr_cli-0.0.32}/src/ui/chat_app.py +0 -0
  41. {gitpr_cli-0.0.30 → gitpr_cli-0.0.32}/src/ui/help_screen.py +0 -0
  42. {gitpr_cli-0.0.30 → gitpr_cli-0.0.32}/tests/test_chat_backend.py +0 -0
  43. {gitpr_cli-0.0.30 → gitpr_cli-0.0.32}/tests/test_core.py +0 -0
  44. {gitpr_cli-0.0.30 → gitpr_cli-0.0.32}/tests/test_install_wizard.py +0 -0
  45. {gitpr_cli-0.0.30 → gitpr_cli-0.0.32}/tests/test_mcp_prompts.py +0 -0
  46. {gitpr_cli-0.0.30 → gitpr_cli-0.0.32}/tests/test_mcp_server.py +0 -0
  47. {gitpr_cli-0.0.30 → gitpr_cli-0.0.32}/tests/test_pre_save.py +0 -0
  48. {gitpr_cli-0.0.30 → gitpr_cli-0.0.32}/tests/test_skill_command.py +0 -0
  49. {gitpr_cli-0.0.30 → gitpr_cli-0.0.32}/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.30
3
+ Version: 0.0.32
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
@@ -28,6 +28,29 @@ GitPR CLI is a command-line automation tool that uses **Google Gemini** and **De
28
28
 
29
29
  🌐 **Website:** [gitpr.natanfiuza.dev.br](https://gitpr.natanfiuza.dev.br/) · 📂 **Repository:** [github.com/natanfiuza/gitpr](https://github.com/natanfiuza/gitpr)
30
30
 
31
+ ----
32
+
33
+ ## ⚡ **Quick Start**
34
+
35
+ ### **1. Installation via PyPI**
36
+
37
+ Install GitPR CLI using `pip`:
38
+
39
+ ```bash
40
+ pip install gitpr-cli
41
+ ```
42
+
43
+ ### **2. Initializing in a Repository**
44
+
45
+ To set up GitPR in a folder of a new repository, run:
46
+
47
+ ```bash
48
+ gitpr --install
49
+ ```
50
+
51
+ > **Guided Setup:** Guided configuration that downloads skill templates, installs Git Hooks, configures MCP for your editors, and verifies the API key for your AI provider.
52
+ > 📖 **Full Documentation:** [https://gitpr.natanfiuza.dev.br/docs/install-wizard?lang=en_us](https://gitpr.natanfiuza.dev.br/docs/install-wizard?lang=en_us)
53
+
31
54
  ## **🛠️ Technologies and Libraries Used**
32
55
 
33
56
  This project was developed in Python and uses the following main libraries:
@@ -215,6 +238,32 @@ To force a specific language, set `GITPR_LANG=pt_br` or `GITPR_LANG=en` in `~/.g
215
238
 
216
239
  > 📖 **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
240
 
241
+ ## 🔄 Hook Scripts Versioning & Auto-Sync
242
+
243
+ 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.
244
+
245
+ **How it works:**
246
+ 1. Reads `SCRIPTS_VERSION` and `SCRIPTS_LANG` from `~/.gitpr/.env`
247
+ 2. Compares with the latest version (`__scripts_version__`) shipped with your GitPR release
248
+ 3. If versions or language differ → automatically downloads and updates hooks
249
+ 4. If everything matches → skips entirely (single `.env` read, zero network I/O)
250
+
251
+ **Example:**
252
+ ```bash
253
+ # First run — no hooks installed yet
254
+ $ gitpr --installhooks
255
+ 📥 Downloading pre-commit...
256
+ 📥 Downloading prepare-commit-msg...
257
+ ✅ Scripts synced successfully!
258
+
259
+ # Subsequent runs — silent checks
260
+ $ gitpr # (no output = hooks are up to date)
261
+ ```
262
+
263
+ The system supports **5 languages**: English (default), Portuguese (Brazil), Portuguese (Portugal), French, and Spanish. Scripts are thin shims — the real logic lives in the CLI, so even slightly stale hooks continue working correctly.
264
+
265
+ 📚 [Full Documentation](https://gitpr.natanfiuza.dev.br/docs/hooks-versioning)
266
+
218
267
  ## 🔌 MCP Integration (Model Context Protocol)
219
268
 
220
269
  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.
@@ -274,6 +323,24 @@ Once configured, use natural language in your editor's AI chat:
274
323
 
275
324
  > 💬 **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/natanfiuza/gitpr/blob/main/docs/mcp-prompts.md) for the full list.
276
325
 
326
+ ## 🎯 Smart Excludes (Token Optimization)
327
+
328
+ 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.
329
+
330
+ **Two layers of exclusions:**
331
+ - **Lockfiles & generated files:** `package-lock.json`, `*.min.js`, `*.map`, `*.pyc`, `*.svg`, and 30+ more patterns defined in [`gitpr.smart-excludes.json`](https://github.com/natanfiuza/gitpr/blob/main/templates/gitpr.smart-excludes.json)
332
+ - **Documentation prose:** `*.md`, `*.txt`, `*.rst`, `*.adoc`, `*.tex`, and 20+ more extensions defined in [`gitpr.docs-smart-excludes.json`](https://github.com/natanfiuza/gitpr/blob/main/templates/gitpr.docs-smart-excludes.json)
333
+
334
+ **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.
335
+
336
+ **Benefits:**
337
+ - ✅ Up to **98% token reduction** on documentation-heavy branches
338
+ - ✅ **Faster AI responses** — less text to process per API call
339
+ - ✅ **Higher-quality analysis** — AI focuses on code changes, not markup
340
+ - ✅ **Zero configuration** — works automatically on every run, managed remotely
341
+
342
+ > 📖 **Full documentation:** [docs/smart-excludes.md](https://github.com/natanfiuza/gitpr/blob/main/docs/smart-excludes.md) — available in 5 languages (EN, PT-BR, PT-PT, FR, ES).
343
+
277
344
  ## 📚 Technical Documentation and Advanced Guides
278
345
 
279
346
  To keep this README concise, we detail the most advanced **DevOps** and **Continuous Integration** focused implementations in separate documents.
@@ -289,6 +356,7 @@ If you want to implement GitPR as an automated quality barrier in your team, che
289
356
  ### DevOps & CI/CD
290
357
 
291
358
  * [**Local Git Hooks (Shift-Left)**](https://github.com/natanfiuza/gitpr/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.
359
+ * [**Hook Scripts Versioning & Auto-Sync**](https://github.com/natanfiuza/gitpr/blob/main/docs/hooks-versioning.md) — How the automatic versioning and i18n-aware synchronization system keeps your Git hooks up to date.
292
360
  * [**Customizable Static Linter**](https://github.com/natanfiuza/gitpr/blob/main/docs/linter-regras-customizadas.md) — How to create validation rules in `.gitpr.linter.yml` for CI/CD and pre-commit hooks.
293
361
  * [**CI/CD Integration (GitHub Actions)**](https://github.com/natanfiuza/gitpr/blob/main/docs/github-ci-linter.md) — How to run GitPR in the pipeline to block "Merge" of PRs with violations.
294
362