git-aicommit 2.0.1 → 2.0.2

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 +8 -22
  2. package/config.js +1 -1
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -12,40 +12,26 @@ Tired of writing commit messages? Let the computer do it for you!
12
12
  npm install -g git-aicommit
13
13
  ```
14
14
 
15
- ## Usage
16
-
17
- For now this cli tool uses env variables to pass params, because this is simple PoC.
18
- - `OPENAI_API_KEY` - your OpenAI API key (you can get one at [https://beta.openai.com/account/api-keys]())
19
- - `GIT_AI_AUTOCOMMIT` - If this env is present and not empty,
20
- the commit will be made automatically.
21
- Otherwise, you will just see the suggested commit.
22
-
23
- ```bash
24
- OPENAI_API_KEY=YOUR_OPEN_API_KEY GIT_AI_AUTOCOMMIT=1 git-aicommit
25
- ```
15
+ ## Configuration
26
16
 
27
- Or make an alias:
17
+ This cli tool uses configuration file located where `GIT_AI_COMMIT_CONFIG_NAME` points at,
18
+ defaults to `~/.git-ai-commit-config.js`.
28
19
 
29
- ```bash
30
- alias gai='OPENAI_API_KEY=YOUR_OPEN_API_KEY GIT_AI_AUTOCOMMIT=1 git-aicommit'
31
- ```
20
+ Or [default config](config.js) is used if no config file is found.
32
21
 
33
- Or export envs first:
22
+ ## Usage
34
23
 
35
24
  ```bash
36
- export OPENAI_API_KEY=YOUR_OPEN_API_KEY
37
- export GIT_AI_AUTOCOMMIT=1
25
+ export OPENAI_API_KEY=sk-YOUR_API_KEY
38
26
  git-aicommit
39
27
  ```
40
28
 
41
- Or even better: make an alias and export envs:
29
+ Or make an alias:
42
30
 
43
31
  ```bash
44
32
  alias gai='git-aicommit'
45
- export OPENAI_API_KEY=YOUR_OPEN_API_KEY
46
- export GIT_AI_AUTOCOMMIT=1
47
33
 
48
- # And run it:
34
+ ## And run it:
49
35
  gai
50
36
  ```
51
37
 
package/config.js CHANGED
@@ -4,7 +4,7 @@ module.exports = {
4
4
  autocommit: true,
5
5
  openCommitTextEditor: false,
6
6
  promptBeforeDiff: 'Read the following git diff for a multiple files:',
7
- promptAfterDiff: 'Generate 1 to 3 paragraphs to explain this diff to a human:',
7
+ promptAfterDiff: 'Generate 1 to 3 paragraphs to explain this diff to a human without mentioning changes themselves:',
8
8
  excludeFromDiff: [
9
9
  '*.lock'
10
10
  ],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "git-aicommit",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "description": "Generates auto commit messages with OpenAI GPT3 model",
5
5
  "main": "autocommit.js",
6
6
  "repository": "https://github.com/shanginn/autocommit",