opencommit 3.0.11 β 3.0.15
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.
- package/README.md +19 -8
- package/out/cli.cjs +19843 -6690
- package/out/tiktoken_bg.wasm +0 -0
- package/package.json +13 -2
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<h1 align="center">OpenCommit</h1>
|
|
5
5
|
<h4 align="center">Follow the bird <a href="https://twitter.com/_sukharev_"><img src="https://img.shields.io/twitter/follow/_sukharev_?style=flat&label=_sukharev_&logo=twitter&color=0bf&logoColor=fff" align="center"></a>
|
|
6
6
|
</div>
|
|
7
|
-
<h2>Auto-generate meaningful commits in
|
|
7
|
+
<h2>Auto-generate meaningful commits in a second</h2>
|
|
8
8
|
<p>Killing lame commits with AI π€―π«</p>
|
|
9
9
|
<a href="https://www.npmjs.com/package/opencommit"><img src="https://img.shields.io/npm/v/opencommit" alt="Current version"></a>
|
|
10
10
|
<h4 align="center">πͺ© Winner of <a href="https://twitter.com/_sukharev_/status/1683448136973582336">GitHub 2023 hackathon</a> πͺ©</h4>
|
|
@@ -68,20 +68,22 @@ You can also run it with local model through ollama:
|
|
|
68
68
|
|
|
69
69
|
```sh
|
|
70
70
|
git add <files...>
|
|
71
|
-
|
|
71
|
+
OCO_AI_PROVIDER='ollama' opencommit
|
|
72
72
|
```
|
|
73
73
|
|
|
74
74
|
### Flags
|
|
75
|
+
|
|
75
76
|
There are multiple optional flags that can be used with the `oco` command:
|
|
76
77
|
|
|
77
78
|
#### Use Full GitMoji Specification
|
|
79
|
+
|
|
78
80
|
This flag can only be used if the `OCO_EMOJI` configuration item is set to `true`. This flag allows users to use all emojis in the GitMoji specification, By default, the GitMoji full specification is set to `false`, which only includes 10 emojis (πβ¨ππβ
β»οΈβ¬οΈπ§ππ‘).
|
|
79
81
|
This is due to limit the number of tokens sent in each request. However, if you would like to use the full GitMoji specification, you can use the `--fgm` flag.
|
|
80
82
|
|
|
81
83
|
```
|
|
82
84
|
oco --fgm
|
|
83
85
|
```
|
|
84
|
-
|
|
86
|
+
|
|
85
87
|
## Configuration
|
|
86
88
|
|
|
87
89
|
### Local per repo configuration
|
|
@@ -95,10 +97,11 @@ OCO_TOKENS_MAX_OUTPUT=<max response tokens (default: 500)>
|
|
|
95
97
|
OCO_OPENAI_BASE_PATH=<may be used to set proxy path to OpenAI api>
|
|
96
98
|
OCO_DESCRIPTION=<postface a message with ~3 sentences description of the changes>
|
|
97
99
|
OCO_EMOJI=<boolean, add GitMoji>
|
|
98
|
-
OCO_MODEL=<either 'gpt-4', 'gpt-3.5-turbo
|
|
100
|
+
OCO_MODEL=<either 'gpt-4', 'gpt-4-turbo', 'gpt-3.5-turbo' (default), 'gpt-3.5-turbo-0125', 'gpt-4-1106-preview', 'gpt-4-turbo-preview' or 'gpt-4-0125-preview'>
|
|
99
101
|
OCO_LANGUAGE=<locale, scroll to the bottom to see options>
|
|
100
102
|
OCO_MESSAGE_TEMPLATE_PLACEHOLDER=<message template placeholder, default: '$msg'>
|
|
101
103
|
OCO_PROMPT_MODULE=<either conventional-commit or @commitlint, default: conventional-commit>
|
|
104
|
+
OCO_ONE_LINE_COMMIT=<one line commit message, default: false>
|
|
102
105
|
```
|
|
103
106
|
|
|
104
107
|
### Global config for all repos
|
|
@@ -125,7 +128,7 @@ oco config set OCO_EMOJI=false
|
|
|
125
128
|
|
|
126
129
|
### Switch to GPT-4 or other models
|
|
127
130
|
|
|
128
|
-
By default, OpenCommit uses `gpt-3.5-turbo
|
|
131
|
+
By default, OpenCommit uses `gpt-3.5-turbo` model.
|
|
129
132
|
|
|
130
133
|
You may switch to GPT-4 which performs better, but costs ~x15 times more π€
|
|
131
134
|
|
|
@@ -142,7 +145,7 @@ oco config set OCO_MODEL=gpt-3.5-turbo
|
|
|
142
145
|
or for GPT-4 Turbo (Preview) which is more capable, has knowledge of world events up to April 2023, a 128k context window and 2-3x cheaper vs GPT-4:
|
|
143
146
|
|
|
144
147
|
```sh
|
|
145
|
-
oco config set OCO_MODEL=gpt-4-
|
|
148
|
+
oco config set OCO_MODEL=gpt-4-0125-preview
|
|
146
149
|
```
|
|
147
150
|
|
|
148
151
|
Make sure that you spell it `gpt-4` (lowercase) and that you have API access to the 4th model. Even if you have ChatGPT+, that doesn't necessarily mean that you have API access to GPT-4.
|
|
@@ -166,6 +169,14 @@ oco config set OCO_LANGUAGE=franΓ§aise
|
|
|
166
169
|
The default language setting is **English**
|
|
167
170
|
All available languages are currently listed in the [i18n](https://github.com/di-sukharev/opencommit/tree/master/src/i18n) folder
|
|
168
171
|
|
|
172
|
+
### Push to git
|
|
173
|
+
|
|
174
|
+
Pushing to git is on by default but if you would like to turn it off just use:
|
|
175
|
+
|
|
176
|
+
```sh
|
|
177
|
+
oc config set OCO_GITPUSH=false
|
|
178
|
+
```
|
|
179
|
+
|
|
169
180
|
### Switch to `@commitlint`
|
|
170
181
|
|
|
171
182
|
OpenCommit allows you to choose the prompt module used to generate commit messages. By default, OpenCommit uses its conventional-commit message generator. However, you can switch to using the `@commitlint` prompt module if you prefer. This option lets you generate commit messages in respect with the local config.
|
|
@@ -348,7 +359,7 @@ jobs:
|
|
|
348
359
|
OCO_OPENAI_BASE_PATH: ''
|
|
349
360
|
OCO_DESCRIPTION: false
|
|
350
361
|
OCO_EMOJI: false
|
|
351
|
-
OCO_MODEL: gpt-3.5-turbo
|
|
362
|
+
OCO_MODEL: gpt-3.5-turbo
|
|
352
363
|
OCO_LANGUAGE: en
|
|
353
364
|
OCO_PROMPT_MODULE: conventional-commit
|
|
354
365
|
```
|
|
@@ -365,6 +376,6 @@ You pay for your requests to OpenAI API on your own.
|
|
|
365
376
|
|
|
366
377
|
OpenCommit stores your key locally.
|
|
367
378
|
|
|
368
|
-
OpenCommit by default uses 3.5-turbo
|
|
379
|
+
OpenCommit by default uses 3.5-turbo model, it should not exceed $0.10 per casual working day.
|
|
369
380
|
|
|
370
381
|
You may switch to gpt-4, it's better, but more expensive.
|