You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
All the commits in this repo are authored by OpenCommit — look at [the commits](https://github.com/di-sukharev/opencommit/commit/eae7618d575ee8d2e9fff5de56da79d40c4bc5fc) to see how OpenCommit works. Emojis and long commit descriptions are configurable.
19
+
All the commits in this repo are authored by OpenCommit — look at [the commits](https://github.com/di-sukharev/opencommit/commit/eae7618d575ee8d2e9fff5de56da79d40c4bc5fc) to see how OpenCommit works. Emojis and long commit descriptions are configurable, basically everything is.
20
20
21
21
## Setup OpenCommit as a CLI tool
22
22
@@ -58,6 +58,8 @@ git add <files...>
58
58
oco
59
59
```
60
60
61
+
Running `git add` is optional, `oco` will do it for you.
62
+
61
63
### Running locally with Ollama
62
64
63
65
You can also run it with local model through ollama:
@@ -68,20 +70,21 @@ You can also run it with local model through ollama:
68
70
69
71
```sh
70
72
git add <files...>
71
-
OCO_AI_PROVIDER='ollama' opencommit
73
+
oco config setOCO_AI_PROVIDER='ollama'
72
74
```
73
75
74
-
If you want to use a model other than mistral, you can do so by setting the `OCO_AI_PROVIDER` environment variable as follows:
76
+
If you want to use a model other than mistral (default), you can do so by setting the `OCO_AI_PROVIDER` environment variable as follows:
75
77
76
78
```sh
77
-
OCO_AI_PROVIDER='ollama/llama3:8b' opencommit
79
+
oco config setOCO_AI_PROVIDER='ollama/llama3:8b'
78
80
```
79
81
80
-
if you have ollama that is set up in docker/ on another machine with GPUs (not locally), you can change the default endpoint url.
82
+
If you have ollama that is set up in docker/ on another machine with GPUs (not locally), you can change the default endpoint url.
83
+
81
84
You can do so by setting the `OCO_OLLAMA_API_URL` environment variable as follows:
where 192.168.1.10 is example of endpoint URL, where you have ollama set up.
@@ -95,6 +98,7 @@ There are multiple optional flags that can be used with the `oco` command:
95
98
Link to the GitMoji specification: https://gitmoji.dev/
96
99
97
100
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 (🐛✨📝🚀✅♻️⬆️🔧🌐💡).
101
+
98
102
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.
99
103
100
104
```
@@ -116,28 +120,32 @@ oco --yes
116
120
Create a `.env` file and add OpenCommit config variables there like this:
117
121
118
122
```env
123
+
...
119
124
OCO_OPENAI_API_KEY=<your OpenAI API token>
120
125
OCO_TOKENS_MAX_INPUT=<max model token limit (default: 4096)>
OCO_MODEL=<either 'gpt-4o', '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' or any string basically, but it should be a valid model name>
126
131
OCO_LANGUAGE=<locale, scroll to the bottom to see options>
OCO_PROMPT_MODULE=<either conventional-commit or @commitlint, default: conventional-commit>
129
134
OCO_ONE_LINE_COMMIT=<one line commit message, default: false>
130
-
OCO_AI_PROVIDER=<anthropic, azure, ollama or ollama/model default ollama model: mistral>
135
+
OCO_AI_PROVIDER=<openai (default), anthropic, azure, ollama or ollama/model>
136
+
...
131
137
```
132
138
139
+
This are not all the config options, but you get the point.
140
+
133
141
### Global config for all repos
134
142
135
143
Local config still has more priority than Global config, but you may set `OCO_MODEL` and `OCO_LOCALE` globally and set local configs for `OCO_EMOJI` and `OCO_DESCRIPTION` per repo which is more convenient.
136
144
137
145
Simply set any of the variables above like this:
138
146
139
147
```sh
140
-
oco config set OCO_MODEL=gpt-4o
148
+
oco config set OCO_MODEL=gpt-4o-mini
141
149
```
142
150
143
151
Configure [GitMoji](https://gitmoji.dev/) to preface a message.
@@ -152,20 +160,22 @@ To remove preface emojis:
152
160
oco config set OCO_EMOJI=false
153
161
```
154
162
163
+
Other config options are behaving the same.
164
+
155
165
### Switch to GPT-4 or other models
156
166
157
-
By default, OpenCommit uses `gpt-4o` model.
167
+
By default, OpenCommit uses `gpt-4o-mini` model.
158
168
159
-
You may switch to GPT-4 which performs better, but costs~x15 times more 🤠
169
+
You may switch to gpt-4o which performs better, but costs more 🤠
160
170
161
171
```sh
162
-
oco config set OCO_MODEL=gpt-4
172
+
oco config set OCO_MODEL=gpt-4o
163
173
```
164
174
165
175
or for as a cheaper option:
166
176
167
177
```sh
168
-
oco config set OCO_MODEL=gpt-4o-mini
178
+
oco config set OCO_MODEL=gpt-3.5-turbo
169
179
```
170
180
171
181
### Switch to Azure OpenAI
@@ -178,7 +188,7 @@ You could switch to [Azure OpenAI Service](https://learn.microsoft.com/azure/cog
178
188
opencommit config set OCO_AI_PROVIDER=azure
179
189
```
180
190
181
-
Of course need to set 'OPENAI_API_KEY'. And also need to set the
191
+
Of course need to set 'OCO_OPENAI_API_KEY'. And also need to set the
182
192
'OPENAI_BASE_PATH' for the endpoint and set the deployment name to
183
193
'model'.
184
194
@@ -201,9 +211,9 @@ oco config set OCO_LANGUAGE=française
201
211
The default language setting is **English**
202
212
All available languages are currently listed in the [i18n](https://github.com/di-sukharev/opencommit/tree/master/src/i18n) folder
203
213
204
-
### Push to git
214
+
### Push to git (gonna be deprecated)
205
215
206
-
Pushing to git is on by default but if you would like to turn it off just use:
216
+
A prompt to ushing to git is on by default but if you would like to turn it off just use:
207
217
208
218
```sh
209
219
oco config set OCO_GITPUSH=false
@@ -291,7 +301,7 @@ In our codebase, the implementation of this feature can be found in the followin
291
301
292
302
```javascript
293
303
commitMessage = messageTemplate.replace(
294
-
config?.OCO_MESSAGE_TEMPLATE_PLACEHOLDER,
304
+
config.OCO_MESSAGE_TEMPLATE_PLACEHOLDER,
295
305
commitMessage
296
306
);
297
307
```
@@ -348,7 +358,7 @@ Or follow the process of your IDE Source Control feature, when it calls `git com
348
358
349
359
OpenCommit is now available as a GitHub Action which automatically improves all new commits messages when you push to remote!
350
360
351
-
This is great if you want to make sure all of the commits in all of your repository branches are meaningful and not lame like `fix1` or `done2`.
361
+
This is great if you want to make sure all commits in all of your repository branches are meaningful and not lame like `fix1` or `done2`.
352
362
353
363
Create a file `.github/workflows/opencommit.yml` with the contents below:
0 commit comments