jeeves-git-commit 1.9.0 → 2.0.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 +9 -5
- data/config/prompt +2 -1
- data/lib/jeeves/version.rb +1 -1
- data/lib/jeeves.rb +15 -1
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0a1a7767238f6e2e9c145da2abeca84fd27034afdf9b54c7a69d714e9107e3c1
|
4
|
+
data.tar.gz: 61798a06d9d3e026d3bc9abc7cc2313bfeb56343f92e00823f30ff9643132bf0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4d738930e7924e1f3cfc7281c8d84009b6823b15080c9a3493fb1cbecff47b6727da3b3bdb4046f488d12c123f34e147647d8facaf24e0f825decad0aa5cc12c
|
7
|
+
data.tar.gz: 728cd8648020b71b3f97a9d9635760173831fc1a78cdd983973702f9b67a759e49f951c6bc11699ffb0d75bf8c6573934e1457926e1d3a91614da5cea9f81226
|
data/README.md
CHANGED
@@ -109,14 +109,18 @@ The default model is `openai/gpt-4.1-mini` if not specified.
|
|
109
109
|
|
110
110
|
### Prompt Configuration
|
111
111
|
|
112
|
-
Jeeves supports two levels of prompt configuration:
|
112
|
+
Jeeves supports two levels of prompt configuration with the following priority order:
|
113
113
|
|
114
|
-
1. **
|
115
|
-
2. **
|
114
|
+
1. **Repository-Specific Prompt (Highest Priority)**: Create a `.jeeves_prompt` file in the root of your Git repository to customize the prompt for that specific project.
|
115
|
+
2. **Global Prompt (Fallback)**: Stored in `~/.config/jeeves/prompt`. This is used when no repository-specific prompt is found.
|
116
116
|
|
117
117
|
When you run Jeeves, it will:
|
118
|
-
1. First look for a `.jeeves_prompt` file in the root of the current Git repository
|
119
|
-
2. If not found
|
118
|
+
1. **First** look for a `.jeeves_prompt` file in the root of the current Git repository
|
119
|
+
2. **If not found**, fall back to the global prompt at `~/.config/jeeves/prompt`
|
120
|
+
|
121
|
+
This allows you to have a default prompt for all your projects while still being able to customize the prompt for specific repositories that may have different requirements or coding standards.
|
122
|
+
|
123
|
+
**Example Repository-Specific Prompt**: See `example.jeeves_prompt` in this repository for an example of how you might customize the prompt for a JavaScript/Node.js project with specific requirements.
|
120
124
|
|
121
125
|
When you run Jeeves for the first time, if there's no global prompt file in the config directory, it will copy `config/prompt` to the config directory automatically.
|
122
126
|
|
data/config/prompt
CHANGED
@@ -4,6 +4,7 @@ The commit message should:
|
|
4
4
|
- Start with an appropriate gitmoji based on the nature of the changes
|
5
5
|
- Follow the Conventional Commits format (https://www.conventionalcommits.org/en/v1.0.0/)
|
6
6
|
- Explain WHAT changed, WHY it changed, and HOW it improves or fixes the current state
|
7
|
+
- Use present tense ("add" not "added")
|
7
8
|
- Assume the audience is educated software engineers
|
8
9
|
|
9
10
|
Example format:
|
@@ -14,4 +15,4 @@ Detailed explanation of the changes, why they were necessary, and their impact.
|
|
14
15
|
Additional context or technical details when relevant.
|
15
16
|
|
16
17
|
DIFF:
|
17
|
-
{{DIFF}}
|
18
|
+
{{DIFF}}
|
data/lib/jeeves/version.rb
CHANGED
data/lib/jeeves.rb
CHANGED
@@ -77,6 +77,20 @@ module Jeeves
|
|
77
77
|
|
78
78
|
private
|
79
79
|
|
80
|
+
def git_root_dir
|
81
|
+
output = `git rev-parse --show-toplevel 2>/dev/null`.strip
|
82
|
+
output.empty? ? nil : output
|
83
|
+
end
|
84
|
+
|
85
|
+
def get_prompt_file_path
|
86
|
+
git_root = git_root_dir
|
87
|
+
if git_root
|
88
|
+
local_prompt = File.join(git_root, '.jeeves_prompt')
|
89
|
+
return local_prompt if File.exist?(local_prompt)
|
90
|
+
end
|
91
|
+
PROMPT_FILE
|
92
|
+
end
|
93
|
+
|
80
94
|
def setup_config_dir
|
81
95
|
unless Dir.exist?(CONFIG_DIR)
|
82
96
|
FileUtils.mkdir_p(CONFIG_DIR)
|
@@ -108,7 +122,7 @@ module Jeeves
|
|
108
122
|
|
109
123
|
model = ENV['GIT_COMMIT_MODEL'] || 'openai/gpt-4.1-mini'
|
110
124
|
|
111
|
-
prompt = File.read(
|
125
|
+
prompt = File.read(get_prompt_file_path).gsub('{{DIFF}}', diff)
|
112
126
|
|
113
127
|
uri = URI.parse('https://openrouter.ai/api/v1/chat/completions')
|
114
128
|
http = Net::HTTP.new(uri.host, uri.port)
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jeeves-git-commit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Bishop
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-05-
|
10
|
+
date: 2025-05-30 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: json
|
@@ -65,6 +65,20 @@ dependencies:
|
|
65
65
|
- - "~>"
|
66
66
|
- !ruby/object:Gem::Version
|
67
67
|
version: '3.0'
|
68
|
+
- !ruby/object:Gem::Dependency
|
69
|
+
name: mocha
|
70
|
+
requirement: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - "~>"
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '2.0'
|
75
|
+
type: :development
|
76
|
+
prerelease: false
|
77
|
+
version_requirements: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - "~>"
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: '2.0'
|
68
82
|
description: Jeeves is a command-line tool that helps you create AI-powered Git commit
|
69
83
|
messages
|
70
84
|
email:
|