@sachinthapa572/lazycommit 1.0.0 → 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 +128 -64
  2. package/package.json +47 -48
package/README.md CHANGED
@@ -5,65 +5,28 @@
5
5
 
6
6
  </div>
7
7
  <p>A CLI that writes your git commit messages for you with AI providers. Never write a commit message again.</p>
8
- <a href="https://www.npmjs.com/package/lazycommitz"><img src="https://img.shields.io/npm/v/lazycommitt" alt="Current version"></a>
9
- <a href="https://github.com/KartikLabhshetwar/lazycommit"><img src="https://img.shields.io/github/stars/KartikLabhshetwar/lazycommit" alt="GitHub stars"></a>
10
- <a href="https://github.com/KartikLabhshetwar/lazycommit/blob/main/LICENSE"><img src="https://img.shields.io/npm/l/lazycommitt" alt="License"></a>
8
+
11
9
  </div>
12
10
 
13
11
  ---
14
12
 
15
- <div align="center">
16
- <a href="https://peerlist.io/code_kartik/project/lazycommit" ><img width="400" height="128" alt="LazyCommit" src="https://github.com/user-attachments/assets/5d54d238-38f4-44f2-b253-3959b2487987" /></a>
17
- </div>
18
-
19
13
  ## Setup
20
14
 
21
15
  > The minimum supported version of Node.js is v18. Check your Node.js version with `node --version`.
22
16
 
23
- 1. Install _lazycommit_:
17
+ ### Prerequisites
24
18
 
25
- ```sh
26
- npm install -g lazycommitt
27
- ```
19
+ - Git installed and available in your PATH
20
+ - Node.js `>=18`
28
21
 
29
- ### Install via Homebrew (macOS)
22
+ ### Install
30
23
 
31
- Install via Homebrew tap:
24
+ Install _lazycommit_ globally:
32
25
 
33
26
  ```sh
34
- brew tap KartikLabhshetwar/lazycommit https://github.com/KartikLabhshetwar/lazycommit
35
- brew install lazycommit
27
+ npm install -g @sachinthapa572/lazycommit
36
28
  ```
37
29
 
38
- Upgrade:
39
-
40
- ```sh
41
- brew update
42
- brew upgrade lazycommit
43
- ```
44
-
45
- 2. Choose your provider:
46
- - **Groq** (default): retrieve your API key from [Groq Console](https://console.groq.com/keys)
47
- - **GitHub Copilot**: install and login to Copilot CLI:
48
-
49
- ```sh
50
- copilot auth login
51
- ```
52
-
53
- 3. Configure lazycommit:
54
-
55
- ```sh
56
- lazycommit config
57
- ```
58
-
59
- For Groq, you can also set the key directly:
60
-
61
- ```sh
62
- lazycommit config set GROQ_API_KEY=<your token>
63
- ```
64
-
65
- This creates a `.lazycommit` file in your home directory.
66
-
67
30
  ### Upgrading
68
31
 
69
32
  Check the installed version with:
@@ -72,10 +35,10 @@ Check the installed version with:
72
35
  lazycommit --version
73
36
  ```
74
37
 
75
- If it's not the [latest version](https://github.com/KartikLabhshetwar/lazycommit/releases/latest), run:
38
+ If it's not the [latest version](https://github.com/sachinthapa572/lazycommit/releases/latest), run:
76
39
 
77
40
  ```sh
78
- npm update -g lazycommitt
41
+ npm update -g @sachinthapa572/lazycommit
79
42
  ```
80
43
 
81
44
  ## Usage
@@ -89,7 +52,7 @@ git add <files...>
89
52
  lazycommit
90
53
  ```
91
54
 
92
- `lazycommit` passes down unknown flags to `git commit`, so you can pass in [`commit` flags](https://git-scm.com/docs/git-commit).
55
+ `lazycommit` passes unknown flags to `git commit`, so you can pass [`commit` flags](https://git-scm.com/docs/git-commit).
93
56
 
94
57
  For example, you can stage all changes in tracked files as you commit:
95
58
 
@@ -146,6 +109,47 @@ You can exclude specific files from AI analysis using the `--exclude` flag:
146
109
  lazycommit --exclude package-lock.json --exclude dist/
147
110
  ```
148
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
+
149
153
  #### Handling large diffs
150
154
 
151
155
  For large commits with many files, lazycommit automatically stays within API limits and generates relevant commit messages:
@@ -201,6 +205,12 @@ Run:
201
205
  lazycommit config
202
206
  ```
203
207
 
208
+ You can also run the explicit setup mode:
209
+
210
+ ```sh
211
+ lazycommit config setup
212
+ ```
213
+
204
214
  This opens a step-by-step setup flow for:
205
215
 
206
216
  - provider
@@ -213,6 +223,9 @@ This opens a step-by-step setup flow for:
213
223
  - max-length
214
224
  - type
215
225
  - signup-message
226
+ - history-enabled
227
+ - history-count
228
+ - guidance-prompt
216
229
 
217
230
  At the end, lazycommit saves your config and prints the updated values.
218
231
 
@@ -274,6 +287,8 @@ lazycommit config set GROQ_API_KEY=<your-api-key> generate=3 locale=en
274
287
 
275
288
  ### Options
276
289
 
290
+ > Note: `generate` supports values from `1` to `5`.
291
+
277
292
  #### GROQ_API_KEY
278
293
 
279
294
  Required
@@ -341,6 +356,7 @@ Available models by provider:
341
356
  - `github`:
342
357
  - `gpt-5-mini` (default)
343
358
  - `gpt-5.4-mini`
359
+ - `gpt-4o-mini-2024-07-18`
344
360
 
345
361
  Example:
346
362
 
@@ -350,7 +366,7 @@ lazycommit config set provider=github model=gpt-5.4-mini
350
366
 
351
367
  #### timeout
352
368
 
353
- The timeout for network requests to the Groq API in milliseconds.
369
+ The timeout for provider requests in milliseconds.
354
370
 
355
371
  Default: `1000` (1 second)
356
372
 
@@ -384,6 +400,34 @@ You can clear this option by setting it to an empty string:
384
400
  lazycommit config set type=
385
401
  ```
386
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
+
387
431
  #### signup-message
388
432
 
389
433
  Default: `""` (Empty string)
@@ -403,6 +447,30 @@ Example:
403
447
  lazycommit config set signup-message="Sachin Thapa <contactsachin572@gmail.com>"
404
448
  ```
405
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
+
406
474
  ## How it works
407
475
 
408
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.
@@ -410,9 +478,9 @@ This CLI tool runs `git diff` to grab all your latest code changes, then sends t
410
478
  Provider behavior:
411
479
 
412
480
  - `groq` uses Groq API with `GROQ_API_KEY`
413
- - `github` uses GitHub Copilot SDK and your local Copilot CLI login session
481
+ - `github` uses GitHub Copilot SDK and your local Copilot CLI login session (`copilot auth login`)
414
482
 
415
- ### Large diff handling
483
+ ### Large diff handling (automatic)
416
484
 
417
485
  For large commits that exceed API token limits, lazycommit automatically:
418
486
 
@@ -440,7 +508,7 @@ If you get a 413 error, your diff is too large for the API. Try these solutions:
440
508
  2. **Use a different model**:
441
509
 
442
510
  ```sh
443
- lazycommit config set model "groq/compound-mini"
511
+ lazycommit config set model=groq/compound-mini
444
512
  ```
445
513
 
446
514
  3. **Commit in smaller batches**:
@@ -455,33 +523,29 @@ If you get a 413 error, your diff is too large for the API. Try these solutions:
455
523
 
456
524
  - Check provider settings: `lazycommit config show`
457
525
  - For `groq`, verify `GROQ_API_KEY` is set
458
- - For `github`, run `copilot auth login`
526
+ - For `github`, ensure `copilot` CLI is installed and run `copilot auth login`
459
527
  - Verify you have staged changes: `git status`
460
528
  - Try excluding large files or using a different model
461
529
 
462
530
  ### Slow performance with large diffs
463
531
 
464
- - **Use the default model**: `lazycommit config set model "openai/gpt-oss-120b"`
532
+ - **Use the default model**: `lazycommit config set model=openai/gpt-oss-120b`
465
533
  - Exclude unnecessary files: `lazycommit --exclude "*.log" --exclude "*.tmp"`
466
534
  - Use the built-in large diff handling for better context and accuracy
467
535
  - Lower generate count: `lazycommit config set generate=1` (default)
468
536
  - Reduce timeout: `lazycommit config set timeout=5000` for faster failures
469
537
 
470
- ## Why Groq?
538
+ ## Why lazycommit?
471
539
 
472
- - **Fast**: Groq provides ultra-fast inference speeds, especially with the 8B instant model
473
- - **Cost-effective**: More affordable than traditional AI APIs
474
- - **Open source models**: Uses leading open-source language models
475
- - **Reliable**: High uptime and consistent performance
476
- - **Optimized for commits**: The 8B instant model is perfectly sized for conventional commit generation
540
+ - **Fast workflow**: Generate commit messages directly from staged changes
541
+ - **Provider choice**: Use Groq or GitHub Copilot
542
+ - **Works for large commits**: Built-in compact summaries and context snippets
543
+ - **Flexible output**: Generate one or multiple suggestions and edit before committing
477
544
 
478
545
  ## Maintainers
479
546
 
480
- - **Kartik Labhshetwar**: [@KartikLabhshetwar](https://github.com/KartikLabhshetwar)
481
-
482
- ## Contributing
483
-
484
- If you want to help fix a bug or implement a feature in [Issues](https://github.com/KartikLabhshetwar/lazycommit/issues), checkout the [Contribution Guide](CONTRIBUTING.md) to learn how to setup and test the project.
547
+ - **Sachin Thapa**: [@sachinthapa572](https://github.com/sachinthapa572)
548
+ - **Kshitiz Sharma (imxitiz)**: [@imxitiz](https://github.com/imxitiz)
485
549
 
486
550
  ## License
487
551
 
package/package.json CHANGED
@@ -1,49 +1,48 @@
1
1
  {
2
- "name": "@sachinthapa572/lazycommit",
3
- "version": "1.0.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
- "homepage": "https://lazycommit.vercel.app",
17
- "repository": "sachin/lazycommit(fork)",
18
- "type": "module",
19
- "publishConfig": {
20
- "access": "public"
21
- },
22
- "files": [
23
- "dist"
24
- ],
25
- "bin": {
26
- "lazycommit": "./dist/cli.mjs",
27
- "lzc": "./dist/cli.mjs"
28
- },
29
- "dependencies": {
30
- "@clack/prompts": "^0.11.0",
31
- "@github/copilot-sdk": "^0.2.0",
32
- "@types/ini": "^4.1.1",
33
- "@types/inquirer": "^9.0.9",
34
- "@types/node": "^24.5.1",
35
- "@typescript/native-preview": "^7.0.0-dev.20260326.1",
36
- "clean-pkg-json": "^1.3.0",
37
- "cleye": "^1.3.4",
38
- "execa": "^9.6.0",
39
- "fs-fixture": "^2.8.1",
40
- "groq-sdk": "^0.32.0",
41
- "https-proxy-agent": "^7.0.6",
42
- "ini": "^5.0.0",
43
- "kolorist": "^1.8.0",
44
- "manten": "^1.5.0",
45
- "pkgroll": "^2.15.4",
46
- "tsx": "^4.20.5",
47
- "typescript": "^5.9.2"
48
- }
49
- }
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
+ }