devcommit 0.1.4.5__tar.gz → 0.1.4.6__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.
- {devcommit-0.1.4.5 → devcommit-0.1.4.6}/PKG-INFO +4 -4
- {devcommit-0.1.4.5 → devcommit-0.1.4.6}/README.md +3 -3
- {devcommit-0.1.4.5 → devcommit-0.1.4.6}/devcommit/app/ai_providers.py +2 -2
- {devcommit-0.1.4.5 → devcommit-0.1.4.6}/devcommit/app/gemini_ai.py +1 -1
- {devcommit-0.1.4.5 → devcommit-0.1.4.6}/devcommit/app/prompt.py +4 -1
- {devcommit-0.1.4.5 → devcommit-0.1.4.6}/devcommit/main.py +34 -2
- {devcommit-0.1.4.5 → devcommit-0.1.4.6}/pyproject.toml +1 -1
- {devcommit-0.1.4.5 → devcommit-0.1.4.6}/COPYING +0 -0
- {devcommit-0.1.4.5 → devcommit-0.1.4.6}/devcommit/__init__.py +0 -0
- {devcommit-0.1.4.5 → devcommit-0.1.4.6}/devcommit/app/__init__.py +0 -0
- {devcommit-0.1.4.5 → devcommit-0.1.4.6}/devcommit/utils/__init__.py +0 -0
- {devcommit-0.1.4.5 → devcommit-0.1.4.6}/devcommit/utils/git.py +0 -0
- {devcommit-0.1.4.5 → devcommit-0.1.4.6}/devcommit/utils/logger.py +0 -0
- {devcommit-0.1.4.5 → devcommit-0.1.4.6}/devcommit/utils/parser.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: devcommit
|
|
3
|
-
Version: 0.1.4.
|
|
3
|
+
Version: 0.1.4.6
|
|
4
4
|
Summary: AI-powered git commit message generator
|
|
5
5
|
License: GNU GENERAL PUBLIC LICENSE
|
|
6
6
|
Version 3, 29 June 2007
|
|
@@ -766,7 +766,7 @@ A command-line AI tool for autocommits.
|
|
|
766
766
|
LOCALE = en
|
|
767
767
|
MAX_NO = 1
|
|
768
768
|
COMMIT_TYPE = conventional
|
|
769
|
-
MODEL_NAME = gemini-
|
|
769
|
+
MODEL_NAME = gemini-2.5-flash
|
|
770
770
|
COMMIT_MODE = auto
|
|
771
771
|
EOF
|
|
772
772
|
```
|
|
@@ -779,7 +779,7 @@ A command-line AI tool for autocommits.
|
|
|
779
779
|
LOCALE = en
|
|
780
780
|
MAX_NO = 1
|
|
781
781
|
COMMIT_TYPE = conventional
|
|
782
|
-
MODEL_NAME = gemini-
|
|
782
|
+
MODEL_NAME = gemini-2.0-flash-exp
|
|
783
783
|
COMMIT_MODE = auto
|
|
784
784
|
EOF
|
|
785
785
|
```
|
|
@@ -914,7 +914,7 @@ All configuration can be set via **environment variables** or **`.dcommit` file*
|
|
|
914
914
|
| Variable | Description | Default |
|
|
915
915
|
|----------|-------------|---------|
|
|
916
916
|
| `GEMINI_API_KEY` | Google Gemini API key | - |
|
|
917
|
-
| `GEMINI_MODEL` | Model name | `gemini-
|
|
917
|
+
| `GEMINI_MODEL` | Model name | `gemini-2.0-flash-exp` |
|
|
918
918
|
|
|
919
919
|
**OpenAI:**
|
|
920
920
|
| Variable | Description | Default |
|
|
@@ -61,7 +61,7 @@ A command-line AI tool for autocommits.
|
|
|
61
61
|
LOCALE = en
|
|
62
62
|
MAX_NO = 1
|
|
63
63
|
COMMIT_TYPE = conventional
|
|
64
|
-
MODEL_NAME = gemini-
|
|
64
|
+
MODEL_NAME = gemini-2.5-flash
|
|
65
65
|
COMMIT_MODE = auto
|
|
66
66
|
EOF
|
|
67
67
|
```
|
|
@@ -74,7 +74,7 @@ A command-line AI tool for autocommits.
|
|
|
74
74
|
LOCALE = en
|
|
75
75
|
MAX_NO = 1
|
|
76
76
|
COMMIT_TYPE = conventional
|
|
77
|
-
MODEL_NAME = gemini-
|
|
77
|
+
MODEL_NAME = gemini-2.0-flash-exp
|
|
78
78
|
COMMIT_MODE = auto
|
|
79
79
|
EOF
|
|
80
80
|
```
|
|
@@ -209,7 +209,7 @@ All configuration can be set via **environment variables** or **`.dcommit` file*
|
|
|
209
209
|
| Variable | Description | Default |
|
|
210
210
|
|----------|-------------|---------|
|
|
211
211
|
| `GEMINI_API_KEY` | Google Gemini API key | - |
|
|
212
|
-
| `GEMINI_MODEL` | Model name | `gemini-
|
|
212
|
+
| `GEMINI_MODEL` | Model name | `gemini-2.0-flash-exp` |
|
|
213
213
|
|
|
214
214
|
**OpenAI:**
|
|
215
215
|
| Variable | Description | Default |
|
|
@@ -47,7 +47,7 @@ class AIProvider(ABC):
|
|
|
47
47
|
class GeminiProvider(AIProvider):
|
|
48
48
|
"""Google Gemini AI provider"""
|
|
49
49
|
|
|
50
|
-
def __init__(self, api_key: str, model: str = "gemini-
|
|
50
|
+
def __init__(self, api_key: str, model: str = "gemini-2.0-flash-exp"):
|
|
51
51
|
if not genai:
|
|
52
52
|
raise ImportError("google-generativeai not installed. Run: pip install google-generativeai")
|
|
53
53
|
|
|
@@ -235,7 +235,7 @@ def get_ai_provider(config) -> AIProvider:
|
|
|
235
235
|
if not api_key:
|
|
236
236
|
raise ValueError("GEMINI_API_KEY not set")
|
|
237
237
|
# Support legacy MODEL_NAME for backward compatibility
|
|
238
|
-
model = config("GEMINI_MODEL", default=None) or config("MODEL_NAME", default="gemini-
|
|
238
|
+
model = config("GEMINI_MODEL", default=None) or config("MODEL_NAME", default="gemini-2.0-flash-exp")
|
|
239
239
|
return GeminiProvider(api_key, model)
|
|
240
240
|
|
|
241
241
|
elif provider_name == "openai":
|
|
@@ -61,7 +61,7 @@ def generateCommitMessage(diff: str) -> str:
|
|
|
61
61
|
# Load Configuration Values
|
|
62
62
|
max_no = config("MAX_NO", default=1, cast=int)
|
|
63
63
|
locale = config("LOCALE", default="en-US")
|
|
64
|
-
commit_type = config("COMMIT_TYPE", default="
|
|
64
|
+
commit_type = config("COMMIT_TYPE", default="normal")
|
|
65
65
|
max_tokens = config("MAX_TOKENS", default=8192, cast=int)
|
|
66
66
|
|
|
67
67
|
# Generate prompt
|
|
@@ -46,10 +46,13 @@ commit_types: Dict[CommitType, str] = {
|
|
|
46
46
|
|
|
47
47
|
def specify_commit_format(commit_type: CommitType) -> str:
|
|
48
48
|
"""Specify the commit format for the given commit type"""
|
|
49
|
+
|
|
50
|
+
# Map "normal" to empty string format
|
|
51
|
+
format_key = "" if commit_type == "normal" else commit_type
|
|
49
52
|
|
|
50
53
|
return (
|
|
51
54
|
f"The output response must be in format:\n"
|
|
52
|
-
f"{commit_type_formats[
|
|
55
|
+
f"{commit_type_formats[format_key]}"
|
|
53
56
|
)
|
|
54
57
|
|
|
55
58
|
|
|
@@ -54,7 +54,7 @@ def main(flags: CommitFlag = None):
|
|
|
54
54
|
if provider == "ollama":
|
|
55
55
|
model = config("OLLAMA_MODEL", default="llama3")
|
|
56
56
|
elif provider == "gemini":
|
|
57
|
-
model = config("GEMINI_MODEL", default=None) or config("MODEL_NAME", default="gemini-
|
|
57
|
+
model = config("GEMINI_MODEL", default=None) or config("MODEL_NAME", default="gemini-2.0-flash-exp")
|
|
58
58
|
elif provider == "openai":
|
|
59
59
|
model = config("OPENAI_MODEL", default="gpt-4o-mini")
|
|
60
60
|
elif provider == "groq":
|
|
@@ -218,7 +218,8 @@ def prompt_commit_message(console, commit_message):
|
|
|
218
218
|
|
|
219
219
|
choices = [
|
|
220
220
|
*numbered_choices,
|
|
221
|
-
{"name": "
|
|
221
|
+
{"name": " ✏️ Enter custom message", "value": "custom"},
|
|
222
|
+
{"name": " ❌ Cancel", "value": "cancel"}
|
|
222
223
|
]
|
|
223
224
|
|
|
224
225
|
action = inquirer.fuzzy(
|
|
@@ -234,9 +235,40 @@ def prompt_commit_message(console, commit_message):
|
|
|
234
235
|
if action == "cancel":
|
|
235
236
|
console.print("\n[bold yellow]⚠️ Commit cancelled[/bold yellow]\n")
|
|
236
237
|
return None
|
|
238
|
+
elif action == "custom":
|
|
239
|
+
return prompt_custom_message(console)
|
|
237
240
|
return action
|
|
238
241
|
|
|
239
242
|
|
|
243
|
+
def prompt_custom_message(console):
|
|
244
|
+
"""Prompt user to enter a custom commit message."""
|
|
245
|
+
console.print()
|
|
246
|
+
console.print("[bold cyan]✏️ Enter your custom commit message:[/bold cyan]")
|
|
247
|
+
console.print()
|
|
248
|
+
|
|
249
|
+
style = get_style({
|
|
250
|
+
"question": "#00d7ff bold",
|
|
251
|
+
"questionmark": "#00d7ff bold",
|
|
252
|
+
"pointer": "#00d7ff bold",
|
|
253
|
+
"instruction": "#7f7f7f",
|
|
254
|
+
"answer": "#00d7ff bold"
|
|
255
|
+
}, style_override=False)
|
|
256
|
+
|
|
257
|
+
custom_message = inquirer.text(
|
|
258
|
+
message="Commit message:",
|
|
259
|
+
style=style,
|
|
260
|
+
qmark="❯",
|
|
261
|
+
validate=lambda result: len(result.strip()) > 0,
|
|
262
|
+
filter=lambda result: result.strip()
|
|
263
|
+
).execute()
|
|
264
|
+
|
|
265
|
+
if not custom_message:
|
|
266
|
+
console.print("\n[bold yellow]⚠️ No message entered, commit cancelled[/bold yellow]\n")
|
|
267
|
+
return None
|
|
268
|
+
|
|
269
|
+
return custom_message
|
|
270
|
+
|
|
271
|
+
|
|
240
272
|
def commit_changes(console, commit, raw_argv):
|
|
241
273
|
subprocess.run(["git", "commit", "-m", commit, *raw_argv])
|
|
242
274
|
console.print("\n[bold green]✅ Committed successfully![/bold green]")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|