git-aicommit 4.0.0 → 4.0.1

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.
Files changed (3) hide show
  1. package/README.md +19 -15
  2. package/autocommit.js +1 -1
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -8,8 +8,10 @@ Tired of writing commit messages? Let the computer do it for you!
8
8
 
9
9
  ## Installation
10
10
 
11
+ It's recommended to use [bun](https://bun.sh/)
12
+
11
13
  ```bash
12
- npm install -g git-aicommit
14
+ bun install -g git-aicommit
13
15
  ```
14
16
 
15
17
  ## Configuration
@@ -34,28 +36,30 @@ touch $HOME/.git-aicommitrc
34
36
 
35
37
  ```js
36
38
  // $HOME/.git-aicommitrc
37
- module.exports = {
39
+ export default {
38
40
  openAiKey: process.env.OPENAI_API_KEY,
39
41
  addAllChangesBeforeCommit: true,
40
42
  autocommit: true,
41
43
  openCommitTextEditor: false,
42
- promptBeforeDiff: 'Read the following git diff for a multiple files:',
43
- promptAfterDiff: 'Generate 1 to 3 paragraphs to explain this diff to a human without mentioning changes themselves:',
44
+ language: 'english',
45
+ systemMessagePromptTemplate: '' +
46
+ 'You are expert AI, your job is to write clear and concise Git commit messages.' +
47
+ 'Your responsibility is to ensure that these messages accurately describe the changes made in each commit,' +
48
+ 'follow established guidelines. Provide a clear history of changes to the codebase.' +
49
+ 'Write 1-2 sentences. Output only the commit message without comments or other text.',
50
+ humanPromptTemplate: '' +
51
+ 'Read the following git diff for a multiple files and ' +
52
+ 'write 1-2 sentences commit message in {language}' +
53
+ 'without mentioning lines or files:\n' +
54
+ '{diff}',
44
55
  excludeFromDiff: [
45
- '*.lock'
56
+ '*.lock', '*.lockb'
46
57
  ],
47
58
  diffFilter: 'ACMRTUXB',
48
59
  completionPromptParams: {
49
- model: "text-davinci-002",
50
- max_tokens: 500,
51
- temperature: 0.2,
52
- top_p: 1,
53
- presence_penalty: 0,
54
- frequency_penalty: 0,
55
- best_of: 1,
56
- n: 1,
57
- stream: false,
58
- stop: ["\n\n\n"],
60
+ model: "gpt-3.5-turbo",
61
+ temperature: 0.0,
62
+ maxTokens: 1000,
59
63
  }
60
64
  }
61
65
  ```
package/autocommit.js CHANGED
@@ -50,7 +50,7 @@ if (!diff) {
50
50
 
51
51
  const openai = new ChatOpenAI({
52
52
  modelName: config.modelName,
53
- apiKey: config.openAiKey,
53
+ openAIApiKey: config.openAiKey,
54
54
  temperature: config.temperature,
55
55
  maxTokens: config.maxTokens,
56
56
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "git-aicommit",
3
- "version": "4.0.0",
3
+ "version": "4.0.1",
4
4
  "description": "Generates auto commit messages with OpenAI GPT3 model",
5
5
  "main": "autocommit.js",
6
6
  "repository": "https://github.com/shanginn/autocommit",