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 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.
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.
20
20
21
-
## Setup OpenCommit as a Github Action 🔥
21
+
## Setup OpenCommit as a GitHub Action 🔥
22
22
23
23
OpenCommit is now available as a GitHub Action which automatically improves all new commits messages when you push to remote!
24
24
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`.
25
+
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
26
27
-
Create a file `.github/workflows/opencommit.yml` with contents below:
27
+
Create a file `.github/workflows/opencommit.yml` with the contents below:
28
28
29
29
```yml
30
30
name: 'OpenCommit Action'
@@ -68,31 +68,31 @@ jobs:
68
68
OCO_LANGUAGE: en
69
69
```
70
70
71
-
That is it. Now when you push to any branch in your repo — all NEW commits are being improved by never-tired-AI.
71
+
That is it. Now when you push to any branch in your repo — all NEW commits are being improved by your never-tiredAI.
72
72
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.
73
+
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
74
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.
75
+
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.
76
76
77
-
## Setup OpenCommit as a CLI
77
+
## Setup OpenCommit as a CLI tool
78
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.
79
+
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.
80
80
81
81
1. Install OpenCommit globally to use in any repository:
82
82
83
83
```sh
84
84
npm install -g opencommit
85
85
```
86
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.
87
+
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.
88
88
89
89
3. Set the key to OpenCommit config:
90
90
91
91
```sh
92
92
opencommit config set OCO_OPENAI_API_KEY=<your_api_key>
93
93
```
94
94
95
-
Your api key is stored locally in `~/.opencommit` config file.
95
+
Your API key is stored locally in the `~/.opencommit` config file.
96
96
97
97
## Usage
98
98
@@ -107,19 +107,19 @@ You can also use the `oco` shortcut:
107
107
108
108
```sh
109
109
git add <files...>
110
-
oc
110
+
oco
111
111
```
112
112
113
113
## Configuration
114
114
115
115
### Local per repo configuration
116
116
117
-
Create an `.env` file and add OpenCommit config variables there like this:
117
+
Create a `.env` file and add OpenCommit config variables there like this:
118
118
119
119
```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>
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>
123
123
OCO_DESCRIPTION=<postface a message with ~3 sentences description>
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.
132
+
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.
133
133
134
-
Simply run any of the variable above like this:
134
+
Simply set any of the variables above like this:
135
135
136
136
```sh
137
137
oco config set OCO_OPENAI_API_KEY=gpt-4
@@ -143,23 +143,23 @@ Configure [GitMoji](https://gitmoji.dev/) to preface a message.
143
143
oco config set OCO_EMOJI=true
144
144
```
145
145
146
-
To remove preface emoji:
146
+
To remove preface emojis:
147
147
148
148
```sh
149
149
oco config set OCO_EMOJI=false
150
150
```
151
151
152
152
### Switch to GPT-4
153
153
154
-
By default OpenCommit uses GPT-3.5-turbo (ChatGPT).
154
+
By default, OpenCommit uses GPT-3.5-turbo (ChatGPT).
155
155
156
156
You may switch to GPT-4 which performs better, but costs ~x15 times more 🤠
157
157
158
158
```sh
159
159
oco config set OCO_MODEL=gpt-4
160
160
```
161
161
162
-
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.
162
+
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.
163
163
164
164
## Locale configuration
165
165
@@ -177,7 +177,7 @@ oco config set OCO_LANGUAGE=French
177
177
oco config set OCO_LANGUAGE=française
178
178
```
179
179
180
-
The default language set is **English**
180
+
The default language setting is **English**
181
181
All available languages are currently listed in the [i18n](https://github.com/di-sukharev/opencommit/tree/master/src/i18n) folder
182
182
183
183
### Git flags
@@ -204,20 +204,20 @@ oco '$msg #205’
204
204
205
205
### Ignore files
206
206
207
-
You can ignore files from submission to OpenAI by creating a `.opencommitignore` file. For example:
207
+
You can remove files from being sent to OpenAI by creating a `.opencommitignore` file. For example:
208
208
209
209
```ignorelang
210
210
path/to/large-asset.zip
211
211
**/*.jpg
212
212
```
213
213
214
-
This is useful for preventing opencommit from uploading artifacts and large files.
214
+
This helps prevent opencommit from uploading artifacts and large files.
215
215
216
216
By default, opencommit ignores files matching: `*-lock.*`and `*.lock`
217
217
218
218
## Git hook (KILLER FEATURE)
219
219
220
-
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.
220
+
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.
221
221
222
222
To set the hook:
223
223
@@ -242,4 +242,4 @@ Or follow the process of your IDE Source Control feature, when it calls `git com
242
242
243
243
## Payments
244
244
245
-
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.
245
+
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