gitpr-cli 0.0.34__tar.gz → 0.0.36__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 (59) hide show
  1. {gitpr_cli-0.0.34/gitpr_cli.egg-info → gitpr_cli-0.0.36}/PKG-INFO +38 -3
  2. gitpr_cli-0.0.34/PKG-INFO → gitpr_cli-0.0.36/README.md +473 -457
  3. gitpr_cli-0.0.34/README.md → gitpr_cli-0.0.36/gitpr_cli.egg-info/PKG-INFO +492 -438
  4. {gitpr_cli-0.0.34 → gitpr_cli-0.0.36}/gitpr_cli.egg-info/SOURCES.txt +4 -0
  5. gitpr_cli-0.0.36/src/__init__.py +1 -0
  6. {gitpr_cli-0.0.34 → gitpr_cli-0.0.36}/src/ai_providers.py +158 -53
  7. {gitpr_cli-0.0.34 → gitpr_cli-0.0.36}/src/blame_engine.py +174 -50
  8. {gitpr_cli-0.0.34 → gitpr_cli-0.0.36}/src/cache.py +23 -9
  9. {gitpr_cli-0.0.34 → gitpr_cli-0.0.36}/src/chat_memory.py +60 -39
  10. {gitpr_cli-0.0.34 → gitpr_cli-0.0.36}/src/config.py +137 -25
  11. {gitpr_cli-0.0.34 → gitpr_cli-0.0.36}/src/core.py +583 -162
  12. {gitpr_cli-0.0.34 → gitpr_cli-0.0.36}/src/github_api.py +47 -11
  13. {gitpr_cli-0.0.34 → gitpr_cli-0.0.36}/src/i18n.py +6 -4
  14. gitpr_cli-0.0.36/src/issue_engine.py +273 -0
  15. gitpr_cli-0.0.36/src/linter_engine.py +252 -0
  16. gitpr_cli-0.0.36/src/linter_wizard.py +206 -0
  17. gitpr_cli-0.0.36/src/main.py +1812 -0
  18. gitpr_cli-0.0.36/src/mcp_server.py +2171 -0
  19. {gitpr_cli-0.0.34 → gitpr_cli-0.0.36}/src/metrics.py +60 -24
  20. {gitpr_cli-0.0.34 → gitpr_cli-0.0.36}/src/security.py +4 -1
  21. {gitpr_cli-0.0.34 → gitpr_cli-0.0.36}/src/spinner.py +30 -20
  22. {gitpr_cli-0.0.34 → gitpr_cli-0.0.36}/src/tui_issue.py +37 -11
  23. {gitpr_cli-0.0.34 → gitpr_cli-0.0.36}/src/ui/chat_app.py +137 -49
  24. {gitpr_cli-0.0.34 → gitpr_cli-0.0.36}/src/ui/help_screen.py +14 -11
  25. {gitpr_cli-0.0.34 → gitpr_cli-0.0.36}/src/ui/issue_app.py +54 -26
  26. gitpr_cli-0.0.36/src/ui/linter_app.py +46 -0
  27. {gitpr_cli-0.0.34 → gitpr_cli-0.0.36}/src/ui/metrics_app.py +23 -7
  28. {gitpr_cli-0.0.34 → gitpr_cli-0.0.36}/src/ui/pr_publish_app.py +305 -167
  29. {gitpr_cli-0.0.34 → gitpr_cli-0.0.36}/src/ui/pr_publish_help.py +15 -10
  30. {gitpr_cli-0.0.34 → gitpr_cli-0.0.36}/src/updater.py +81 -28
  31. {gitpr_cli-0.0.34 → gitpr_cli-0.0.36}/tests/test_core.py +75 -0
  32. gitpr_cli-0.0.36/tests/test_external_linters.py +202 -0
  33. gitpr_cli-0.0.36/tests/test_i18n.py +153 -0
  34. {gitpr_cli-0.0.34 → gitpr_cli-0.0.36}/tests/test_linter_metrics.py +8 -4
  35. gitpr_cli-0.0.36/tests/test_mcp_server.py +882 -0
  36. gitpr_cli-0.0.34/src/__init__.py +0 -1
  37. gitpr_cli-0.0.34/src/issue_engine.py +0 -168
  38. gitpr_cli-0.0.34/src/linter_engine.py +0 -125
  39. gitpr_cli-0.0.34/src/main.py +0 -1174
  40. gitpr_cli-0.0.34/src/mcp_server.py +0 -1324
  41. gitpr_cli-0.0.34/tests/test_mcp_server.py +0 -466
  42. {gitpr_cli-0.0.34 → gitpr_cli-0.0.36}/LICENSE +0 -0
  43. {gitpr_cli-0.0.34 → gitpr_cli-0.0.36}/gitpr_cli.egg-info/dependency_links.txt +0 -0
  44. {gitpr_cli-0.0.34 → gitpr_cli-0.0.36}/gitpr_cli.egg-info/entry_points.txt +0 -0
  45. {gitpr_cli-0.0.34 → gitpr_cli-0.0.36}/gitpr_cli.egg-info/requires.txt +0 -0
  46. {gitpr_cli-0.0.34 → gitpr_cli-0.0.36}/gitpr_cli.egg-info/top_level.txt +0 -0
  47. {gitpr_cli-0.0.34 → gitpr_cli-0.0.36}/pyproject.toml +0 -0
  48. {gitpr_cli-0.0.34 → gitpr_cli-0.0.36}/setup.cfg +0 -0
  49. {gitpr_cli-0.0.34 → gitpr_cli-0.0.36}/src/ui/__init__.py +0 -0
  50. {gitpr_cli-0.0.34 → gitpr_cli-0.0.36}/tests/test_blame_metrics.py +0 -0
  51. {gitpr_cli-0.0.34 → gitpr_cli-0.0.36}/tests/test_chat_backend.py +0 -0
  52. {gitpr_cli-0.0.34 → gitpr_cli-0.0.36}/tests/test_install_wizard.py +0 -0
  53. {gitpr_cli-0.0.34 → gitpr_cli-0.0.36}/tests/test_mcp_prompts.py +0 -0
  54. {gitpr_cli-0.0.34 → gitpr_cli-0.0.36}/tests/test_metrics.py +0 -0
  55. {gitpr_cli-0.0.34 → gitpr_cli-0.0.36}/tests/test_plugins.py +0 -0
  56. {gitpr_cli-0.0.34 → gitpr_cli-0.0.36}/tests/test_pre_save.py +0 -0
  57. {gitpr_cli-0.0.34 → gitpr_cli-0.0.36}/tests/test_skill_command.py +0 -0
  58. {gitpr_cli-0.0.34 → gitpr_cli-0.0.36}/tests/test_smart_excludes.py +0 -0
  59. {gitpr_cli-0.0.34 → gitpr_cli-0.0.36}/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.34
3
+ Version: 0.0.36
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
@@ -164,6 +164,7 @@ You can pass the following *flags* for specific actions:
164
164
  * `-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
165
  * `--status`: Lists uncommitted file changes categorized as **new**, **modified**, and **deleted** — fast, no AI, no network. 📖 [Full docs](https://github.com/natanfiuza/gitpr/blob/main/docs/git-status.md)
166
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/natanfiuza/gitpr/blob/main/docs/git-status.md)
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/natanfiuza/gitpr/blob/main/docs/linter-regras-customizadas.md)
167
168
  * `--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 10 annotated tools, 15 resources, and 7 pre-built prompts directly inside your IDE. Also available as the standalone `gitpr-mcp` command.
168
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/natanfiuza/gitpr/blob/main/docs/plugins-system.md)
169
170
  * `--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.
@@ -173,7 +174,7 @@ You can pass the following *flags* for specific actions:
173
174
  * **New Code Issue (`gitpr -is`):** Reads the current `git diff`. **Why use:** Ideal for quickly documenting the task you just finished programming, before committing.
174
175
  * **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.
175
176
  * **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.
176
- * **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 and optional auto-merge. Use `--base <branch>` to change the target branch. 📖 [Full docs](https://github.com/natanfiuza/gitpr/blob/main/docs/pull-request-publication.md)
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/natanfiuza/gitpr/blob/main/docs/pull-request-publication.md)
177
178
  * `-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.
178
179
  * `-u` or `--update`: Checks and installs the latest version of GitPR (Auto-Updater).
179
180
 
@@ -208,6 +209,20 @@ rules:
208
209
 
209
210
  The Linter analyzes only the **added lines** in your `git diff`, ensuring a focused and extremely fast execution. If there are violations, they will appear highlighted at the top of your review file.
210
211
 
212
+ ### External Linters (Checkstyle Bridge)
213
+
214
+ If your project already uses tools like ESLint, PHP_CodeSniffer or Stylelint, GitPR can act as a bridge — running them in the background and filtering errors **only for the lines you changed** in your current diff. Any linter that emits reports in the `checkstyle` format is supported.
215
+
216
+ Instead of configuring the YAML manually, use the interactive wizard:
217
+
218
+ ```bash
219
+ gitpr --linter-setup
220
+ ```
221
+
222
+ The wizard shows pre-configured presets (PHPCS, ESLint, Stylelint — controlled remotely via `templates/gitpr.linter-presets.json`), guides you through the native installation command (e.g.: `npm install --save-dev eslint`), and injects the correct `external_linters` block into your `.gitpr.linter.yml`.
223
+
224
+ Every run — manual via `--linter` or automatic before commits — consolidates the Regex Rules and External Linters into a single Markdown report saved at `.gitpr/reports/linter/` (customizable via `OUTPUT_FILE_NAME_LINTER`).
225
+
211
226
  ## 🧠 Multi-Model Architecture (AI-Agnostic)
212
227
 
213
228
  GitPR is not tied to a single Artificial Intelligence. During initial setup, the user can choose their default engine. We currently support:
@@ -322,6 +337,25 @@ Once configured, use natural language in your editor's AI chat:
322
337
  | `run_linter` | Static linter against `.gitpr.linter.yml` |
323
338
  | `analyze_blame` | Git blame + AI classification |
324
339
  | `generate_issue` | Structured issue from diff, history, or blame |
340
+ | `list_unstaged_files` | Uncommitted file changes categorized (new/modified/deleted) |
341
+ | `analyze_unstaged_diff` | Unstaged diff only (working tree vs index) |
342
+
343
+ ### Direct CLI Invocation
344
+
345
+ All GitPR MCP tools can be invoked directly from the terminal without starting the stdio server:
346
+
347
+ ```bash
348
+ # List all available tools with their parameter signatures
349
+ gitpr-mcp --tool
350
+
351
+ # Invoke a specific tool
352
+ gitpr-mcp --tool get_git_context
353
+ gitpr-mcp --tool review_code
354
+ gitpr-mcp --tool generate_commit_message --tool-args '{"diff_text":"..."}'
355
+ gitpr-mcp --tool analyze_blame --tool-args '{"file_path":"src/main.py","start_line":"270","end_line":"284"}'
356
+ ```
357
+
358
+ 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.
325
359
 
326
360
  📖 **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).
327
361
 
@@ -373,6 +407,7 @@ By default, GitPR saves all generated files in the `.gitpr/reports/` directory,
373
407
  | File Review | `.gitpr/reports/file_review/` |
374
408
  | Blame Report | `.gitpr/reports/blame/` |
375
409
  | Issue Draft | `.gitpr/reports/issue/` |
410
+ | Linter Report | `.gitpr/reports/linter/` |
376
411
 
377
412
  Directories are created automatically on first use. **Backward compatible:** if your `.env` already contains custom paths with directory separators (e.g., `OUTPUT_FILE_NAME=/home/user/prs/my_pr.md`), those are honored as-is — GitPR only redirects bare filenames to `.gitpr/reports/`.
378
413
 
@@ -392,7 +427,7 @@ If you want to implement GitPR as an automated quality barrier in your team, che
392
427
 
393
428
  * [**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.
394
429
  * [**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.
395
- * [**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.
430
+ * [**Customizable Static Linter**](https://github.com/natanfiuza/gitpr/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.
396
431
  * [**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.
397
432
 
398
433
  ### Core Features