@sachinthapa572/lazycommit 1.0.1 → 1.1.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 (2) hide show
  1. package/README.md +97 -0
  2. package/package.json +46 -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
 
@@ -356,6 +400,34 @@ You can clear this option by setting it to an empty string:
356
400
  lazycommit config set type=
357
401
  ```
358
402
 
403
+ #### guidance-prompt
404
+
405
+ Default: `""` (Empty string)
406
+
407
+ Optional advisory style guidance for commit message generation.
408
+
409
+ This value helps steer style preferences (for example: wording nuances, subsystem keywords, or verbosity), but it is treated as **soft guidance only**.
410
+
411
+ Safety behavior and precedence:
412
+
413
+ - It does **not** override core commit constraints.
414
+ - Messages must remain grounded in staged diff context.
415
+ - Conflicting, invalid-format, or irrelevant guidance is ignored.
416
+ - Max length: `1000` characters.
417
+ - Whitespace-only values are normalized to empty (feature off).
418
+
419
+ Example:
420
+
421
+ ```sh
422
+ lazycommit config set guidance-prompt="Prefer concise verbs and include subsystem keywords when relevant"
423
+ ```
424
+
425
+ To clear it:
426
+
427
+ ```sh
428
+ lazycommit config set guidance-prompt=
429
+ ```
430
+
359
431
  #### signup-message
360
432
 
361
433
  Default: `""` (Empty string)
@@ -375,6 +447,30 @@ Example:
375
447
  lazycommit config set signup-message="Sachin Thapa <contactsachin572@gmail.com>"
376
448
  ```
377
449
 
450
+ #### history-enabled
451
+
452
+ Default: `false`
453
+
454
+ Whether to include recent commit history in the AI prompt for generating commit messages that match your project's style.
455
+
456
+ ```sh
457
+ lazycommit config set history-enabled=true
458
+ ```
459
+
460
+ Including history helps the AI understand your project's commit message conventions and style, leading to more consistent suggestions.
461
+
462
+ #### history-count
463
+
464
+ Default: `3`
465
+
466
+ The number of recent commit messages to include when `history-enabled` is true. Valid range: `2` to `10`.
467
+
468
+ ```sh
469
+ lazycommit config set history-count=5
470
+ ```
471
+
472
+ This setting only takes effect when history is enabled.
473
+
378
474
  ## How it works
379
475
 
380
476
  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 +545,7 @@ If you get a 413 error, your diff is too large for the API. Try these solutions:
449
545
  ## Maintainers
450
546
 
451
547
  - **Sachin Thapa**: [@sachinthapa572](https://github.com/sachinthapa572)
548
+ - **Kshitiz Sharma (imxitiz)**: [@imxitiz](https://github.com/imxitiz)
452
549
 
453
550
  ## License
454
551
 
package/package.json CHANGED
@@ -1,48 +1,48 @@
1
1
  {
2
- "name": "@sachinthapa572/lazycommit",
3
- "version": "1.0.1",
4
- "description": "Writes your git commit messages for you with AI providers",
5
- "main": "index.js",
6
- "keywords": [
7
- "git",
8
- "commit",
9
- "ai",
10
- "groq",
11
- "github",
12
- "cli"
13
- ],
14
- "author": "Sachin Thapa",
15
- "license": "Apache-2.0",
16
- "repository": "sachinthapa572/lazycommit",
17
- "type": "module",
18
- "publishConfig": {
19
- "access": "public"
20
- },
21
- "files": [
22
- "dist"
23
- ],
24
- "bin": {
25
- "lazycommit": "./dist/cli.mjs",
26
- "lzc": "./dist/cli.mjs"
27
- },
28
- "dependencies": {
29
- "@clack/prompts": "^0.11.0",
30
- "@github/copilot-sdk": "^0.2.0",
31
- "@types/ini": "^4.1.1",
32
- "@types/inquirer": "^9.0.9",
33
- "@types/node": "^24.5.1",
34
- "@typescript/native-preview": "^7.0.0-dev.20260326.1",
35
- "clean-pkg-json": "^1.3.0",
36
- "cleye": "^1.3.4",
37
- "execa": "^9.6.0",
38
- "fs-fixture": "^2.8.1",
39
- "groq-sdk": "^0.32.0",
40
- "https-proxy-agent": "^7.0.6",
41
- "ini": "^5.0.0",
42
- "kolorist": "^1.8.0",
43
- "manten": "^1.5.0",
44
- "pkgroll": "^2.15.4",
45
- "tsx": "^4.20.5",
46
- "typescript": "^5.9.2"
47
- }
2
+ "name": "@sachinthapa572/lazycommit",
3
+ "version": "1.1.0",
4
+ "description": "Writes your git commit messages for you with AI providers",
5
+ "main": "index.js",
6
+ "keywords": [
7
+ "git",
8
+ "commit",
9
+ "ai",
10
+ "groq",
11
+ "github",
12
+ "cli"
13
+ ],
14
+ "author": "Sachin Thapa",
15
+ "license": "Apache-2.0",
16
+ "repository": "sachinthapa572/lazycommit",
17
+ "type": "module",
18
+ "publishConfig": {
19
+ "access": "public"
20
+ },
21
+ "files": [
22
+ "dist"
23
+ ],
24
+ "bin": {
25
+ "lazycommit": "./dist/cli.mjs",
26
+ "lzc": "./dist/cli.mjs"
27
+ },
28
+ "dependencies": {
29
+ "@clack/prompts": "^0.11.0",
30
+ "@github/copilot-sdk": "^0.2.0",
31
+ "@types/ini": "^4.1.1",
32
+ "@types/inquirer": "^9.0.9",
33
+ "@types/node": "^24.5.1",
34
+ "@typescript/native-preview": "^7.0.0-dev.20260326.1",
35
+ "clean-pkg-json": "^1.3.0",
36
+ "cleye": "^1.3.4",
37
+ "execa": "^9.6.0",
38
+ "fs-fixture": "^2.8.1",
39
+ "groq-sdk": "^0.32.0",
40
+ "https-proxy-agent": "^7.0.6",
41
+ "ini": "^5.0.0",
42
+ "kolorist": "^1.8.0",
43
+ "manten": "^1.5.0",
44
+ "pkgroll": "^2.15.4",
45
+ "tsx": "^4.20.5",
46
+ "typescript": "^5.9.2"
47
+ }
48
48
  }