gitpr-cli 0.0.25__tar.gz → 0.0.27__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 (37) hide show
  1. {gitpr_cli-0.0.25/gitpr_cli.egg-info → gitpr_cli-0.0.27}/PKG-INFO +47 -16
  2. gitpr_cli-0.0.25/PKG-INFO → gitpr_cli-0.0.27/README.md +265 -252
  3. gitpr_cli-0.0.25/README.md → gitpr_cli-0.0.27/gitpr_cli.egg-info/PKG-INFO +283 -234
  4. {gitpr_cli-0.0.25 → gitpr_cli-0.0.27}/gitpr_cli.egg-info/SOURCES.txt +8 -1
  5. {gitpr_cli-0.0.25 → gitpr_cli-0.0.27}/pyproject.toml +1 -1
  6. gitpr_cli-0.0.27/src/ai_providers.py +255 -0
  7. {gitpr_cli-0.0.25 → gitpr_cli-0.0.27}/src/blame_engine.py +2 -2
  8. gitpr_cli-0.0.27/src/chat_memory.py +218 -0
  9. {gitpr_cli-0.0.25 → gitpr_cli-0.0.27}/src/core.py +163 -31
  10. {gitpr_cli-0.0.25 → gitpr_cli-0.0.27}/src/i18n.py +13 -0
  11. {gitpr_cli-0.0.25 → gitpr_cli-0.0.27}/src/issue_engine.py +1 -1
  12. {gitpr_cli-0.0.25 → gitpr_cli-0.0.27}/src/main.py +81 -1
  13. {gitpr_cli-0.0.25 → gitpr_cli-0.0.27}/src/spinner.py +37 -6
  14. gitpr_cli-0.0.27/src/ui/chat_app.py +587 -0
  15. {gitpr_cli-0.0.25 → gitpr_cli-0.0.27}/src/updater.py +2 -2
  16. gitpr_cli-0.0.27/tests/test_chat_backend.py +198 -0
  17. gitpr_cli-0.0.27/tests/test_pre_save.py +66 -0
  18. gitpr_cli-0.0.27/tests/test_skill_command.py +58 -0
  19. gitpr_cli-0.0.27/tests/test_smart_excludes.py +71 -0
  20. gitpr_cli-0.0.27/tests/test_thinking_words.py +52 -0
  21. gitpr_cli-0.0.25/src/ai_providers.py +0 -80
  22. {gitpr_cli-0.0.25 → gitpr_cli-0.0.27}/LICENSE +0 -0
  23. {gitpr_cli-0.0.25 → gitpr_cli-0.0.27}/gitpr_cli.egg-info/dependency_links.txt +0 -0
  24. {gitpr_cli-0.0.25 → gitpr_cli-0.0.27}/gitpr_cli.egg-info/entry_points.txt +0 -0
  25. {gitpr_cli-0.0.25 → gitpr_cli-0.0.27}/gitpr_cli.egg-info/requires.txt +0 -0
  26. {gitpr_cli-0.0.25 → gitpr_cli-0.0.27}/gitpr_cli.egg-info/top_level.txt +0 -0
  27. {gitpr_cli-0.0.25 → gitpr_cli-0.0.27}/setup.cfg +0 -0
  28. {gitpr_cli-0.0.25 → gitpr_cli-0.0.27}/src/__init__.py +0 -0
  29. {gitpr_cli-0.0.25 → gitpr_cli-0.0.27}/src/cache.py +0 -0
  30. {gitpr_cli-0.0.25 → gitpr_cli-0.0.27}/src/config.py +0 -0
  31. {gitpr_cli-0.0.25 → gitpr_cli-0.0.27}/src/linter_engine.py +0 -0
  32. {gitpr_cli-0.0.25 → gitpr_cli-0.0.27}/src/security.py +0 -0
  33. {gitpr_cli-0.0.25 → gitpr_cli-0.0.27}/src/tui_issue.py +0 -0
  34. {gitpr_cli-0.0.25 → gitpr_cli-0.0.27}/src/ui/__init__.py +0 -0
  35. {gitpr_cli-0.0.25 → gitpr_cli-0.0.27}/src/ui/help_screen.py +0 -0
  36. {gitpr_cli-0.0.25 → gitpr_cli-0.0.27}/src/ui/issue_app.py +0 -0
  37. {gitpr_cli-0.0.25 → gitpr_cli-0.0.27}/tests/test_core.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gitpr-cli
3
- Version: 0.0.25
3
+ Version: 0.0.27
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
@@ -16,8 +16,13 @@ Requires-Dist: textual
16
16
  Requires-Dist: requests
17
17
  Dynamic: license-file
18
18
 
19
+
19
20
  # **GitPR CLI 🚀**
20
21
 
22
+ <p align="center">
23
+ <img src="docs/logo.png" alt="GitPR Logo" width="200">
24
+ </p>
25
+
21
26
  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
27
 
23
28
  ## **🛠️ Technologies and Libraries Used**
@@ -126,7 +131,9 @@ You can pass the following *flags* for specific actions:
126
131
  * `-r` or `--review`: Performs a detailed **Code Review** of local changes.
127
132
  * `-f` or `--fullreview`: Performs a **Full Code Review** analyzing all changes since the remote branch.
128
133
  * `-i <file>` or `--input <file>`: **Full File Audit.** Must be used together with `-r` or `-f`; it ignores git history and does a Code Review of the entire file. Excellent for acting as a consultant on legacy code refactoring.
129
- * `--provider <gemini|deepseek>`: Forces the use of a specific AI only for this execution, ignoring your default saved in `.env`.
134
+ * `--provider <gemini|deepseek|ollama>`: Forces the use of a specific AI only for this execution, ignoring your default saved in `.env`.
135
+ * `--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
+ * `-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).
130
137
  * `-l` or `--linter`: Runs **only the local static linter** (no AI calls). Ideal for use in CI/CD pipelines to block non-compliant code.
131
138
  * `-ih` or `--installhooks`: Automatically installs **local Git Hooks** (`pre-commit` and `prepare-commit-msg`) in your repository.
132
139
  * `-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.
@@ -138,6 +145,14 @@ You can pass the following *flags* for specific actions:
138
145
  * `-u` or `--update`: Checks and installs the latest version of GitPR (Auto-Updater).
139
146
 
140
147
  > **⚙️ 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.
148
+ >
149
+ > **⚙️ 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.
150
+
151
+ ### 📦 Huge Diffs (Map-Reduce)
152
+
153
+ 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
+
155
+ 📚 Full documentation: [docs/map-reduce-diff.md](docs/map-reduce-diff.md)
141
156
 
142
157
  ## 🛡️ Local Linter (Static Analysis)
143
158
 
@@ -165,6 +180,7 @@ The Linter analyzes only the **added lines** in your `git diff`, ensuring a focu
165
180
  GitPR is not tied to a single Artificial Intelligence. During initial setup, the user can choose their default engine. We currently support:
166
181
  * **Google Gemini** (Default: `gemini-2.5-flash`)
167
182
  * **DeepSeek** (Default: `deepseek-chat`)
183
+ * **Ollama** (Local) — run models locally without internet, fully compatible with the OpenAI API format
168
184
 
169
185
  You can dynamically switch models by configuring the `GEMINI_API_MODEL` or `DEEPSEEK_API_MODEL` variables in your `~/.gitpr/.env` file, or switch in real-time using the `--provider` flag.
170
186
 
@@ -197,20 +213,35 @@ To force a specific language, set `GITPR_LANG=pt_br` or `GITPR_LANG=en` in `~/.g
197
213
 
198
214
  To keep this README concise, we detail the most advanced **DevOps** and **Continuous Integration** focused implementations in separate documents.
199
215
 
200
- If you want to implement GitPR as an automated quality barrier in your team, check out the guides below:
201
-
202
- * [**Local Git Hooks (Shift-Left)**](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.
203
- * [**Customizable Static Linter**](docs/linter-regras-customizadas.md): How to create validation rules in `.gitpr.linter.yml` for CI/CD and pre-commit hooks.
204
- * [**Issue Generation and TUI Interface**](docs/issue-tui-help.md): How to use the terminal graphical interface (TUI) and the 3 context engines to manage structured Issues.
205
- * [**AI Code Review**](docs/code-review-ia.md): Guide to review modes (`--review`, `--fullreview`) and file auditing (`--input`).
206
- * [**AI Commit Messages**](docs/commit-message-ia.md): How to generate messages in the Conventional Commits standard and integrate with Git Hooks.
207
- * [**Code Archaeologist (Git Blame)**](docs/blame-arqueologo.md): How to trace the origin of business rules with `git blame` and AI.
208
- * [**Skills and Templates System**](docs/skill-template.md): How to customize AI behavior with `.gitpr.*.md` files.
209
- * [**Auto-Updater**](docs/auto-update.md): How GitPR's automatic update (hot-swap) works.
210
- * [**AI Providers**](docs/providers-ia.md): Configuration and selection between Google Gemini and DeepSeek.
211
- * [**Pull Request (Default Mode)**](docs/pr-descricao-padrao.md): Complete flow for generating PR descriptions without flags.
212
- * [**CI/CD Integration (GitHub Actions)**](docs/github-ci-linter.md): How to run GitPR in the pipeline to block "Merge" of PRs with violations.
213
- * [**GitHub Token (PAT) Integration and Security**](docs/github-pat-integration.md): Understand how GitPR creates issues directly in the repository with authentication.
216
+ If you want to implement GitPR as an automated quality barrier in your team, check out the guides below.
217
+
218
+ > 🌐 Each guide is available in **5 languages** add `.pt_br`, `.pt_pt`, `.fr_fr`, or `.es_es` before the `.md` extension for translated versions (e.g., `docs/understanding_chat_functionality.pt_br.md`). English is the default with no suffix.
219
+
220
+ ### Chat & Interactive Features
221
+
222
+ * [**🧠 Interactive Chat (Pair Programming)**](https://github.com/natanfiuza/gitpr/blob/main/docs/understanding_chat_functionality.md) How to use the AI chat with memory, slash commands, auto-patch, and session export.
223
+
224
+ ### DevOps & CI/CD
225
+
226
+ * [**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.
227
+ * [**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.
228
+ * [**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.
229
+
230
+ ### Core Features
231
+
232
+ * [**Pull Request (Default Mode)**](https://github.com/natanfiuza/gitpr/blob/main/docs/pr-descricao-padrao.md) — Complete flow for generating PR descriptions without flags.
233
+ * [**AI Code Review**](https://github.com/natanfiuza/gitpr/blob/main/docs/code-review-ia.md) — Guide to review modes (`--review`, `--fullreview`) and file auditing (`--input`).
234
+ * [**AI Commit Messages**](https://github.com/natanfiuza/gitpr/blob/main/docs/commit-message-ia.md) — How to generate messages in the Conventional Commits standard and integrate with Git Hooks.
235
+ * [**Issue Generation and TUI Interface**](https://github.com/natanfiuza/gitpr/blob/main/docs/issue-tui-help.md) — How to use the terminal graphical interface (TUI) and the 3 context engines to manage structured Issues.
236
+ * [**Code Archaeologist (Git Blame)**](https://github.com/natanfiuza/gitpr/blob/main/docs/blame-arqueologo.md) — How to trace the origin of business rules with `git blame` and AI.
237
+ * [**Skills and Templates System**](https://github.com/natanfiuza/gitpr/blob/main/docs/skill-template.md) — How to customize AI behavior with `.gitpr.*.md` files.
238
+
239
+ ### Configuration & Infrastructure
240
+
241
+ * [**AI Providers**](https://github.com/natanfiuza/gitpr/blob/main/docs/providers-ia.md) — Configuration and selection between Google Gemini, DeepSeek, and Ollama.
242
+ * [**Auto-Updater**](https://github.com/natanfiuza/gitpr/blob/main/docs/auto-update.md) — How GitPR's automatic update (hot-swap) works.
243
+ * [**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
+ * [**Internationalization (i18n)**](https://github.com/natanfiuza/gitpr/blob/main/docs/i18n_explanation.md) — Architecture, usage patterns, and how to add new languages.
214
245
 
215
246
  ## ⚡ Local Cache System (Quota Savings)
216
247