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
Upgrade to 2.4.2 from upstream
🐛fix(api.ts, checkIsLatestVersion.ts): fix npm command to get the latest version of opencommit
Fixed the npm command to get the latest version of opencommit. Previously, it was using `npm view opencommit version`, but it has been updated to `npm view github:takuya-o/opencommit version` to specify the correct package name.
🐛修正(api.ts, checkIsLatestVersion.ts): opencommitの最新バージョンを取得するためのnpmコマンドを修正しました
opencommitの最新バージョンを取得するためのnpmコマンドを修正しました。以前は`npm view opencommit version`を使用していましたが、正しいパッケージ名を指定するために`npm view github:takuya-o/opencommit version`に変更しました。
⬆️ Update(package.json): Add script to upgrade packages using npm-check-updates and run npm update and npm dedup
To make it easier to upgrade packages and manage dependencies, a new script called "upgrade" has been added. This script uses npm-check-updates to upgrade packages to their latest versions, runs npm update to update dependencies, and runs npm dedup to remove duplicate packages.
⬆️ アップデート(package.json): npm-check-updatesを使用してパッケージをアップグレードし、npm updateとnpm dedupを実行するスクリプトを追加しました
パッケージのアップグレードと依存関係の整理を簡単にするために、新しいスクリプト"upgrade"を追加しました。このスクリプトは、npm-check-updatesを使用してパッケージを最新バージョンにアップグレードし、npm updateを実行して依存関係を更新し、npm dedupを実行して重複したパッケージを削除します。
Merge branch 'revert-async-prefix' into 'azure'
Revert "Merge remote-tracking branch 'amyu98/allowForCommitPrefix' into try-commit-prefix"
非同期化したprefix付加機能を巻き戻した
All the commits in this repo are done with OpenCommit — look into[the commits](https://github.com/di-sukharev/opencommit/commit/eae7618d575ee8d2e9fff5de56da79d40c4bc5fc) to see how OpenCommit works. Emoji and long commit description text is configurable.
20
+
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.
20
21
21
-
## Setup OpenCommit as a Github Action 🔥
22
+
## Setup OpenCommit as a CLI tool
23
+
24
+
You can use OpenCommit by simply running it via the CLI like this `oco`. 2 seconds and your staged changes are committed with a meaningful message.
25
+
26
+
1. Install OpenCommit globally to use in any repository:
27
+
28
+
```sh
29
+
npm install -g opencommit
30
+
```
31
+
32
+
2. Get your API key from [OpenAI](https://platform.openai.com/account/api-keys). Make sure that you add your payment details, so the API works.
33
+
34
+
3. Set the key to OpenCommit config:
35
+
36
+
```sh
37
+
opencommit config set OCO_OPENAI_API_KEY=<your_api_key>
38
+
```
39
+
40
+
Your API key is stored locally in the `~/.opencommit` config file.
41
+
42
+
## Setup OpenCommit as a GitHub Action 🔥
22
43
23
44
OpenCommit is now available as a GitHub Action which automatically improves all new commits messages when you push to remote!
24
45
25
-
This is great if you want to make sure all of the commits in all of repository branches are meaningful and not lame like `fix1` or `done2`.
46
+
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`.
26
47
27
-
Create a file `.github/workflows/opencommit.yml` with contents below:
48
+
Create a file `.github/workflows/opencommit.yml` with the contents below:
28
49
29
50
```yml
30
51
name: 'OpenCommit Action'
@@ -68,31 +89,11 @@ jobs:
68
89
OCO_LANGUAGE: en
69
90
```
70
91
71
-
That is it. Now when you push to any branch in your repo — all NEW commits are being improved by never-tired-AI.
92
+
That is it. Now when you push to any branch in your repo — all NEW commits are being improved by your never-tiredAI.
72
93
73
-
Make sure you exclude public collaboration branches (`main`, `dev`, `etc`) in `branches-ignore`, so OpenCommit does not rebase commits there when improving the messages.
94
+
Make sure you exclude public collaboration branches (`main`, `dev`, `etc`) in `branches-ignore`, so OpenCommit does not rebase commits there while improving the messages.
74
95
75
-
Interactive rebase (`rebase -i`) changes commit SHA, so commit history in remote becomes different with your local branch history. It's ok when you work on the branch alone, but may be inconvenient for other collaborators.
76
-
77
-
## Setup OpenCommit as a CLI
78
-
79
-
You can use OpenCommit by simply running it via CLI like this `oco`. 2 seconds and your staged changes are committed with a meaningful message.
80
-
81
-
1. Install OpenCommit globally to use in any repository:
82
-
83
-
```sh
84
-
npm install -g opencommit
85
-
```
86
-
87
-
2. Get your API key from [OpenAI](https://platform.openai.com/account/api-keys). Make sure you add payment details, so API works.
88
-
89
-
3. Set the key to OpenCommit config:
90
-
91
-
```sh
92
-
opencommit config set OCO_OPENAI_API_KEY=<your_api_key>
93
-
```
94
-
95
-
Your api key is stored locally in `~/.opencommit` config file.
96
+
Interactive rebase (`rebase -i`) changes commits' SHA, so the commit history in remote becomes different from your local branch history. This is okay if you work on the branch alone, but may be inconvenient for other collaborators.
96
97
97
98
## Usage
98
99
@@ -107,30 +108,31 @@ You can also use the `oco` shortcut:
107
108
108
109
```sh
109
110
git add <files...>
110
-
oc
111
+
oco
111
112
```
112
113
113
114
## Configuration
114
115
115
116
### Local per repo configuration
116
117
117
-
Create an `.env` file and add OpenCommit config variables there like this:
118
+
Create a `.env` file and add OpenCommit config variables there like this:
118
119
119
120
```env
120
-
OCO_OPENAI_API_KEY=<your openAI API token>
121
-
OCO_OPENAI_MAX_TOKENS=<max response tokens from openAI API>
122
-
OCO_OPENAI_BASE_PATH=<may be used to set proxy path to openAI api>
121
+
OCO_OPENAI_API_KEY=<your OpenAI API token>
122
+
OCO_OPENAI_MAX_TOKENS=<max response tokens from OpenAI API>
123
+
OCO_OPENAI_BASE_PATH=<may be used to set proxy path to OpenAI api>
123
124
OCO_DESCRIPTION=<postface a message with ~3 sentences description>
124
125
OCO_EMOJI=<add GitMoji>
125
126
OCO_MODEL=<either gpt-3.5-turbo or gpt-4>
126
127
OCO_LANGUAGE=<locale, scroll to the bottom to see options>
Local config still has more priority as 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.
133
+
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.
132
134
133
-
Simply run any of the variable above like this:
135
+
Simply set any of the variables above like this:
134
136
135
137
```sh
136
138
oco config set OCO_OPENAI_API_KEY=gpt-4
@@ -142,7 +144,7 @@ Configure [GitMoji](https://gitmoji.dev/) to preface a message.
142
144
oco config set OCO_EMOJI=true
143
145
```
144
146
145
-
To remove preface emoji:
147
+
To remove preface emojis:
146
148
147
149
```sh
148
150
oco config set OCO_EMOJI=false
@@ -162,17 +164,23 @@ Of course need to set 'OCO_OPENAI_API_KEY'. And also need to set the
162
164
'OCO_OPENAI_BASE_PATH'for the endpoint and set the deployment name to
163
165
'model'.
164
166
165
-
### Switch to GPT-4
167
+
### Switch to GPT-4 or other models
166
168
167
-
By default OpenCommit uses GPT-3.5-turbo (ChatGPT).
169
+
By default, OpenCommit uses `gpt-3.5-turbo-16k` model.
168
170
169
171
You may switch to GPT-4 which performs better, but costs ~x15 times more 🤠
170
172
171
173
```sh
172
174
oco config set OCO_MODEL=gpt-4
173
175
```
174
176
175
-
Make sure you do lowercase `gpt-4` and you have API access to the 4th model. Even if you have ChatGPT+ it doesn't necessarily mean that you have API access to GPT-4.
177
+
or for as a cheaper option:
178
+
179
+
```sh
180
+
oco config set OCO_MODEL=gpt-3.5-turbo
181
+
```
182
+
183
+
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.
176
184
177
185
## Locale configuration
178
186
@@ -190,7 +198,7 @@ oco config set OCO_LANGUAGE=French
190
198
oco config set OCO_LANGUAGE=française
191
199
```
192
200
193
-
The default language set is **English**
201
+
The default language setting is **English**
194
202
All available languages are currently listed in the [i18n](https://github.com/di-sukharev/opencommit/tree/master/src/i18n) folder
195
203
196
204
### Push to git
@@ -214,22 +222,30 @@ is translated to :
214
222
git commit -m "${generatedMessage}" --no-verify
215
223
```
216
224
225
+
To include a message in the generated message, you can utilize the template function! For instance:
226
+
227
+
```sh
228
+
oco '$msg #205’
229
+
```
230
+
231
+
> opencommit examines placeholders in the parameters, allowing you to append additional information before and after the placeholders, such as the relevant Issue or Pull Request. Similarly, you have the option to customize the OCO_MESSAGE_TEMPLATE_PLACEHOLDER configuration item, for example, simplifying it to $m!"
232
+
217
233
### Ignore files
218
234
219
-
You can ignore files from submission to OpenAI by creating a `.opencommitignore` file. For example:
235
+
You can remove files from being sent to OpenAI by creating a `.opencommitignore` file. For example:
220
236
221
237
```ignorelang
222
238
path/to/large-asset.zip
223
239
**/*.jpg
224
240
```
225
241
226
-
This is useful for preventing opencommit from uploading artifacts and large files.
242
+
This helps prevent opencommit from uploading artifacts and large files.
227
243
228
244
By default, opencommit ignores files matching: `*-lock.*`and `*.lock`
229
245
230
246
## Git hook (KILLER FEATURE)
231
247
232
-
You can set OpenCommit as Git [`prepare-commit-msg`](https://git-scm.com/docs/githooks#_prepare_commit_msg) hook. Hook integrates with you IDE Source Control and allows you edit the message before commit.
248
+
You can set OpenCommit as Git [`prepare-commit-msg`](https://git-scm.com/docs/githooks#_prepare_commit_msg) hook. Hook integrates with your IDE Source Control and allows you to edit the message before committing.
233
249
234
250
To set the hook:
235
251
@@ -254,4 +270,4 @@ Or follow the process of your IDE Source Control feature, when it calls `git com
254
270
255
271
## Payments
256
272
257
-
You pay for your own requests to OpenAI API. OpenCommit uses ChatGPT (3.5-turbo) official model, that is ~15x times cheaper than GPT-4.
273
+
You pay for your requests to OpenAI API. OpenCommit uses ChatGPT (3.5-turbo) official model, which is ~15x times cheaper than GPT-4.
0 commit comments