gitpr-cli 0.0.23__tar.gz → 0.0.24__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 (29) hide show
  1. {gitpr_cli-0.0.23 → gitpr_cli-0.0.24}/PKG-INFO +1 -1
  2. {gitpr_cli-0.0.23 → gitpr_cli-0.0.24}/gitpr_cli.egg-info/PKG-INFO +1 -1
  3. {gitpr_cli-0.0.23 → gitpr_cli-0.0.24}/pyproject.toml +1 -1
  4. {gitpr_cli-0.0.23 → gitpr_cli-0.0.24}/src/ai_providers.py +6 -4
  5. {gitpr_cli-0.0.23 → gitpr_cli-0.0.24}/src/config.py +5 -1
  6. {gitpr_cli-0.0.23 → gitpr_cli-0.0.24}/src/main.py +2 -2
  7. {gitpr_cli-0.0.23 → gitpr_cli-0.0.24}/src/updater.py +2 -2
  8. {gitpr_cli-0.0.23 → gitpr_cli-0.0.24}/LICENSE +0 -0
  9. {gitpr_cli-0.0.23 → gitpr_cli-0.0.24}/README.md +0 -0
  10. {gitpr_cli-0.0.23 → gitpr_cli-0.0.24}/gitpr_cli.egg-info/SOURCES.txt +0 -0
  11. {gitpr_cli-0.0.23 → gitpr_cli-0.0.24}/gitpr_cli.egg-info/dependency_links.txt +0 -0
  12. {gitpr_cli-0.0.23 → gitpr_cli-0.0.24}/gitpr_cli.egg-info/entry_points.txt +0 -0
  13. {gitpr_cli-0.0.23 → gitpr_cli-0.0.24}/gitpr_cli.egg-info/requires.txt +0 -0
  14. {gitpr_cli-0.0.23 → gitpr_cli-0.0.24}/gitpr_cli.egg-info/top_level.txt +0 -0
  15. {gitpr_cli-0.0.23 → gitpr_cli-0.0.24}/setup.cfg +0 -0
  16. {gitpr_cli-0.0.23 → gitpr_cli-0.0.24}/src/__init__.py +0 -0
  17. {gitpr_cli-0.0.23 → gitpr_cli-0.0.24}/src/blame_engine.py +0 -0
  18. {gitpr_cli-0.0.23 → gitpr_cli-0.0.24}/src/cache.py +0 -0
  19. {gitpr_cli-0.0.23 → gitpr_cli-0.0.24}/src/core.py +0 -0
  20. {gitpr_cli-0.0.23 → gitpr_cli-0.0.24}/src/i18n.py +0 -0
  21. {gitpr_cli-0.0.23 → gitpr_cli-0.0.24}/src/issue_engine.py +0 -0
  22. {gitpr_cli-0.0.23 → gitpr_cli-0.0.24}/src/linter_engine.py +0 -0
  23. {gitpr_cli-0.0.23 → gitpr_cli-0.0.24}/src/security.py +0 -0
  24. {gitpr_cli-0.0.23 → gitpr_cli-0.0.24}/src/spinner.py +0 -0
  25. {gitpr_cli-0.0.23 → gitpr_cli-0.0.24}/src/tui_issue.py +0 -0
  26. {gitpr_cli-0.0.23 → gitpr_cli-0.0.24}/src/ui/__init__.py +0 -0
  27. {gitpr_cli-0.0.23 → gitpr_cli-0.0.24}/src/ui/help_screen.py +0 -0
  28. {gitpr_cli-0.0.23 → gitpr_cli-0.0.24}/src/ui/issue_app.py +0 -0
  29. {gitpr_cli-0.0.23 → gitpr_cli-0.0.24}/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.23
3
+ Version: 0.0.24
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
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gitpr-cli
3
- Version: 0.0.23
3
+ Version: 0.0.24
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
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "gitpr-cli"
7
- version = "0.0.23"
7
+ version = "0.0.24"
8
8
  description = "Automação de PRs, Commits e Code Review com IA (Gemini e DeepSeek)"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
@@ -34,11 +34,13 @@ def call_ai_model(provider, api_key, api_model, prompt, system_instruction, quie
34
34
  )
35
35
  result_text = response.text
36
36
 
37
- elif provider == "deepseek":
38
- # DeepSeek is 100% compatible with the OpenAI library
39
- client = OpenAI(api_key=api_key, base_url="https://api.deepseek.com")
37
+ elif provider in ["deepseek", "ollama"]:
38
+ # DeepSeek and Ollama are 100% compatible with the OpenAI library.
39
+ base_url = "https://api.deepseek.com" if provider == "deepseek" else "http://localhost:11434/v1"
40
+ client = OpenAI(api_key=api_key, base_url=base_url)
41
+
40
42
  response = client.chat.completions.create(
41
- model=api_model, # e.g.: "deepseek-chat"
43
+ model=api_model,
42
44
  messages=[
43
45
  {"role": "system", "content": system_instruction},
44
46
  {"role": "user", "content": prompt}
@@ -18,6 +18,8 @@ DEFAULT_CONFIG = {
18
18
  "GEMINI_API_MODEL_SECONDARY": "gemini-flash-lite-latest",
19
19
  "DEEPSEEK_API_MODEL_PRIMARY": "deepseek-v4-pro",
20
20
  "DEEPSEEK_API_MODEL_SECONDARY": "deepseek-v4-flash",
21
+ "OLLAMA_API_MODEL_PRIMARY": "llama3",
22
+ "OLLAMA_API_MODEL_SECONDARY": "llama3",
21
23
  "OUTPUT_FILE_NAME": "{branch}_{datetime}_PR_DESC.md",
22
24
  "OUTPUT_FILE_NAME_REVIEW": "{branch}_{datetime}_PR_REVIEW.txt",
23
25
  "OUTPUT_FILE_NAME_FULLREVIEW": "{branch}_{datetime}_PR_FULLREVIEW.txt",
@@ -39,6 +41,8 @@ def get_api_key(provider):
39
41
  encrypted_key = os.getenv("GEMINI_API_KEY_ENCRYPTED")
40
42
  elif provider == "deepseek":
41
43
  encrypted_key = os.getenv("DEEPSEEK_API_KEY_ENCRYPTED")
44
+ elif provider == "ollama":
45
+ return "ollama-local" # Olama does not require authentication!
42
46
  else:
43
47
  return None
44
48
 
@@ -86,7 +90,7 @@ def setup_environment():
86
90
  click.secho(__("🤖 Welcome to GitPR! Let's configure your AI engine."), fg="cyan", bold=True)
87
91
  provider = click.prompt(
88
92
  __("Which artificial intelligence do you want to use as default?"),
89
- type=click.Choice(['gemini', 'deepseek'], case_sensitive=False),
93
+ type=click.Choice(['gemini', 'deepseek', 'ollama'], case_sensitive=False),
90
94
  default='gemini'
91
95
  ).lower()
92
96
  set_key(ENV_FILE, "DEFAULT_AI_PROVIDER", provider)
@@ -96,7 +96,7 @@ HELP_MAP: dict[str, dict[str, str]] = {
96
96
  'provider': {
97
97
  'url': get_doc_url('providers-ia.md'),
98
98
  'title': __('AI Provider Selection (--provider)'),
99
- 'description': __('Forces the use of a specific AI provider for this execution: gemini (Google Gemini) or deepseek (DeepSeek). Temporarily overrides the default provider defined in the .env file.'),
99
+ 'description': __('Forces the use of a specific AI provider for this execution: gemini (Google Gemini), deepseek (DeepSeek) or ollama (Local). Temporarily overrides the default provider defined in the .env file.'),
100
100
  },
101
101
  }
102
102
 
@@ -133,7 +133,7 @@ HELP_PRIORITY: dict[str, int] = {
133
133
  @click.option('-b', '--blame', type=str, help=__("Analyzes the origin of a business rule (e.g., file.py:10-20 or just file.py)."))
134
134
  @click.option('-ht', '--history', is_flag=True, help=__("Uses the entire branch history (Git Log + PR Cache) as context to generate the issue."))
135
135
  @click.option('-is', '--issue', is_flag=True, help=__("Generates a standardized Issue from current changes and opens the interactive interface."))
136
- @click.option('-p', '--provider', type=click.Choice(['gemini', 'deepseek']), help=__("Forces the use of a specific AI provider for this execution."))
136
+ @click.option('-p', '--provider', type=click.Choice(['gemini', 'deepseek', 'ollama']), help=__("Forces the use of a specific AI provider for this execution."))
137
137
  @click.option('-h', '--help', 'help_flag', is_flag=True, help=__("Shows this message and exits. Use with another flag for contextual help (e.g., -h --issue)."))
138
138
  def cli(commit, review, fullreview, linter, skill, update, installhooks, hook, quiet, provider, input, blame, history, issue, help_flag):
139
139
  """
@@ -7,8 +7,8 @@ import click
7
7
  from datetime import datetime
8
8
 
9
9
  # Current version of your local executable (Update this on every new build!)
10
- __version__ = "0.0.22" # GitPR current version
11
- __lang_version__ = "v0.0.1" # Language dictionary version control
10
+ __version__ = "0.0.24" # GitPR current version
11
+ __lang_version__ = "v0.0.2" # Language dictionary version control
12
12
  GITHUB_API_URL = "https://api.github.com/repos/natanfiuza/gitpr/releases/latest"
13
13
  PYPI_API_URL = "https://pypi.org/pypi/gitpr-cli/json"
14
14
 
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes