jeeves-git-commit 1.9.0 → 2.1.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: 184fa0652a35d79f4dde5b5196c5fefbd63f1c75604fc46bed8d5c9c28bc4bdd
4
- data.tar.gz: b76f88a55227d9ad1b29d30496cfeb517b525119cd60095aa9cdce0f07ab0fa3
3
+ metadata.gz: 527ce9c1bf1bbb7a3d32de28211fd81a2c07dbeb1405457f026e438cbbf50a5f
4
+ data.tar.gz: 368cac10056082021363258f35d5cf49aafbfee5a803d2bb6cdea310efc06012
5
5
  SHA512:
6
- metadata.gz: 3749715826524d126c90e730582def14ac2381d5c0652c10006497b6f4e36356822b7ea148f28dea4de9206b4cf19933efe1141cc780ceda62fb5d7b83de02ef
7
- data.tar.gz: 47c087226cf452463707fa91b824f52e5431ca2c4db89104e7ebe4c9981d38e3cb851b269bf83ae4b068d0738325f2c28f4aee9730b9958e24a1641bc649ae03
6
+ metadata.gz: 5cec4382871ef998ea7c0344b3156dd775ab5453031e1950ed986cfd4e27540c7e53d56fa70004ee857b079fbfbf3acf578e07fa39b23eeaeee8e1bd35a374d6
7
+ data.tar.gz: 06f70672dfd85ec2a93c1f5cdfbfc0df89c4769504c66700bafad5e3f5a6c0d8d96a7d74d43f62b2356c8e4d6080076bf83a88707cfc2b025422821d33b89adb
data/README.md CHANGED
@@ -4,16 +4,31 @@
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 helps you create AI-powered Git commit messages. It streamlines your Git workflow by automatically generating meaningful commit messages based on your code changes.
7
+ Jeeves is a command-line tool that creates AI-powered Git commit messages that mercilessly roast you and your code.
8
8
 
9
9
  ## Features
10
10
 
11
- - Generate intelligent [conventional commit](https://www.conventionalcommits.org/en/v1.0.0/) messages with [gitmoji](https://gitmoji.dev) based on your staged changes.
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
12
  - Option to automatically stage all changes before committing
13
13
  - Option to push changes after committing
14
14
  - Customizable AI prompts for tailored commit message generation
15
15
  - Choose any AI model (chat-gpt 4.1-mini by default)
16
16
 
17
+ ## Example Commit message
18
+
19
+ ```
20
+ ✨ refactor(HTMLText): rewrite HTML parsing and rendering from scratch because why not torture future maintainers
21
+ Completely scrap the previously sane approach of leveraging NSAttributedString's native HTML importer—because parsing HTML by hand in SwiftUI is obviously a great idea—and replace it with a painfully verbose custom parser that handles only a handful of tags (`<b>`, `<i>`, `<u>`, `<strong>`, `<em>`) by rudimentary string manipulation and manual state tracking.
22
+
23
+ Add a fragile, regex-based preprocessing pipeline to replace paragraph and break tags with newlines, which predictably will fail on anything but the simplest input and blatantly ignores the complexity of HTML’s DOM and semantics. Implement a hopelessly naive tag parser and format stack that counts nested tags without any error recovery, inviting undefined behavior from malformed or unexpected inputs.
24
+
25
+ Replace cached AttributedString with a freshly built one on each render, ignoring performance consequences and the obvious benefits of reuse or incremental updates—because rendering performance doesn’t matter, right?
26
+
27
+ Throw in a sprawling debug preview showcasing trivial formatting examples like `"Bold text"`, `"<b>Bold <i>nested</i></b>"`, and some paragraph-handling tests to prove the gross oversimplification, all stacked in a monstrously long VStack with no regard for code readability or separation of concerns.
28
+
29
+ In summary: regress from standard, battle-tested Cocoa HTML rendering to a brittle, hand-rolled solution that’s both inefficient and incomplete. Future developers, good luck deciphering this spaghetti; you’ll need it.
30
+ ```
31
+
17
32
  ## Installation
18
33
 
19
34
  ### Requirements
@@ -109,14 +124,18 @@ The default model is `openai/gpt-4.1-mini` if not specified.
109
124
 
110
125
  ### Prompt Configuration
111
126
 
112
- Jeeves supports two levels of prompt configuration:
127
+ Jeeves supports two levels of prompt configuration with the following priority order:
113
128
 
114
- 1. **Global Prompt (Default)**: Stored in `~/.config/jeeves/prompt`. This is used for all repositories unless overridden.
115
- 2. **Repository-Specific Prompt**: Create a `.jeeves_prompt` file in the root of your Git repository to customize the prompt for that specific project.
129
+ 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.
130
+ 2. **Global Prompt (Fallback)**: Stored in `~/.config/jeeves/prompt`. This is used when no repository-specific prompt is found.
116
131
 
117
132
  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, fall back to the global prompt at `~/.config/jeeves/prompt`
133
+ 1. **First** look for a `.jeeves_prompt` file in the root of the current Git repository
134
+ 2. **If not found**, fall back to the global prompt at `~/.config/jeeves/prompt`
135
+
136
+ 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.
137
+
138
+ **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 (that also doesn't roast you).
120
139
 
121
140
  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
141
 
data/config/prompt CHANGED
@@ -3,7 +3,9 @@ Generate a git commit message based on the following diff.
3
3
  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
- - Explain WHAT changed, WHY it changed, and HOW it improves or fixes the current state
6
+ - Explain WHAT changed and WHY it changed
7
+ - Use present tense ("add" not "added")
8
+ - Be extremely critical and mercilessly roast the author of the change
7
9
  - Assume the audience is educated software engineers
8
10
 
9
11
  Example format:
@@ -14,4 +16,4 @@ Detailed explanation of the changes, why they were necessary, and their impact.
14
16
  Additional context or technical details when relevant.
15
17
 
16
18
  DIFF:
17
- {{DIFF}}
19
+ {{DIFF}}
@@ -1,3 +1,3 @@
1
1
  module Jeeves
2
- VERSION = '1.9.0'
2
+ VERSION = '2.1.0'
3
3
  end
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(PROMPT_FILE).gsub('{{DIFF}}', diff)
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: 1.9.0
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Bishop
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-05-23 00:00:00.000000000 Z
10
+ date: 2025-05-31 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: