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>
124
124
OCO_EMOJI=<add GitMoji>
125
125
OCO_MODEL=<either gpt-3.5-turbo or gpt-4>
@@ -128,9 +128,9 @@ OCO_LANGUAGE=<locale, scroll to the bottom to see options>
128
128
129
129
### Global config for all repos
130
130
131
-
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.
131
+
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
132
133
-
Simply run any of the variable above like this:
133
+
Simply set any of the variables above like this:
134
134
135
135
```sh
136
136
oco config set OCO_OPENAI_API_KEY=gpt-4
@@ -142,23 +142,23 @@ Configure [GitMoji](https://gitmoji.dev/) to preface a message.
142
142
oco config set OCO_EMOJI=true
143
143
```
144
144
145
-
To remove preface emoji:
145
+
To remove preface emojis:
146
146
147
147
```sh
148
148
oco config set OCO_EMOJI=false
149
149
```
150
150
151
151
### Switch to GPT-4
152
152
153
-
By default OpenCommit uses GPT-3.5-turbo (ChatGPT).
153
+
By default, OpenCommit uses GPT-3.5-turbo (ChatGPT).
154
154
155
155
You may switch to GPT-4 which performs better, but costs ~x15 times more 🤠
156
156
157
157
```sh
158
158
oco config set OCO_MODEL=gpt-4
159
159
```
160
160
161
-
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.
161
+
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.
162
162
163
163
## Locale configuration
164
164
@@ -176,7 +176,7 @@ oco config set OCO_LANGUAGE=French
176
176
oco config set OCO_LANGUAGE=française
177
177
```
178
178
179
-
The default language set is **English**
179
+
The default language setting is **English**
180
180
All available languages are currently listed in the [i18n](https://github.com/di-sukharev/opencommit/tree/master/src/i18n) folder
181
181
182
182
### Git flags
@@ -193,22 +193,22 @@ is translated to :
193
193
git commit -m "${generatedMessage}" --no-verify
194
194
```
195
195
196
-
### Ignore files
196
+
### Remove files
197
197
198
-
You can ignore files from submission to OpenAI by creating a `.opencommitignore` file. For example:
198
+
You can remove files from being sent to OpenAI by creating a `.opencommitignore` file. For example:
199
199
200
200
```ignorelang
201
201
path/to/large-asset.zip
202
202
**/*.jpg
203
203
```
204
204
205
-
This is useful for preventing opencommit from uploading artifacts and large files.
205
+
This helps prevent opencommit from uploading artifacts and large files.
206
206
207
207
By default, opencommit ignores files matching: `*-lock.*`and `*.lock`
208
208
209
209
## Git hook (KILLER FEATURE)
210
210
211
-
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.
211
+
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.
212
212
213
213
To set the hook:
214
214
@@ -233,4 +233,4 @@ Or follow the process of your IDE Source Control feature, when it calls `git com
233
233
234
234
## Payments
235
235
236
-
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.
236
+
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