@sachinthapa572/lazycommit 1.0.1 → 1.2.0

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 +109 -0
  2. package/dist/cli.mjs +2081 -69
  3. package/package.json +58 -46
package/README.md CHANGED
@@ -109,6 +109,47 @@ You can exclude specific files from AI analysis using the `--exclude` flag:
109
109
  lazycommit --exclude package-lock.json --exclude dist/
110
110
  ```
111
111
 
112
+ #### Include commit history for style consistency
113
+
114
+ You can include recent commit history in the AI prompt to generate messages that match your project's commit style:
115
+
116
+ ```sh
117
+ lazycommit --history
118
+ ```
119
+
120
+ This includes recent commit messages as context, helping the AI match your project's style and conventions. You can customize how many commits to include:
121
+
122
+ ```sh
123
+ lazycommit --history --history-count 5
124
+ ```
125
+
126
+ You can also disable history if it's enabled in your config:
127
+
128
+ ```sh
129
+ lazycommit --no-history
130
+ ```
131
+
132
+ #### One-time guidance override (single run)
133
+
134
+ You can pass one-time advisory guidance with `--guidance-prompt`:
135
+
136
+ ```sh
137
+ lazycommit --guidance-prompt "Prefer concise verbs and mention auth subsystem"
138
+ ```
139
+
140
+ Behavior:
141
+
142
+ - Applies only to the current run.
143
+ - Overrides `guidance-prompt` from config for that run.
144
+ - Passing an empty value clears guidance for that run.
145
+ - Does not persist unless you set it through `lazycommit config set`.
146
+
147
+ Safety behavior:
148
+
149
+ - Guidance is advisory only (style preference).
150
+ - Output must still follow commit format, be diff-grounded, and remain relevant.
151
+ - Prompt hijacking attempts or unrelated instructions are ignored.
152
+
112
153
  #### Handling large diffs
113
154
 
114
155
  For large commits with many files, lazycommit automatically stays within API limits and generates relevant commit messages:
@@ -182,6 +223,9 @@ This opens a step-by-step setup flow for:
182
223
  - max-length
183
224
  - type
184
225
  - signup-message
226
+ - history-enabled
227
+ - history-count
228
+ - guidance-prompt
185
229
 
186
230
  At the end, lazycommit saves your config and prints the updated values.
187
231
 
@@ -251,6 +295,12 @@ Required
251
295
 
252
296
  The Groq API key. You can retrieve it from [Groq Console](https://console.groq.com/keys).
253
297
 
298
+ #### CEREBRAS_API_KEY
299
+
300
+ Required when `provider=cerebras`
301
+
302
+ The Cerebras API key. You can retrieve it from [Cerebras Platform](https://cloud.cerebras.ai).
303
+
254
304
  #### provider
255
305
 
256
306
  Default: `groq`
@@ -260,6 +310,7 @@ Provider used to generate commit messages.
260
310
  Supported values:
261
311
 
262
312
  - `groq`
313
+ - `cerebras`
263
314
  - `github`
264
315
 
265
316
  Examples:
@@ -267,6 +318,7 @@ Examples:
267
318
  ```sh
268
319
  lazycommit config set provider=github
269
320
  lazycommit config set provider=groq
321
+ lazycommit config set provider=cerebras
270
322
  ```
271
323
 
272
324
  When switching providers, lazycommit automatically resets `model` to that provider's default if the current model is incompatible.
@@ -309,6 +361,9 @@ Available models by provider:
309
361
  - `moonshotai/kimi-k2-instruct`
310
362
  - `groq/compound`
311
363
  - `groq/compound-mini`
364
+ - `cerebras`:
365
+ - `qwen-3-235b-a22b-instruct-2507` (default)
366
+ - `llama3.1-8b`
312
367
  - `github`:
313
368
  - `gpt-5-mini` (default)
314
369
  - `gpt-5.4-mini`
@@ -318,6 +373,7 @@ Example:
318
373
 
319
374
  ```sh
320
375
  lazycommit config set provider=github model=gpt-5.4-mini
376
+ lazycommit config set CEREBRAS_API_KEY=<your-api-key> provider=cerebras model=qwen-3-235b-a22b-instruct-2507
321
377
  ```
322
378
 
323
379
  #### timeout
@@ -356,6 +412,34 @@ You can clear this option by setting it to an empty string:
356
412
  lazycommit config set type=
357
413
  ```
358
414
 
415
+ #### guidance-prompt
416
+
417
+ Default: `""` (Empty string)
418
+
419
+ Optional advisory style guidance for commit message generation.
420
+
421
+ This value helps steer style preferences (for example: wording nuances, subsystem keywords, or verbosity), but it is treated as **soft guidance only**.
422
+
423
+ Safety behavior and precedence:
424
+
425
+ - It does **not** override core commit constraints.
426
+ - Messages must remain grounded in staged diff context.
427
+ - Conflicting, invalid-format, or irrelevant guidance is ignored.
428
+ - Max length: `1000` characters.
429
+ - Whitespace-only values are normalized to empty (feature off).
430
+
431
+ Example:
432
+
433
+ ```sh
434
+ lazycommit config set guidance-prompt="Prefer concise verbs and include subsystem keywords when relevant"
435
+ ```
436
+
437
+ To clear it:
438
+
439
+ ```sh
440
+ lazycommit config set guidance-prompt=
441
+ ```
442
+
359
443
  #### signup-message
360
444
 
361
445
  Default: `""` (Empty string)
@@ -375,6 +459,30 @@ Example:
375
459
  lazycommit config set signup-message="Sachin Thapa <contactsachin572@gmail.com>"
376
460
  ```
377
461
 
462
+ #### history-enabled
463
+
464
+ Default: `false`
465
+
466
+ Whether to include recent commit history in the AI prompt for generating commit messages that match your project's style.
467
+
468
+ ```sh
469
+ lazycommit config set history-enabled=true
470
+ ```
471
+
472
+ Including history helps the AI understand your project's commit message conventions and style, leading to more consistent suggestions.
473
+
474
+ #### history-count
475
+
476
+ Default: `3`
477
+
478
+ The number of recent commit messages to include when `history-enabled` is true. Valid range: `2` to `10`.
479
+
480
+ ```sh
481
+ lazycommit config set history-count=5
482
+ ```
483
+
484
+ This setting only takes effect when history is enabled.
485
+
378
486
  ## How it works
379
487
 
380
488
  This CLI tool runs `git diff` to grab all your latest code changes, then sends them to the configured provider model and returns AI-generated commit messages.
@@ -449,6 +557,7 @@ If you get a 413 error, your diff is too large for the API. Try these solutions:
449
557
  ## Maintainers
450
558
 
451
559
  - **Sachin Thapa**: [@sachinthapa572](https://github.com/sachinthapa572)
560
+ - **Kshitiz Sharma (imxitiz)**: [@imxitiz](https://github.com/imxitiz)
452
561
 
453
562
  ## License
454
563