opencommit 3.3.10 → 3.3.11
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.
- package/README.md +66 -3
- package/out/cli.cjs +32344 -26800
- package/package.json +18 -12
package/README.md
CHANGED
|
@@ -117,7 +117,7 @@ There are multiple optional flags that can be used with the `oco` command:
|
|
|
117
117
|
|
|
118
118
|
Link to the GitMoji specification: https://gitmoji.dev/
|
|
119
119
|
|
|
120
|
-
This flag
|
|
120
|
+
This flag enables GitMoji and allows users to use all emojis in the GitMoji specification. Without the flag, `OCO_EMOJI=true` uses a shorter set of 10 emojis (🐛✨📝🚀✅♻️⬆️🔧🌐💡) to limit the number of tokens sent in each request.
|
|
121
121
|
|
|
122
122
|
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.
|
|
123
123
|
|
|
@@ -141,14 +141,17 @@ Create a `.env` file and add OpenCommit config variables there like this:
|
|
|
141
141
|
|
|
142
142
|
```env
|
|
143
143
|
...
|
|
144
|
-
OCO_AI_PROVIDER=<openai (default), anthropic, azure, ollama, llamacpp, gemini, flowise, deepseek, aimlapi>
|
|
144
|
+
OCO_AI_PROVIDER=<openai (default), anthropic, azure, ollama, llamacpp, gemini, flowise, deepseek, aimlapi, openrouter, orcarouter>
|
|
145
145
|
OCO_API_KEY=<your OpenAI API token> // or other LLM provider API token
|
|
146
146
|
OCO_API_URL=<may be used to set proxy path to OpenAI api>
|
|
147
147
|
OCO_API_CUSTOM_HEADERS=<JSON string of custom HTTP headers to include in API requests>
|
|
148
148
|
OCO_TOKENS_MAX_INPUT=<max model token limit (default: 4096)>
|
|
149
149
|
OCO_TOKENS_MAX_OUTPUT=<max response tokens (default: 500)>
|
|
150
|
+
OCO_REASONING=<override reasoning-model auto-detection with true or false; omitted by default>
|
|
151
|
+
OCO_REASONING_MAX_TOKENS=<max completion token budget for reasoning models, including hidden reasoning tokens (default: 1000)>
|
|
150
152
|
OCO_DESCRIPTION=<postface a message with ~3 sentences description of the changes>
|
|
151
153
|
OCO_EMOJI=<boolean, add GitMoji>
|
|
154
|
+
OCO_EMOJI_POSITION_BEFORE_DESCRIPTION=<boolean, place GitMoji immediately before the commit subject; default: false>
|
|
152
155
|
OCO_MODEL=<either 'gpt-4o-mini' (default), 'gpt-4o', 'gpt-4', 'gpt-4-turbo', 'gpt-3.5-turbo', 'gpt-3.5-turbo-0125', 'gpt-4-1106-preview', 'gpt-4-turbo-preview' or 'gpt-4-0125-preview' or any Anthropic or Ollama model or any string basically, but it should be a valid model name>
|
|
153
156
|
OCO_LANGUAGE=<locale, scroll to the bottom to see options>
|
|
154
157
|
OCO_MESSAGE_TEMPLATE_PLACEHOLDER=<message template placeholder, default: '$msg'>
|
|
@@ -192,6 +195,25 @@ To remove preface emojis:
|
|
|
192
195
|
oco config set OCO_EMOJI=false
|
|
193
196
|
```
|
|
194
197
|
|
|
198
|
+
By default, GitMoji appears at the start of the commit header:
|
|
199
|
+
|
|
200
|
+
```text
|
|
201
|
+
🐛 (server.ts): handle an unavailable port
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
To place GitMoji immediately before the subject, after the Conventional Commit
|
|
205
|
+
type and optional scope:
|
|
206
|
+
|
|
207
|
+
```sh
|
|
208
|
+
oco config set OCO_EMOJI_POSITION_BEFORE_DESCRIPTION=true
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
```text
|
|
212
|
+
fix(server.ts): 🐛 handle an unavailable port
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
This setting only affects commits generated with `OCO_EMOJI=true` or `--fgm`.
|
|
216
|
+
|
|
195
217
|
Other config options are behaving the same.
|
|
196
218
|
|
|
197
219
|
### Output WHY the changes were done (WIP)
|
|
@@ -258,6 +280,20 @@ oco config set OCO_AI_PROVIDER=ollama OCO_API_KEY=<your_ollama_api_key> OCO_API_
|
|
|
258
280
|
oco config set OCO_AI_PROVIDER=llamacpp OCO_API_URL=<your_llamacpp_endpoint>
|
|
259
281
|
```
|
|
260
282
|
|
|
283
|
+
### Use OrcaRouter as the model gateway
|
|
284
|
+
|
|
285
|
+
By default OpenCommit uses [OpenAI](https://openai.com).
|
|
286
|
+
|
|
287
|
+
You could switch to [OrcaRouter](https://www.orcarouter.ai), an OpenAI-compatible gateway that supports direct provider models and automatic model routing. It can also provide optional gateway-level guardrails and firewall policies for prompts, responses, and tool calls. Enabling and configuring those controls is a separate step on the OrcaRouter side: the recommended `balanced` posture is primarily audit-based, while `tight` applies default-deny enforcement. OpenCommit itself does not configure them — it simply calls the gateway like any OpenAI-compatible API.
|
|
288
|
+
|
|
289
|
+
```sh
|
|
290
|
+
oco config set OCO_AI_PROVIDER=orcarouter OCO_API_KEY=<your_orcarouter_api_key>
|
|
291
|
+
|
|
292
|
+
oco config set OCO_AI_PROVIDER=orcarouter OCO_API_KEY=<your_orcarouter_api_key> OCO_MODEL=orcarouter/auto
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
The default model is `orcarouter/auto`, which lets OrcaRouter pick the best model for your request automatically.
|
|
296
|
+
|
|
261
297
|
### Use with Proxy
|
|
262
298
|
|
|
263
299
|
If you are behind a proxy, you can set it in the config:
|
|
@@ -402,13 +438,39 @@ Once users have generated their desired commit message, they can proceed to comm
|
|
|
402
438
|
|
|
403
439
|
### Ignore files
|
|
404
440
|
|
|
405
|
-
You can remove files from being sent to OpenAI by creating
|
|
441
|
+
You can remove files from being sent to OpenAI by creating ignore files. OpenCommit supports both local and global ignore files:
|
|
442
|
+
|
|
443
|
+
#### Local ignore file
|
|
444
|
+
|
|
445
|
+
Create a `.opencommitignore` file in your project root:
|
|
406
446
|
|
|
407
447
|
```ignorelang
|
|
408
448
|
path/to/large-asset.zip
|
|
409
449
|
**/*.jpg
|
|
450
|
+
docs/generated/
|
|
451
|
+
*.generated.ts
|
|
410
452
|
```
|
|
411
453
|
|
|
454
|
+
#### Global ignore file
|
|
455
|
+
|
|
456
|
+
Create a global `.opencommitignore` file in your home directory (`~/.opencommitignore`) to ignore files across all projects:
|
|
457
|
+
|
|
458
|
+
```ignorelang
|
|
459
|
+
*.log
|
|
460
|
+
*.tmp
|
|
461
|
+
.DS_Store
|
|
462
|
+
node_modules/
|
|
463
|
+
.env
|
|
464
|
+
.env.local
|
|
465
|
+
dist/
|
|
466
|
+
build/
|
|
467
|
+
coverage/
|
|
468
|
+
.vscode/
|
|
469
|
+
.idea/
|
|
470
|
+
```
|
|
471
|
+
|
|
472
|
+
**Priority:** Local ignore rules are applied after global rules. Both files use [gitignore syntax](https://git-scm.com/docs/gitignore#_pattern_format).
|
|
473
|
+
|
|
412
474
|
This helps prevent opencommit from uploading artifacts and large files.
|
|
413
475
|
|
|
414
476
|
By default, opencommit ignores files matching: `*-lock.*` and `*.lock`
|
|
@@ -485,6 +547,7 @@ jobs:
|
|
|
485
547
|
OCO_OPENAI_BASE_PATH: ''
|
|
486
548
|
OCO_DESCRIPTION: false
|
|
487
549
|
OCO_EMOJI: false
|
|
550
|
+
OCO_EMOJI_POSITION_BEFORE_DESCRIPTION: false
|
|
488
551
|
OCO_MODEL: gpt-4o
|
|
489
552
|
OCO_LANGUAGE: en
|
|
490
553
|
OCO_PROMPT_MODULE: conventional-commit
|