opencommit 3.0.15 → 3.0.17

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.
Files changed (3) hide show
  1. package/README.md +43 -11
  2. package/out/cli.cjs +7221 -1289
  3. package/package.json +9 -3
package/README.md CHANGED
@@ -58,7 +58,7 @@ git add <files...>
58
58
  oco
59
59
  ```
60
60
 
61
- Link to the GitMoji specification: https://gitmoji.dev/
61
+ ### Running locally with Ollama
62
62
 
63
63
  You can also run it with local model through ollama:
64
64
 
@@ -71,12 +71,29 @@ git add <files...>
71
71
  OCO_AI_PROVIDER='ollama' opencommit
72
72
  ```
73
73
 
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:
75
+
76
+ ```sh
77
+ OCO_AI_PROVIDER='ollama/llama3:8b' opencommit
78
+ ```
79
+
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.
81
+ You can do so by setting the `OCO_OLLAMA_API_URL` environment variable as follows:
82
+
83
+ ```sh
84
+ OCO_OLLAMA_API_URL='http://192.168.1.10:11434/api/chat' opencommit
85
+ ```
86
+
87
+ where 192.168.1.10 is example of endpoint URL, where you have ollama set up.
88
+
74
89
  ### Flags
75
90
 
76
91
  There are multiple optional flags that can be used with the `oco` command:
77
92
 
78
93
  #### Use Full GitMoji Specification
79
94
 
95
+ Link to the GitMoji specification: https://gitmoji.dev/
96
+
80
97
  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 (🐛✨📝🚀✅♻️⬆️🔧🌐💡).
81
98
  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.
82
99
 
@@ -84,6 +101,14 @@ This is due to limit the number of tokens sent in each request. However, if you
84
101
  oco --fgm
85
102
  ```
86
103
 
104
+ #### Skip Commit Confirmation
105
+
106
+ This flag allows users to automatically commit the changes without having to manually confirm the commit message. This is useful for users who want to streamline the commit process and avoid additional steps. To use this flag, you can run the following command:
107
+
108
+ ```
109
+ oco --yes
110
+ ```
111
+
87
112
  ## Configuration
88
113
 
89
114
  ### Local per repo configuration
@@ -97,11 +122,12 @@ OCO_TOKENS_MAX_OUTPUT=<max response tokens (default: 500)>
97
122
  OCO_OPENAI_BASE_PATH=<may be used to set proxy path to OpenAI api>
98
123
  OCO_DESCRIPTION=<postface a message with ~3 sentences description of the changes>
99
124
  OCO_EMOJI=<boolean, add GitMoji>
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'>
125
+ 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'>
101
126
  OCO_LANGUAGE=<locale, scroll to the bottom to see options>
102
127
  OCO_MESSAGE_TEMPLATE_PLACEHOLDER=<message template placeholder, default: '$msg'>
103
128
  OCO_PROMPT_MODULE=<either conventional-commit or @commitlint, default: conventional-commit>
104
129
  OCO_ONE_LINE_COMMIT=<one line commit message, default: false>
130
+ OCO_AI_PROVIDER=<anthropic, azure, ollama or ollama/model default ollama model: mistral>
105
131
  ```
106
132
 
107
133
  ### Global config for all repos
@@ -111,7 +137,7 @@ Local config still has more priority than Global config, but you may set `OCO_MO
111
137
  Simply set any of the variables above like this:
112
138
 
113
139
  ```sh
114
- oco config set OCO_MODEL=gpt-4
140
+ oco config set OCO_MODEL=gpt-4o
115
141
  ```
116
142
 
117
143
  Configure [GitMoji](https://gitmoji.dev/) to preface a message.
@@ -128,7 +154,7 @@ oco config set OCO_EMOJI=false
128
154
 
129
155
  ### Switch to GPT-4 or other models
130
156
 
131
- By default, OpenCommit uses `gpt-3.5-turbo` model.
157
+ By default, OpenCommit uses `gpt-4o` model.
132
158
 
133
159
  You may switch to GPT-4 which performs better, but costs ~x15 times more 🤠
134
160
 
@@ -139,16 +165,22 @@ oco config set OCO_MODEL=gpt-4
139
165
  or for as a cheaper option:
140
166
 
141
167
  ```sh
142
- oco config set OCO_MODEL=gpt-3.5-turbo
168
+ oco config set OCO_MODEL=gpt-4o-mini
143
169
  ```
144
170
 
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:
171
+ ### Switch to Azure OpenAI
172
+
173
+ By default OpenCommit uses [OpenAI](https://openai.com).
174
+
175
+ You could switch to [Azure OpenAI Service](https://learn.microsoft.com/azure/cognitive-services/openai/)🚀
146
176
 
147
177
  ```sh
148
- oco config set OCO_MODEL=gpt-4-0125-preview
178
+ opencommit config set OCO_AI_PROVIDER=azure
149
179
  ```
150
180
 
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.
181
+ Of course need to set 'OPENAI_API_KEY'. And also need to set the
182
+ 'OPENAI_BASE_PATH' for the endpoint and set the deployment name to
183
+ 'model'.
152
184
 
153
185
  ### Locale configuration
154
186
 
@@ -174,7 +206,7 @@ All available languages are currently listed in the [i18n](https://github.com/di
174
206
  Pushing to git is on by default but if you would like to turn it off just use:
175
207
 
176
208
  ```sh
177
- oc config set OCO_GITPUSH=false
209
+ oco config set OCO_GITPUSH=false
178
210
  ```
179
211
 
180
212
  ### Switch to `@commitlint`
@@ -191,7 +223,7 @@ Replace `<module>` with either `conventional-commit` or `@commitlint`.
191
223
 
192
224
  #### Example:
193
225
 
194
- To switch to using th` '@commitlint` prompt module, run:
226
+ To switch to using the `'@commitlint` prompt module, run:
195
227
 
196
228
  ```sh
197
229
  oco config set OCO_PROMPT_MODULE=@commitlint
@@ -359,7 +391,7 @@ jobs:
359
391
  OCO_OPENAI_BASE_PATH: ''
360
392
  OCO_DESCRIPTION: false
361
393
  OCO_EMOJI: false
362
- OCO_MODEL: gpt-3.5-turbo
394
+ OCO_MODEL: gpt-4o
363
395
  OCO_LANGUAGE: en
364
396
  OCO_PROMPT_MODULE: conventional-commit
365
397
  ```