aicommits 2.0.0-develop.3 → 2.0.0-develop.30
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 +79 -25
- package/dist/cli-CayV1s_d.mjs +209 -0
- package/dist/cli.mjs +1 -1
- package/dist/token-KkHT_6F9.mjs +1 -0
- package/dist/{token-util-kF1mb_fv.mjs → token-util-CouME5QQ.mjs} +1 -1
- package/dist/token-util-Cx8y_cov.mjs +1 -0
- package/package.json +7 -7
- package/dist/cli-8OikwcWH.mjs +0 -194
- package/dist/token-BBjSjsOL.mjs +0 -1
- package/dist/token-util-DSUfZicm.mjs +0 -1
package/README.md
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<div align="center">
|
|
2
2
|
<div>
|
|
3
3
|
<img src=".github/screenshot.png" alt="AI Commits"/>
|
|
4
|
+
<img src="./aic.png" width="50" alt="AI Commits"/>
|
|
4
5
|
<h1 align="center">AI Commits</h1>
|
|
5
6
|
</div>
|
|
6
7
|
<p>A CLI that writes your git commit messages for you with AI. Never write a commit message again.</p>
|
|
@@ -17,11 +18,9 @@
|
|
|
17
18
|
1. Install _aicommits_:
|
|
18
19
|
|
|
19
20
|
```sh
|
|
20
|
-
npm install -g aicommits
|
|
21
|
+
npm install -g aicommits
|
|
21
22
|
```
|
|
22
23
|
|
|
23
|
-
> We need @develop since v2 is still not released as latest/main! Don't remove it to test v2!
|
|
24
|
-
|
|
25
24
|
2. Run the setup command to choose your AI provider:
|
|
26
25
|
|
|
27
26
|
```sh
|
|
@@ -33,21 +32,25 @@ This will guide you through:
|
|
|
33
32
|
- Selecting your AI provider (sets the `provider` config)
|
|
34
33
|
- Configuring your API key
|
|
35
34
|
- **Automatically fetching and selecting from available models** (when supported)
|
|
35
|
+
- **Choosing your preferred commit message format** (plain, conventional, or gitmoji)
|
|
36
36
|
|
|
37
37
|
Supported providers include:
|
|
38
38
|
|
|
39
39
|
- **TogetherAI** (recommended) - Get your API key from [TogetherAI](https://api.together.ai/)
|
|
40
40
|
- **OpenAI** - Get your API key from [OpenAI API Keys page](https://platform.openai.com/account/api-keys)
|
|
41
|
+
- **Groq** - Get your API key from [Groq Console](https://console.groq.com/keys)
|
|
42
|
+
- **xAI** - Get your API key from [xAI Console](https://console.x.ai/)
|
|
41
43
|
- **OpenRouter** - Get your API key from [OpenRouter](https://openrouter.ai/keys)
|
|
42
44
|
- **Ollama** (local) - Run AI models locally with [Ollama](https://ollama.ai)
|
|
45
|
+
- **LM Studio** (local) - No API key required. Runs on your computer via [LM Studio](https://lmstudio.ai/)
|
|
43
46
|
- **Custom OpenAI-compatible endpoint** - Use any service that implements the OpenAI API
|
|
44
47
|
|
|
45
|
-
|
|
48
|
+
**For CI/CD environments**, you can also set up configuration via the config file:
|
|
46
49
|
|
|
47
50
|
```bash
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
+
aicommits config set OPENAI_API_KEY="your_api_key_here"
|
|
52
|
+
aicommits config set OPENAI_BASE_URL="your_api_endpoint" # Optional, for custom endpoints
|
|
53
|
+
aicommits config set OPENAI_MODEL="your_model_choice" # Optional, defaults to provider default
|
|
51
54
|
```
|
|
52
55
|
|
|
53
56
|
> **Note:** When using environment variables, ensure all related variables (e.g., `OPENAI_API_KEY` and `OPENAI_BASE_URL`) are set consistently to avoid configuration mismatches with the config file.
|
|
@@ -58,16 +61,22 @@ This will guide you through:
|
|
|
58
61
|
|
|
59
62
|
Check the installed version with:
|
|
60
63
|
|
|
64
|
+
```sh
|
|
65
|
+
aicommits --version
|
|
61
66
|
```
|
|
62
67
|
|
|
63
|
-
|
|
68
|
+
To update to the latest version, run:
|
|
64
69
|
|
|
70
|
+
```sh
|
|
71
|
+
aicommits update
|
|
65
72
|
```
|
|
66
73
|
|
|
67
|
-
|
|
74
|
+
This will automatically detect your package manager (npm, pnpm, yarn, or bun) and update using the correct command.
|
|
75
|
+
|
|
76
|
+
Alternatively, you can manually update:
|
|
68
77
|
|
|
69
78
|
```sh
|
|
70
|
-
npm
|
|
79
|
+
npm install -g aicommits
|
|
71
80
|
```
|
|
72
81
|
|
|
73
82
|
## Usage
|
|
@@ -93,12 +102,14 @@ aicommits --all # or -a
|
|
|
93
102
|
|
|
94
103
|
#### CLI Options
|
|
95
104
|
|
|
96
|
-
- `--generate` or `-g`: Number of messages to generate (default: **1**)
|
|
97
|
-
- `--exclude` or `-x`: Files to exclude from AI analysis
|
|
98
105
|
- `--all` or `-a`: Automatically stage changes in tracked files for the commit (default: **false**)
|
|
99
|
-
- `--type` or `-t`: Git commit message format (default: **conventional**). Supports `conventional` and `gitmoji`
|
|
100
|
-
- `--confirm` or `-y`: Skip confirmation when committing after message generation (default: **false**)
|
|
101
106
|
- `--clipboard` or `-c`: Copy the selected message to the clipboard instead of committing (default: **false**)
|
|
107
|
+
- `--generate` or `-g`: Number of messages to generate (default: **1**)
|
|
108
|
+
- `--exclude` or `-x`: Files to exclude from AI analysis
|
|
109
|
+
- `--type` or `-t`: Git commit message format (default: **plain**). Supports `plain`, `conventional`, and `gitmoji`
|
|
110
|
+
- `--prompt` or `-p`: Custom prompt to guide the LLM behavior (e.g., specific language, style instructions)
|
|
111
|
+
- `--no-verify` or `-n`: Bypass pre-commit hooks while committing (default: **false**)
|
|
112
|
+
- `--yes` or `-y`: Skip confirmation when committing after message generation (default: **false**)
|
|
102
113
|
|
|
103
114
|
#### Generate multiple recommendations
|
|
104
115
|
|
|
@@ -110,15 +121,41 @@ aicommits --generate <i> # or -g <i>
|
|
|
110
121
|
|
|
111
122
|
> Warning: this uses more tokens, meaning it costs more.
|
|
112
123
|
|
|
113
|
-
####
|
|
124
|
+
#### Commit Message Formats
|
|
125
|
+
|
|
126
|
+
You can choose from three different commit message formats:
|
|
127
|
+
|
|
128
|
+
- **plain** (default): Simple, unstructured commit messages
|
|
129
|
+
- **conventional**: [Conventional Commits](https://conventionalcommits.org/) format with type and scope
|
|
130
|
+
- **gitmoji**: Emoji-based commit messages
|
|
114
131
|
|
|
115
|
-
|
|
132
|
+
Use the `--type` flag to specify the format:
|
|
116
133
|
|
|
117
134
|
```sh
|
|
118
135
|
aicommits --type conventional # or -t conventional
|
|
136
|
+
aicommits --type gitmoji # or -t gitmoji
|
|
137
|
+
aicommits --type plain # or -t plain (default)
|
|
119
138
|
```
|
|
120
139
|
|
|
121
|
-
This feature
|
|
140
|
+
This feature is useful if your project follows a specific commit message standard or if you're using tools that rely on these commit formats.
|
|
141
|
+
|
|
142
|
+
#### Custom Prompts
|
|
143
|
+
|
|
144
|
+
You can customize the LLM's behavior with the `--prompt` flag to guide commit message generation:
|
|
145
|
+
|
|
146
|
+
```sh
|
|
147
|
+
# Write commit messages in a specific language
|
|
148
|
+
aicommits -p "Write commit messages in Italian"
|
|
149
|
+
|
|
150
|
+
# Focus on specific aspects of the changes
|
|
151
|
+
aicommits -p "Focus on performance implications of changes"
|
|
152
|
+
|
|
153
|
+
# Use a specific style or tone
|
|
154
|
+
aicommits -p "Use technical jargon suitable for senior developers"
|
|
155
|
+
|
|
156
|
+
# Include specific details in the message
|
|
157
|
+
aicommits -p "Always mention the specific function names and file paths changed"
|
|
158
|
+
```
|
|
122
159
|
|
|
123
160
|
### Git hook
|
|
124
161
|
|
|
@@ -202,6 +239,21 @@ This will:
|
|
|
202
239
|
- Let you select from available models or enter a custom model name
|
|
203
240
|
- Update your configuration automatically
|
|
204
241
|
|
|
242
|
+
### Updating aicommits
|
|
243
|
+
|
|
244
|
+
To update to the latest version, run:
|
|
245
|
+
|
|
246
|
+
```sh
|
|
247
|
+
aicommits update
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
This will:
|
|
251
|
+
|
|
252
|
+
- Check for the latest version on npm
|
|
253
|
+
- Detect your package manager (npm, pnpm, yarn, or bun)
|
|
254
|
+
- Update using the appropriate command
|
|
255
|
+
- Show progress and confirm when complete
|
|
256
|
+
|
|
205
257
|
### Reading a configuration value
|
|
206
258
|
|
|
207
259
|
To retrieve a configuration option, use the command:
|
|
@@ -258,7 +310,7 @@ Model to use for OpenAI-compatible providers.
|
|
|
258
310
|
|
|
259
311
|
#### provider
|
|
260
312
|
|
|
261
|
-
The selected AI provider. Set automatically during `aicommits setup`. Valid values: `openai`, `togetherai`, `ollama`, `custom`.
|
|
313
|
+
The selected AI provider. Set automatically during `aicommits setup`. Valid values: `openai`, `togetherai`, `groq`, `xai`, `openrouter`, `ollama`, `lmstudio`, `custom`.
|
|
262
314
|
|
|
263
315
|
#### locale
|
|
264
316
|
|
|
@@ -296,18 +348,20 @@ aicommits config set max-length=100
|
|
|
296
348
|
|
|
297
349
|
#### type
|
|
298
350
|
|
|
299
|
-
Default: `
|
|
351
|
+
Default: `plain`
|
|
300
352
|
|
|
301
|
-
The type of commit message to generate.
|
|
353
|
+
The type of commit message to generate. Available options:
|
|
302
354
|
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
355
|
+
- `plain`: Simple, unstructured commit messages
|
|
356
|
+
- `conventional`: Conventional Commits format with type and scope
|
|
357
|
+
- `gitmoji`: Emoji-based commit messages
|
|
306
358
|
|
|
307
|
-
|
|
359
|
+
Examples:
|
|
308
360
|
|
|
309
361
|
```sh
|
|
310
|
-
aicommits config set type=
|
|
362
|
+
aicommits config set type=conventional
|
|
363
|
+
aicommits config set type=gitmoji
|
|
364
|
+
aicommits config set type=plain
|
|
311
365
|
```
|
|
312
366
|
|
|
313
367
|
## How it works
|