jeeves-git-commit 2.4.0 → 2.5.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 437890c2af9e01a72a29380386b655cf00df2f512673f56237e7ca0567aa52db
4
- data.tar.gz: 6bb8314df1fe152733ac8537a16de83f6299db10b265860343fec9f7aa33ee87
3
+ metadata.gz: 61da8e275a8df7260004e3b246fb4f4d33f23cc59412fe112a674929c10a4411
4
+ data.tar.gz: 22c702ed46e03b77068693e3d0418aca2361736e54b1571e8a44ecb1d6371149
5
5
  SHA512:
6
- metadata.gz: 20b02819f4f01cc3610f13531fc67d5b974d9f051a431dcfe379c8644ce23779a34c66ada84df95931432cebe7c40c3afe8f70965023cd19a6bbec9e16434f99
7
- data.tar.gz: '059a47edeba1d3534a82ff9f188c64c286e76d866affa7f39e6a98f49bc72c39cc1915ae377ec89cb1298f15d685a967f085009853093df13a6a7814f973ff3a'
6
+ metadata.gz: e160482997643783ec6ecf7402f4d005ece27b989b09ca1674cf9c45af111cb997a2b47dea42da736158d6ef048c5ed194924dfc2f981d26ec26710ff8711030
7
+ data.tar.gz: '079e247723887f5677eafbe455d87a600362fcefe69adc9f40410b77b8b7b411bc11815b3439429ee837978d70e207a8ed12e04b230a7b9d74771820ab6adf69'
data/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
  <img src="assets/jeeves.png" alt="Jeeves Logo" width="200">
5
5
  </p>
6
6
 
7
- Jeeves is a command-line tool that creates AI-powered Git commit messages that mercilessly roast you and your code.
7
+ Jeeves is a command-line tool that creates AI-powered Git commit messages that savagely roasts you and your code.
8
8
 
9
9
  ## Features
10
10
 
@@ -1,3 +1,3 @@
1
1
  module Jeeves
2
- VERSION = '2.4.0'
2
+ VERSION = '2.5.0'
3
3
  end
data/lib/jeeves.rb CHANGED
@@ -13,7 +13,8 @@ module Jeeves
13
13
  def initialize
14
14
  @options = {
15
15
  all: false,
16
- push: false
16
+ push: false,
17
+ dry_run: false
17
18
  }
18
19
  setup_config_dir
19
20
  end
@@ -33,6 +34,10 @@ module Jeeves
33
34
  @options[:push] = true
34
35
  end
35
36
 
37
+ opts.on('-d', '--dry-run', 'Generate commit message without committing') do
38
+ @options[:dry_run] = true
39
+ end
40
+
36
41
  opts.on('-h', '--help', 'Show this help message') do
37
42
  puts opts
38
43
  exit
@@ -58,6 +63,16 @@ module Jeeves
58
63
  # Get AI-generated commit message
59
64
  commit_message = generate_commit_message(diff)
60
65
 
66
+ # If dry-run mode, just output the message and exit
67
+ if @options[:dry_run]
68
+ puts "\nDry-run mode: Commit message would be:"
69
+ puts "============================================"
70
+ puts commit_message
71
+ puts "============================================"
72
+ puts "No commit was created (dry-run mode)"
73
+ return
74
+ end
75
+
61
76
  # Write commit message to temp file for git to use
62
77
  temp_file = File.join(Dir.tmpdir, 'jeeves_commit_message')
63
78
  File.write(temp_file, commit_message)
@@ -121,6 +136,7 @@ module Jeeves
121
136
  end
122
137
 
123
138
  model = ENV['GIT_COMMIT_MODEL'] || 'x-ai/grok-code-fast-1'
139
+ puts "Using model: #{model}"
124
140
 
125
141
  prompt_file_path = get_prompt_file_path
126
142
  puts "Using prompt file: #{prompt_file_path}"
@@ -150,10 +166,15 @@ module Jeeves
150
166
  request_body = {
151
167
  model: model,
152
168
  messages: messages,
153
- max_tokens: 1000,
154
- stop: ["END_COMMIT"]
169
+ max_tokens: 1000
155
170
  }
156
171
 
172
+ # Only add stop parameter for models that support it
173
+ # xAI models don't support the stop parameter
174
+ unless model.include?('x-ai/')
175
+ request_body[:stop] = ["END_COMMIT"]
176
+ end
177
+
157
178
  # Remove any reasoning parameters that cause API errors
158
179
  # GPT-5 mini will put reasoning in the reasoning field regardless
159
180
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jeeves-git-commit
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.0
4
+ version: 2.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Bishop