gitpr-cli 0.0.34__tar.gz → 0.0.35__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 (50) hide show
  1. {gitpr_cli-0.0.34 → gitpr_cli-0.0.35}/PKG-INFO +21 -2
  2. {gitpr_cli-0.0.34 → gitpr_cli-0.0.35}/README.md +20 -1
  3. {gitpr_cli-0.0.34 → gitpr_cli-0.0.35}/gitpr_cli.egg-info/PKG-INFO +21 -2
  4. {gitpr_cli-0.0.34 → gitpr_cli-0.0.35}/src/core.py +6 -6
  5. {gitpr_cli-0.0.34 → gitpr_cli-0.0.35}/src/main.py +2 -2
  6. {gitpr_cli-0.0.34 → gitpr_cli-0.0.35}/src/mcp_server.py +497 -31
  7. {gitpr_cli-0.0.34 → gitpr_cli-0.0.35}/src/ui/pr_publish_app.py +71 -11
  8. {gitpr_cli-0.0.34 → gitpr_cli-0.0.35}/src/updater.py +2 -2
  9. gitpr_cli-0.0.35/tests/test_mcp_server.py +882 -0
  10. gitpr_cli-0.0.34/tests/test_mcp_server.py +0 -466
  11. {gitpr_cli-0.0.34 → gitpr_cli-0.0.35}/LICENSE +0 -0
  12. {gitpr_cli-0.0.34 → gitpr_cli-0.0.35}/gitpr_cli.egg-info/SOURCES.txt +0 -0
  13. {gitpr_cli-0.0.34 → gitpr_cli-0.0.35}/gitpr_cli.egg-info/dependency_links.txt +0 -0
  14. {gitpr_cli-0.0.34 → gitpr_cli-0.0.35}/gitpr_cli.egg-info/entry_points.txt +0 -0
  15. {gitpr_cli-0.0.34 → gitpr_cli-0.0.35}/gitpr_cli.egg-info/requires.txt +0 -0
  16. {gitpr_cli-0.0.34 → gitpr_cli-0.0.35}/gitpr_cli.egg-info/top_level.txt +0 -0
  17. {gitpr_cli-0.0.34 → gitpr_cli-0.0.35}/pyproject.toml +0 -0
  18. {gitpr_cli-0.0.34 → gitpr_cli-0.0.35}/setup.cfg +0 -0
  19. {gitpr_cli-0.0.34 → gitpr_cli-0.0.35}/src/__init__.py +0 -0
  20. {gitpr_cli-0.0.34 → gitpr_cli-0.0.35}/src/ai_providers.py +0 -0
  21. {gitpr_cli-0.0.34 → gitpr_cli-0.0.35}/src/blame_engine.py +0 -0
  22. {gitpr_cli-0.0.34 → gitpr_cli-0.0.35}/src/cache.py +0 -0
  23. {gitpr_cli-0.0.34 → gitpr_cli-0.0.35}/src/chat_memory.py +0 -0
  24. {gitpr_cli-0.0.34 → gitpr_cli-0.0.35}/src/config.py +0 -0
  25. {gitpr_cli-0.0.34 → gitpr_cli-0.0.35}/src/github_api.py +0 -0
  26. {gitpr_cli-0.0.34 → gitpr_cli-0.0.35}/src/i18n.py +0 -0
  27. {gitpr_cli-0.0.34 → gitpr_cli-0.0.35}/src/issue_engine.py +0 -0
  28. {gitpr_cli-0.0.34 → gitpr_cli-0.0.35}/src/linter_engine.py +0 -0
  29. {gitpr_cli-0.0.34 → gitpr_cli-0.0.35}/src/metrics.py +0 -0
  30. {gitpr_cli-0.0.34 → gitpr_cli-0.0.35}/src/security.py +0 -0
  31. {gitpr_cli-0.0.34 → gitpr_cli-0.0.35}/src/spinner.py +0 -0
  32. {gitpr_cli-0.0.34 → gitpr_cli-0.0.35}/src/tui_issue.py +0 -0
  33. {gitpr_cli-0.0.34 → gitpr_cli-0.0.35}/src/ui/__init__.py +0 -0
  34. {gitpr_cli-0.0.34 → gitpr_cli-0.0.35}/src/ui/chat_app.py +0 -0
  35. {gitpr_cli-0.0.34 → gitpr_cli-0.0.35}/src/ui/help_screen.py +0 -0
  36. {gitpr_cli-0.0.34 → gitpr_cli-0.0.35}/src/ui/issue_app.py +0 -0
  37. {gitpr_cli-0.0.34 → gitpr_cli-0.0.35}/src/ui/metrics_app.py +0 -0
  38. {gitpr_cli-0.0.34 → gitpr_cli-0.0.35}/src/ui/pr_publish_help.py +0 -0
  39. {gitpr_cli-0.0.34 → gitpr_cli-0.0.35}/tests/test_blame_metrics.py +0 -0
  40. {gitpr_cli-0.0.34 → gitpr_cli-0.0.35}/tests/test_chat_backend.py +0 -0
  41. {gitpr_cli-0.0.34 → gitpr_cli-0.0.35}/tests/test_core.py +0 -0
  42. {gitpr_cli-0.0.34 → gitpr_cli-0.0.35}/tests/test_install_wizard.py +0 -0
  43. {gitpr_cli-0.0.34 → gitpr_cli-0.0.35}/tests/test_linter_metrics.py +0 -0
  44. {gitpr_cli-0.0.34 → gitpr_cli-0.0.35}/tests/test_mcp_prompts.py +0 -0
  45. {gitpr_cli-0.0.34 → gitpr_cli-0.0.35}/tests/test_metrics.py +0 -0
  46. {gitpr_cli-0.0.34 → gitpr_cli-0.0.35}/tests/test_plugins.py +0 -0
  47. {gitpr_cli-0.0.34 → gitpr_cli-0.0.35}/tests/test_pre_save.py +0 -0
  48. {gitpr_cli-0.0.34 → gitpr_cli-0.0.35}/tests/test_skill_command.py +0 -0
  49. {gitpr_cli-0.0.34 → gitpr_cli-0.0.35}/tests/test_smart_excludes.py +0 -0
  50. {gitpr_cli-0.0.34 → gitpr_cli-0.0.35}/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.35
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
@@ -173,7 +173,7 @@ You can pass the following *flags* for specific actions:
173
173
  * **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
174
  * **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
175
  * **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)
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, 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
177
  * `-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
178
  * `-u` or `--update`: Checks and installs the latest version of GitPR (Auto-Updater).
179
179
 
@@ -322,6 +322,25 @@ Once configured, use natural language in your editor's AI chat:
322
322
  | `run_linter` | Static linter against `.gitpr.linter.yml` |
323
323
  | `analyze_blame` | Git blame + AI classification |
324
324
  | `generate_issue` | Structured issue from diff, history, or blame |
325
+ | `list_unstaged_files` | Uncommitted file changes categorized (new/modified/deleted) |
326
+ | `analyze_unstaged_diff` | Unstaged diff only (working tree vs index) |
327
+
328
+ ### Direct CLI Invocation
329
+
330
+ All GitPR MCP tools can be invoked directly from the terminal without starting the stdio server:
331
+
332
+ ```bash
333
+ # List all available tools with their parameter signatures
334
+ gitpr-mcp --tool
335
+
336
+ # Invoke a specific tool
337
+ gitpr-mcp --tool get_git_context
338
+ gitpr-mcp --tool review_code
339
+ gitpr-mcp --tool generate_commit_message --tool-args '{"diff_text":"..."}'
340
+ gitpr-mcp --tool analyze_blame --tool-args '{"file_path":"src/main.py","start_line":"270","end_line":"284"}'
341
+ ```
342
+
343
+ 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
344
 
326
345
  📖 **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
346
 
@@ -154,7 +154,7 @@ You can pass the following *flags* for specific actions:
154
154
  * **New Code Issue (`gitpr -is`):** Reads the current `git diff`. **Why use:** Ideal for quickly documenting the task you just finished programming, before committing.
155
155
  * **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.
156
156
  * **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.
157
- * **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)
157
+ * **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)
158
158
  * `-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.
159
159
  * `-u` or `--update`: Checks and installs the latest version of GitPR (Auto-Updater).
160
160
 
@@ -303,6 +303,25 @@ Once configured, use natural language in your editor's AI chat:
303
303
  | `run_linter` | Static linter against `.gitpr.linter.yml` |
304
304
  | `analyze_blame` | Git blame + AI classification |
305
305
  | `generate_issue` | Structured issue from diff, history, or blame |
306
+ | `list_unstaged_files` | Uncommitted file changes categorized (new/modified/deleted) |
307
+ | `analyze_unstaged_diff` | Unstaged diff only (working tree vs index) |
308
+
309
+ ### Direct CLI Invocation
310
+
311
+ All GitPR MCP tools can be invoked directly from the terminal without starting the stdio server:
312
+
313
+ ```bash
314
+ # List all available tools with their parameter signatures
315
+ gitpr-mcp --tool
316
+
317
+ # Invoke a specific tool
318
+ gitpr-mcp --tool get_git_context
319
+ gitpr-mcp --tool review_code
320
+ gitpr-mcp --tool generate_commit_message --tool-args '{"diff_text":"..."}'
321
+ gitpr-mcp --tool analyze_blame --tool-args '{"file_path":"src/main.py","start_line":"270","end_line":"284"}'
322
+ ```
323
+
324
+ 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.
306
325
 
307
326
  📖 **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).
308
327
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gitpr-cli
3
- Version: 0.0.34
3
+ Version: 0.0.35
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
@@ -173,7 +173,7 @@ You can pass the following *flags* for specific actions:
173
173
  * **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
174
  * **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
175
  * **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)
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, 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
177
  * `-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
178
  * `-u` or `--update`: Checks and installs the latest version of GitPR (Auto-Updater).
179
179
 
@@ -322,6 +322,25 @@ Once configured, use natural language in your editor's AI chat:
322
322
  | `run_linter` | Static linter against `.gitpr.linter.yml` |
323
323
  | `analyze_blame` | Git blame + AI classification |
324
324
  | `generate_issue` | Structured issue from diff, history, or blame |
325
+ | `list_unstaged_files` | Uncommitted file changes categorized (new/modified/deleted) |
326
+ | `analyze_unstaged_diff` | Unstaged diff only (working tree vs index) |
327
+
328
+ ### Direct CLI Invocation
329
+
330
+ All GitPR MCP tools can be invoked directly from the terminal without starting the stdio server:
331
+
332
+ ```bash
333
+ # List all available tools with their parameter signatures
334
+ gitpr-mcp --tool
335
+
336
+ # Invoke a specific tool
337
+ gitpr-mcp --tool get_git_context
338
+ gitpr-mcp --tool review_code
339
+ gitpr-mcp --tool generate_commit_message --tool-args '{"diff_text":"..."}'
340
+ gitpr-mcp --tool analyze_blame --tool-args '{"file_path":"src/main.py","start_line":"270","end_line":"284"}'
341
+ ```
342
+
343
+ 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
344
 
326
345
  📖 **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
346
 
@@ -333,10 +333,10 @@ def get_changed_docs_list(ancestor_hash=None):
333
333
  check=True,
334
334
  )
335
335
 
336
- all_files = result.stdout.strip().split("\n")
336
+ all_files = result.stdout.splitlines()
337
337
  doc_files = []
338
338
  for f in all_files:
339
- if not f:
339
+ if not f.strip():
340
340
  continue
341
341
  for pattern in raw_patterns:
342
342
  if fnmatch.fnmatch(f, pattern):
@@ -1153,8 +1153,8 @@ def get_uncommitted_summary():
1153
1153
  capture_output=True, text=True, encoding="utf-8", errors="replace",
1154
1154
  )
1155
1155
  summary = {"staged": [], "unstaged": [], "untracked": []}
1156
- for line in result.stdout.strip().split("\n"):
1157
- if not line:
1156
+ for line in result.stdout.splitlines():
1157
+ if not line.strip():
1158
1158
  continue
1159
1159
  x, y = line[0], line[1]
1160
1160
  path = line[3:].strip()
@@ -1183,8 +1183,8 @@ def get_unstaged_files():
1183
1183
  capture_output=True, text=True, encoding="utf-8", errors="replace",
1184
1184
  )
1185
1185
  files = []
1186
- for line in result.stdout.strip().split("\n"):
1187
- if not line:
1186
+ for line in result.stdout.splitlines():
1187
+ if not line.strip():
1188
1188
  continue
1189
1189
  status_x = line[0] if len(line) > 0 else ""
1190
1190
  status_y = line[1] if len(line) > 1 else ""
@@ -953,10 +953,10 @@ def cli(commit, review, fullreview, linter, skill, update, installhooks, install
953
953
  continue
954
954
 
955
955
  if app.final_message:
956
- cor = "green" if app.final_action in ["saved", "created"] else "red"
956
+ cor = "green" if app.final_action in ["saved", "created", "merged"] else "red"
957
957
  click.secho(f"\n{app.final_message}\n", fg=cor, bold=True)
958
958
 
959
- if app.final_action == "created" and app.final_pr_url:
959
+ if app.final_action in ["created", "merged", "merge_failed"] and app.final_pr_url:
960
960
  if click.confirm(__("🔗 Open the Pull Request in your browser?")):
961
961
  import webbrowser
962
962
  webbrowser.open(app.final_pr_url)