@untools/commitgen 0.4.2 → 0.4.3
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 +130 -0
- package/package.json +3 -2
package/README.md
ADDED
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
# CommitGen CLI
|
|
2
|
+
|
|
3
|
+
**The AI-Powered Commit Generator**
|
|
4
|
+
|
|
5
|
+
CommitGen is a powerful CLI tool that leverages AI to generate conventional commit messages from your staged changes. It works with 50 free credits (no key required) or your own Google AI API key.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
Install globally using your preferred package manager:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
# npm
|
|
13
|
+
npm install -g @untools/commitgen
|
|
14
|
+
|
|
15
|
+
# pnpm
|
|
16
|
+
pnpm add -g @untools/commitgen
|
|
17
|
+
|
|
18
|
+
# yarn
|
|
19
|
+
yarn global add @untools/commitgen
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Or run correctly via `npx` (no installation required):
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
npx @untools/commitgen
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### Upgrading
|
|
29
|
+
|
|
30
|
+
To update to the latest version:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
npm install -g @untools/commitgen@latest
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Quick Start
|
|
37
|
+
|
|
38
|
+
### ⚡ Option 1: Free 50 Credits (No Key Required)
|
|
39
|
+
|
|
40
|
+
Just sign up with your email to start generating commits immediately.
|
|
41
|
+
|
|
42
|
+
1. **Login**:
|
|
43
|
+
```bash
|
|
44
|
+
commitgen login
|
|
45
|
+
```
|
|
46
|
+
2. **Generate**:
|
|
47
|
+
Stage your files (`git add .`) and run:
|
|
48
|
+
```bash
|
|
49
|
+
commitgen
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### 🔑 Option 2: Bring Your Own Key (Unlimited)
|
|
53
|
+
|
|
54
|
+
Use your own Google Gemini API key for unlimited generations.
|
|
55
|
+
|
|
56
|
+
1. **Configure**:
|
|
57
|
+
```bash
|
|
58
|
+
commitgen config
|
|
59
|
+
```
|
|
60
|
+
2. Select **"Vercel AI SDK - Google Gemini (Own Key)"**.
|
|
61
|
+
3. Enter your API Key.
|
|
62
|
+
> Don't have one? [Get a free Google AI Key here](https://aistudio.google.com/app/apikey).
|
|
63
|
+
|
|
64
|
+
## Advanced Features
|
|
65
|
+
|
|
66
|
+
### 🔄 Multi-Commit Mode
|
|
67
|
+
|
|
68
|
+
CommitGen can detect when you've modified unrelated files and suggest splitting them into multiple atomic commits.
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
commitgen --multi-commit
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
_The CLI will prompt you to confirm the split groups before proceeding._
|
|
75
|
+
|
|
76
|
+
### 🧠 History Learning
|
|
77
|
+
|
|
78
|
+
The tool learns from your previous commit messages to match your personal or team's style. This is enabled by default.
|
|
79
|
+
|
|
80
|
+
To disable:
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
commitgen --no-history
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### 🎫 Issue Linking
|
|
87
|
+
|
|
88
|
+
If your branch name contains an issue ID (e.g., `feat/PROJ-123-new-auth`), CommitGen will automatically append the ticket reference to your commit message (e.g., `feat: add auth logic (PROJ-123)`).
|
|
89
|
+
|
|
90
|
+
To disable:
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
commitgen --no-issues
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## Command Reference
|
|
97
|
+
|
|
98
|
+
### Main Commands
|
|
99
|
+
|
|
100
|
+
| Command | Description |
|
|
101
|
+
| :---------------------- | :--------------------------------------------------------------- |
|
|
102
|
+
| `commitgen` | **Default.** Analyze staged changes and generate commit options. |
|
|
103
|
+
| `commitgen login` | Log in/Sign up for the hosted credit service. |
|
|
104
|
+
| `commitgen config` | Switch between Hosted and BYO-Key providers or change models. |
|
|
105
|
+
| `commitgen dashboard` | Open the web dashboard to manage credits and history. |
|
|
106
|
+
| `commitgen buy-credits` | Purchase additional credits for the hosted service. |
|
|
107
|
+
| `commitgen show-config` | Display your current configuration settings. |
|
|
108
|
+
|
|
109
|
+
### Options & Flags
|
|
110
|
+
|
|
111
|
+
| Flag | Description |
|
|
112
|
+
| :------------------- | :------------------------------------------------------ |
|
|
113
|
+
| `-p, --push` | Automatically push to remote after a successful commit. |
|
|
114
|
+
| `-n, --noverify` | Skip git pre-commit hooks (`--no-verify`). |
|
|
115
|
+
| `-m, --multi-commit` | Enable atomic multi-commit suggestions. |
|
|
116
|
+
| `--model <id>` | Use a specific model (e.g., `gemini-1.5-pro`). |
|
|
117
|
+
| `--no-use-ai` | Force offline rule-based generation. |
|
|
118
|
+
| `--no-history` | Disable style learning from git history. |
|
|
119
|
+
| `--no-issues` | Disable automatic issue tracking number linking. |
|
|
120
|
+
|
|
121
|
+
## How to Get a Google AI API Key
|
|
122
|
+
|
|
123
|
+
1. Go to [Google AI Studio](https://aistudio.google.com/app/apikey) and sign in.
|
|
124
|
+
2. Click **"Create API key"**.
|
|
125
|
+
3. Copy the key string (starts with `AIza...`).
|
|
126
|
+
4. Run `commitgen config` and paste it in.
|
|
127
|
+
|
|
128
|
+
## License
|
|
129
|
+
|
|
130
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@untools/commitgen",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.3",
|
|
4
4
|
"description": "CLI to create generate commit messages",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -28,7 +28,8 @@
|
|
|
28
28
|
"openai"
|
|
29
29
|
],
|
|
30
30
|
"files": [
|
|
31
|
-
"dist"
|
|
31
|
+
"dist",
|
|
32
|
+
"README.md"
|
|
32
33
|
],
|
|
33
34
|
"engines": {
|
|
34
35
|
"node": ">=14.0.0"
|