git-gpt 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c0685c10e66a36290fd0eae99a4cd6d89ba6dd8ab630f8a562617be4af31cdd4
4
- data.tar.gz: 35d25ec93cd1eee111a8a60b8ba1dc81f2accd58704185819850c29b0b3920bb
3
+ metadata.gz: 848d9c6a4ae6f3e034ad83ef04d112dc43172eaa29f13697b5ab677f0d31ab90
4
+ data.tar.gz: cfded1c59cfba5df552360d5f37632727a111b57b80a3c3a14bca594af265827
5
5
  SHA512:
6
- metadata.gz: 128b5a721cd62d858a7e85e80367a4790d114fa6b955739e5ec489cd377ca198e142fdaae2b11f440ce4da94384ed7fa5d1e4ada8c6f3ff5483497ec2b61ad9f
7
- data.tar.gz: c57883e32bbcf67804d84d268cc9d3cb5d0828774d62ee3163836fd559d75efa24d90c6bc5d9d26453fe1642f22997a04284f67bd495e16f71314f4f46483b82
6
+ metadata.gz: 21f728913149d02780f1a63177695b05b7b15cd47f595c1af1652dfa0f04cea1b209a71605b99405cc5f1ca5be6d8f7ad56e5a9a80a55f075b3fbe279dedf755
7
+ data.tar.gz: 273d32a80efb211c9e0be1a53c630e7a8b06efa0413771be434ce9bdb4e05e920d01d7813d0e1801b475acf0301f7ccdd46a687189e929d5af82daab0a8243a0
data/README.md CHANGED
@@ -1,43 +1,71 @@
1
1
  # Git::Gpt
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/git/gpt`. To experiment with that code, run `bin/console` for an interactive prompt.
4
-
5
- TODO: Delete this and the text above, and describe your gem
3
+ git-gpt is a ruby gem that adds an additional git subcommand, git gpt. It assists you in creating commit messages for your git changes. It uses the powerful capabilities of ChatGPT to generate commit messages based on the current git status and git diff. Additionally, you can specify a list of files to narrow down the context for the commit message.
6
4
 
7
5
  ## Installation
8
6
 
9
- Add this line to your application's Gemfile:
7
+ First, you need to install the gem. You can do this globally or in your specific Ruby environment.
10
8
 
11
- ```ruby
12
- gem 'git-gpt'
9
+ ```sh
10
+ gem install git-gpt
13
11
  ```
14
12
 
15
- And then execute:
13
+ Once installed, it will be accessible as a git subcommand.
16
14
 
17
- $ bundle install
15
+ ## Usage
18
16
 
19
- Or install it yourself as:
17
+ You can invoke the `git gpt` command in your terminal anywhere in your git repository:
20
18
 
21
- $ gem install git-gpt
22
19
 
23
- ## Usage
20
+ ```sh
21
+ git gpt
22
+ ```
24
23
 
25
- TODO: Write usage instructions here
24
+ This will return a commit message generated by ChatGPT based on the changes detected by `git status` and `git diff`.
26
25
 
27
- ## Development
26
+ If you wish to narrow down the context to a specific list of files, you can do so by passing them as arguments:
28
27
 
29
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
28
+ ```sh
29
+ git gpt file1 file2 file3
30
+ ```
30
31
 
31
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
+ In the above example, `file1`, `file2`, and `file3` are placeholders for the file names you want to focus on. This will generate a commit message based on the changes in those files only.
32
33
 
33
- ## Contributing
34
+ ## Basic Configuration
34
35
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/git-gpt. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/git-gpt/blob/main/CODE_OF_CONDUCT.md).
36
+ Best practice is to set the `OPENAI_API_KEY` environment veriable. Optionally, you can set `OPENAI_ORGANIZATION_ID`.
36
37
 
37
- ## License
38
+ ## Advanced Configuration
39
+
40
+ By default `git gpt` uses `gpt-3.5-turbo` with a temperature of `0.7`. You can find the default prompt [here](https://github.com/assaydepot/git-gpt/blob/main/lib/git/gpt.rb#L12-L26). If you'd like to change the default settings, you can add a `.git-gpt-config.yml` file in your git repository. `git-gpt` will look for that file in the current directory, any parent directory (all the way to `/`) and your `HOME` directory. It will look in that order and use the first one it finds. The structure of the YAML file is as follows, all keys are optional.
41
+
42
+ ```yaml
43
+ model: gpt-4
44
+ temperature: 0.8
45
+ openai_api_key: sk-acb1234567890xyz
46
+ openai_organization_id: org-abc1234567890xyz
47
+ prompt: >
48
+ You are a software engineer working on a project. You write diligent and detailed commit messages. You are working on a new feature and you are ready to commit your changes.
38
49
 
39
- The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
50
+ The current git status is:
51
+ \```
52
+ $GIT_STATUS
53
+ \```
40
54
 
41
- ## Code of Conduct
55
+ The current git diff is:
56
+ \```
57
+ $GIT_DIFF
58
+ \```
59
+
60
+ Please write a commit message for this change. Format the commit message using markdown. You may use bullet points. Please comment specifically on any files with significant changes.
61
+ ```
62
+
63
+ See a real example [here](https://github.com/assaydepot/git-gpt/blob/main/.git-gpt-config.yml).
64
+
65
+ ## Contributing
66
+
67
+ Bug reports and pull requests are welcome on GitHub at https://github.com/your-github-username/git-gpt. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.
68
+
69
+ ## License
42
70
 
43
- Everyone interacting in the Git::Gpt project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/git-gpt/blob/main/CODE_OF_CONDUCT.md).
71
+ The gem is available as open source under the terms of the MIT License.
data/git-gpt.gemspec CHANGED
@@ -8,8 +8,8 @@ Gem::Specification.new do |spec|
8
8
  spec.authors = ["Chris Petersen"]
9
9
  spec.email = ["chris@petersen.io"]
10
10
 
11
- spec.summary = "Use GPT-4 to generate commit messages"
12
- spec.description = "Use GPT-4 to generate commit messages"
11
+ spec.summary = "Use ChatGPT to write your commit messages"
12
+ spec.description = "Use ChatGPT to write your commit messages"
13
13
  spec.homepage = "https://github.com/assaydepot/git-gpt"
14
14
  spec.license = "MIT"
15
15
  spec.required_ruby_version = ">= 2.6.0"
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Git
4
4
  module Gpt
5
- VERSION = "0.0.1"
5
+ VERSION = "0.0.2"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git-gpt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Petersen
@@ -24,7 +24,7 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '4.0'
27
- description: Use GPT-4 to generate commit messages
27
+ description: Use ChatGPT to write your commit messages
28
28
  email:
29
29
  - chris@petersen.io
30
30
  executables:
@@ -71,5 +71,5 @@ requirements: []
71
71
  rubygems_version: 3.3.7
72
72
  signing_key:
73
73
  specification_version: 4
74
- summary: Use GPT-4 to generate commit messages
74
+ summary: Use ChatGPT to write your commit messages
75
75
  test_files: []