You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+284-4Lines changed: 284 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,7 +28,12 @@ for selecting the type of change, scope, and description of your commit message.
28
28
- Predefined commit types with corresponding emojis.
29
29
- Customizable commit types and scopes through a JSON configuration file.
30
30
- Supports Git out of the box
31
-
- AI generated commit messages using [phind](https://phind.com) without needing API keys or tokens (possibility to use your own ai models will be planned).
31
+
- AI generated commit messages using multiple providers:
32
+
-**Phind** (default, no API key required)
33
+
-**Groq** (fast inference, requires API key)
34
+
-**OpenRouter** (access to multiple models, requires API key)
35
+
- Intelligent large diff handling with automatic summarization
36
+
- No rate limiting issues with smart diff compression
32
37
33
38
## Install
34
39
@@ -109,20 +114,295 @@ To use the check command, add the following to your pre-commit hook in your git
109
114
110
115
## Draft command
111
116
112
-
The `draft` command allows you to generate a commit message for staged changes using an AI provider.
117
+
The `draft` command allows you to generate a commit message for staged changes using various AI providers.
113
118
114
119
```sh
115
120
goji draft
116
121
```
117
122
118
-
This command connects to an AI provider (e.g., Phind) to generate a commit message based on your staged changes.
123
+
This command connects to an AI provider to generate a commit message based on your staged changes.
119
124
120
-
Options for `draft` command:
125
+
### Quick Start
126
+
127
+
**1. Set up environment variables (if using Groq or OpenRouter):**
- **Large diffs** (>20k chars): Automatically summarized to key changes only
255
+
- **Smart compression**: Reduces large diffs by 90%+ while preserving important context
256
+
- **No rate limits**: Single API call prevents token limit issues
257
+
258
+
### Examples
259
+
260
+
**Basic commit generation:**
261
+
262
+
```sh
263
+
# Stage your changes
264
+
git add .
265
+
266
+
# Generate commit message
267
+
goji draft
268
+
269
+
# Generate and commit directly
270
+
goji draft --commit
271
+
```
272
+
273
+
**Detailed commit with body:**
274
+
275
+
```sh
276
+
# Generate detailed commit with body
277
+
goji draft --body --commit
278
+
```
279
+
280
+
**Override type and scope:**
281
+
282
+
```sh
283
+
# Force a specific type and scope
284
+
goji draft --type feat --scope api --commit
285
+
```
286
+
287
+
**Using different AI providers:**
288
+
289
+
```sh
290
+
# Switch to Groq (requires GROQ_API_KEY)
291
+
goji draft --commit
292
+
293
+
# Switch to OpenRouter (requires OPENROUTER_API_KEY)
294
+
goji draft --commit
295
+
```
296
+
297
+
### Configuration
298
+
299
+
Update your `.goji.json` to configure AI providers:
300
+
301
+
```json
302
+
{
303
+
"aiprovider": "groq",
304
+
"aichoices": {
305
+
"phind": {
306
+
"model": "Phind-70B"
307
+
},
308
+
"groq": {
309
+
"model": "mixtral-8x7b-32768"
310
+
},
311
+
"openrouter": {
312
+
"model": "anthropic/claude-3.5-sonnet"
313
+
}
314
+
}
315
+
}
316
+
```
317
+
318
+
### Environment Variables
319
+
320
+
Goji uses environment variables to authenticate with AI providers. Set these in your shell profile (`.bashrc`, `.zshrc`, etc.) or export them before running commands.
0 commit comments