jeeves-git-commit 2.2.0 → 2.3.0
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.
- checksums.yaml +4 -4
- data/README.md +6 -6
- data/config/prompt +13 -14
- data/lib/jeeves/version.rb +1 -1
- data/lib/jeeves.rb +7 -13
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6f9cafa5a9ee72892de5d30d61a265d6aafe57a992c2be8ca86619a9db35a9ee
|
4
|
+
data.tar.gz: 6cc58003d2999ee7c5346782fab3ffd2d74857da5752f99a72653876b83c27a5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: feb83d49fee7a876c25260eb8f9d34538f9022266b5f866f3edcd625f6c3cf10453284b4e059b405377bf860baba5d6ef7fe0590b0e3e40314c0c256b253aff5
|
7
|
+
data.tar.gz: bd432c77c41aa452ab0699e87444fa310c34ffbcf5663f78332933218706ad2f79fc388dd6e973c69204129d0c34e7a1ac1cd129babfceb606d92297ba928a06
|
data/README.md
CHANGED
@@ -9,10 +9,10 @@ Jeeves is a command-line tool that creates AI-powered Git commit messages that m
|
|
9
9
|
## Features
|
10
10
|
|
11
11
|
- Generate intelligent [conventional commit](https://www.conventionalcommits.org/en/v1.0.0/) messages with [gitmoji](https://gitmoji.dev) based on your staged changes that point out what an idiot you are.
|
12
|
-
- Option to automatically stage all changes before committing
|
13
|
-
- Option to push changes after committing
|
14
|
-
- Customizable AI prompts for tailored commit message generation
|
15
|
-
- Choose any AI model (chat-gpt 5-mini by default)
|
12
|
+
- Option to automatically stage all changes before committing.
|
13
|
+
- Option to push changes after committing.
|
14
|
+
- Customizable AI prompts for tailored commit message generation.
|
15
|
+
- Choose any AI model (chat-gpt 5-mini by default).
|
16
16
|
|
17
17
|
## Example Commit message
|
18
18
|
|
@@ -115,10 +115,10 @@ You can get an API key from [OpenRouter](https://openrouter.ai/).
|
|
115
115
|
Optionally, you can specify a different model by setting:
|
116
116
|
|
117
117
|
```bash
|
118
|
-
export GIT_COMMIT_MODEL="openai/gpt-
|
118
|
+
export GIT_COMMIT_MODEL="openai/gpt-4o"
|
119
119
|
```
|
120
120
|
|
121
|
-
The default model is `openai/gpt-
|
121
|
+
The default model is `openai/gpt-4o-mini` if not specified.
|
122
122
|
|
123
123
|
### Prompt Configuration
|
124
124
|
|
data/config/prompt
CHANGED
@@ -1,21 +1,20 @@
|
|
1
|
-
|
1
|
+
You are a git commit message generator. Your job is to write a commit message for the following git diff.
|
2
2
|
|
3
|
-
|
3
|
+
OUTPUT ONLY THE COMMIT MESSAGE - NO EXPLANATIONS, NO REASONING, NO COMMENTARY.
|
4
4
|
|
5
|
-
|
6
|
-
- Start with
|
7
|
-
- Follow
|
8
|
-
-
|
9
|
-
- Use present tense
|
10
|
-
-
|
11
|
-
- Assume the audience is educated software engineers
|
5
|
+
Rules for the commit message:
|
6
|
+
- Start with a gitmoji emoji
|
7
|
+
- Follow conventional commit format: type(scope): description
|
8
|
+
- Be brutally honest and roast the code author
|
9
|
+
- Use present tense verbs
|
10
|
+
- Include a detailed body explaining the changes
|
12
11
|
|
13
|
-
Example
|
14
|
-
|
12
|
+
Example:
|
13
|
+
✨ feat(api): add error handling because apparently nobody thought about what happens when things go wrong
|
15
14
|
|
16
|
-
|
17
|
-
|
18
|
-
Additional context or technical details when relevant.
|
15
|
+
Implement basic error handling for the authentication endpoint because someone decided to ship code that crashes spectacularly when the database is unreachable. Add try-catch blocks, proper error responses, and logging so we can at least pretend to be professional developers.
|
19
16
|
|
20
17
|
DIFF:
|
21
18
|
{{DIFF}}
|
19
|
+
|
20
|
+
COMMIT MESSAGE:
|
data/lib/jeeves/version.rb
CHANGED
data/lib/jeeves.rb
CHANGED
@@ -120,7 +120,7 @@ module Jeeves
|
|
120
120
|
exit 1
|
121
121
|
end
|
122
122
|
|
123
|
-
model = ENV['GIT_COMMIT_MODEL'] || 'openai/gpt-
|
123
|
+
model = ENV['GIT_COMMIT_MODEL'] || 'openai/gpt-4o-mini'
|
124
124
|
|
125
125
|
prompt_file_path = get_prompt_file_path
|
126
126
|
puts "Using prompt file: #{prompt_file_path}"
|
@@ -150,13 +150,12 @@ module Jeeves
|
|
150
150
|
request_body = {
|
151
151
|
model: model,
|
152
152
|
messages: messages,
|
153
|
-
max_tokens:
|
153
|
+
max_tokens: 1000,
|
154
|
+
stop: ["END_COMMIT"]
|
154
155
|
}
|
155
156
|
|
156
|
-
#
|
157
|
-
|
158
|
-
request_body[:reasoning] = { exclude: true }
|
159
|
-
end
|
157
|
+
# Remove any reasoning parameters that cause API errors
|
158
|
+
# GPT-5 mini will put reasoning in the reasoning field regardless
|
160
159
|
|
161
160
|
request.body = request_body.to_json
|
162
161
|
|
@@ -171,12 +170,6 @@ module Jeeves
|
|
171
170
|
message = result['choices'][0]['message']
|
172
171
|
commit_message = message['content']
|
173
172
|
|
174
|
-
# Handle OpenAI reasoning models (like GPT-5 mini) where content might be empty
|
175
|
-
# but reasoning contains the actual response
|
176
|
-
if (!commit_message || commit_message.strip.empty?) && message['reasoning']
|
177
|
-
commit_message = message['reasoning']
|
178
|
-
end
|
179
|
-
|
180
173
|
if commit_message && !commit_message.strip.empty?
|
181
174
|
commit_message = commit_message.strip
|
182
175
|
puts "Generated commit message:"
|
@@ -186,7 +179,8 @@ module Jeeves
|
|
186
179
|
return commit_message
|
187
180
|
else
|
188
181
|
puts "Error: API returned empty commit message"
|
189
|
-
puts "
|
182
|
+
puts "This model (#{model}) may not be compatible with direct output."
|
183
|
+
puts "Try using a different model with: export GIT_COMMIT_MODEL=\"openai/gpt-4o-mini\""
|
190
184
|
exit 1
|
191
185
|
end
|
192
186
|
else
|