gut-cli 0.1.8 → 0.1.10
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 +155 -32
- package/dist/index.js +752 -514
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
**Git Utility Tool** - AI-powered git commands for smarter workflows.
|
|
4
4
|
|
|
5
|
+
## Why gut?
|
|
6
|
+
|
|
7
|
+
Working with git involves many small decisions that add up: writing clear commit messages, naming branches, describing pull requests, coming up with stash names you'll actually remember. These tasks aren't hard, but they interrupt your flow and take more time than they should.
|
|
8
|
+
|
|
9
|
+
gut handles these for you. Unlike AI coding assistants that analyze your entire codebase, gut focuses only on git operations—so it's fast. You get results in seconds, not minutes.
|
|
10
|
+
|
|
11
|
+
No subscription required. Just bring your own API key from Gemini, OpenAI, or Anthropic. Your keys are stored securely in your system's native keychain, never in plain text.
|
|
12
|
+
|
|
5
13
|
## Installation
|
|
6
14
|
|
|
7
15
|
```bash
|
|
@@ -10,20 +18,22 @@ npm install -g gut-cli
|
|
|
10
18
|
|
|
11
19
|
## Commands
|
|
12
20
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
|
16
|
-
|
|
17
|
-
| `gut
|
|
18
|
-
| `gut
|
|
19
|
-
| `gut
|
|
20
|
-
| `gut
|
|
21
|
-
| `gut
|
|
22
|
-
| `gut
|
|
23
|
-
| `gut
|
|
24
|
-
| `gut
|
|
25
|
-
| `gut
|
|
26
|
-
| `gut
|
|
21
|
+
| Command | Description |
|
|
22
|
+
|---------|-------------|
|
|
23
|
+
| `gut commit` | Generate commit messages |
|
|
24
|
+
| `gut pr` | Generate PR descriptions |
|
|
25
|
+
| `gut review` | Code review |
|
|
26
|
+
| `gut merge` | Resolve merge conflicts |
|
|
27
|
+
| `gut explain` | Explain changes, commits, PRs, or files |
|
|
28
|
+
| `gut find` | Find commits by vague description |
|
|
29
|
+
| `gut branch` | Generate branch names from description |
|
|
30
|
+
| `gut checkout` | Generate branch name from diff and checkout |
|
|
31
|
+
| `gut changelog` | Generate changelogs |
|
|
32
|
+
| `gut sync` | Sync with remote (fetch + rebase/merge) |
|
|
33
|
+
| `gut stash` | Stash with AI-generated names |
|
|
34
|
+
| `gut summary` | Generate work summary (daily/weekly reports) |
|
|
35
|
+
| `gut config` | Manage configuration (language, etc.) |
|
|
36
|
+
| `gut lang` | Set or show output language |
|
|
27
37
|
|
|
28
38
|
### `gut commit`
|
|
29
39
|
|
|
@@ -43,11 +53,7 @@ gut commit --all
|
|
|
43
53
|
gut commit --provider openai
|
|
44
54
|
```
|
|
45
55
|
|
|
46
|
-
**
|
|
47
|
-
- `.gut/commit-convention.md`
|
|
48
|
-
- `.github/commit-convention.md`
|
|
49
|
-
- `.commit-convention.md`
|
|
50
|
-
- `.gitmessage`
|
|
56
|
+
**Template Support**: Create `.gut/commit.md` to customize the commit message prompt.
|
|
51
57
|
|
|
52
58
|
### `gut pr`
|
|
53
59
|
|
|
@@ -67,7 +73,7 @@ gut pr --create
|
|
|
67
73
|
gut pr --copy
|
|
68
74
|
```
|
|
69
75
|
|
|
70
|
-
**
|
|
76
|
+
**Template Support**: Automatically uses GitHub's `.github/pull_request_template.md` if present, or falls back to `.gut/pr.md`.
|
|
71
77
|
|
|
72
78
|
### `gut review`
|
|
73
79
|
|
|
@@ -189,7 +195,27 @@ gut branch 123 --type fix
|
|
|
189
195
|
gut branch -d "add user authentication"
|
|
190
196
|
```
|
|
191
197
|
|
|
192
|
-
**
|
|
198
|
+
**Template Support**: Create `.gut/branch.md` for custom naming rules.
|
|
199
|
+
|
|
200
|
+
### `gut checkout`
|
|
201
|
+
|
|
202
|
+
Generate a branch name from current diff and checkout.
|
|
203
|
+
|
|
204
|
+
```bash
|
|
205
|
+
# Generate branch name from uncommitted changes
|
|
206
|
+
gut checkout
|
|
207
|
+
|
|
208
|
+
# Auto-checkout without confirmation
|
|
209
|
+
gut checkout --yes
|
|
210
|
+
|
|
211
|
+
# Use only staged changes
|
|
212
|
+
gut checkout --staged
|
|
213
|
+
|
|
214
|
+
# Use specific provider
|
|
215
|
+
gut checkout --provider openai
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
**Template Support**: Create `.gut/checkout.md` to customize the prompt.
|
|
193
219
|
|
|
194
220
|
### `gut sync`
|
|
195
221
|
|
|
@@ -239,6 +265,46 @@ gut stash --drop 1
|
|
|
239
265
|
gut stash --clear
|
|
240
266
|
```
|
|
241
267
|
|
|
268
|
+
### `gut summary`
|
|
269
|
+
|
|
270
|
+
Generate a work summary from your commits (for daily/weekly reports).
|
|
271
|
+
|
|
272
|
+
```bash
|
|
273
|
+
# Today's summary (default: your commits)
|
|
274
|
+
gut summary
|
|
275
|
+
|
|
276
|
+
# Daily report
|
|
277
|
+
gut summary --daily
|
|
278
|
+
|
|
279
|
+
# Weekly report
|
|
280
|
+
gut summary --weekly
|
|
281
|
+
|
|
282
|
+
# Custom date range
|
|
283
|
+
gut summary --since "2024-01-01" --until "2024-01-31"
|
|
284
|
+
|
|
285
|
+
# Include diff for more detail
|
|
286
|
+
gut summary --weekly --with-diff
|
|
287
|
+
|
|
288
|
+
# Output as markdown (great for Slack/docs)
|
|
289
|
+
gut summary --weekly --markdown
|
|
290
|
+
|
|
291
|
+
# Copy to clipboard
|
|
292
|
+
gut summary --daily --copy
|
|
293
|
+
|
|
294
|
+
# Specify different author
|
|
295
|
+
gut summary --author "John Doe"
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
**Options:**
|
|
299
|
+
- `--daily` - Generate daily report (since today)
|
|
300
|
+
- `--weekly` - Generate weekly report (since 1 week ago)
|
|
301
|
+
- `--since <date>` - Start date (default: today)
|
|
302
|
+
- `--until <date>` - End date
|
|
303
|
+
- `--author <author>` - Filter by author (default: current git user)
|
|
304
|
+
- `--with-diff` - Include diff analysis for more detail
|
|
305
|
+
- `--markdown` - Output as markdown
|
|
306
|
+
- `--copy` - Copy to clipboard
|
|
307
|
+
|
|
242
308
|
### `gut changelog`
|
|
243
309
|
|
|
244
310
|
Generate a changelog from commits.
|
|
@@ -257,7 +323,50 @@ gut changelog --tag v1.0.0
|
|
|
257
323
|
gut changelog --json
|
|
258
324
|
```
|
|
259
325
|
|
|
260
|
-
**
|
|
326
|
+
**Template Support**: Create `.gut/changelog.md` to customize the changelog format.
|
|
327
|
+
|
|
328
|
+
### `gut lang`
|
|
329
|
+
|
|
330
|
+
Set or show AI output language (shortcut for `gut config set lang`).
|
|
331
|
+
|
|
332
|
+
```bash
|
|
333
|
+
# Show current language
|
|
334
|
+
gut lang
|
|
335
|
+
|
|
336
|
+
# Set to Japanese
|
|
337
|
+
gut lang ja
|
|
338
|
+
|
|
339
|
+
# Set to English
|
|
340
|
+
gut lang en
|
|
341
|
+
|
|
342
|
+
# Set for current repository only
|
|
343
|
+
gut lang en --local
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
### `gut config`
|
|
347
|
+
|
|
348
|
+
Manage gut configuration settings.
|
|
349
|
+
|
|
350
|
+
```bash
|
|
351
|
+
# List all settings
|
|
352
|
+
gut config list
|
|
353
|
+
|
|
354
|
+
# Set language to Japanese (global)
|
|
355
|
+
gut config set lang ja
|
|
356
|
+
|
|
357
|
+
# Set language for current repository only
|
|
358
|
+
gut config set lang en --local
|
|
359
|
+
|
|
360
|
+
# Get current language
|
|
361
|
+
gut config get lang
|
|
362
|
+
```
|
|
363
|
+
|
|
364
|
+
**Available settings:**
|
|
365
|
+
- `lang` - Output language for AI responses (`en`, `ja`)
|
|
366
|
+
|
|
367
|
+
**Configuration precedence:**
|
|
368
|
+
1. Local: `.gut/config.json` (per-repository)
|
|
369
|
+
2. Global: `~/.config/gut/config.json`
|
|
261
370
|
|
|
262
371
|
### `gut cleanup`
|
|
263
372
|
|
|
@@ -299,21 +408,35 @@ API keys can also be set via environment variables:
|
|
|
299
408
|
- `GUT_OPENAI_API_KEY` or `OPENAI_API_KEY`
|
|
300
409
|
- `GUT_ANTHROPIC_API_KEY` or `ANTHROPIC_API_KEY`
|
|
301
410
|
|
|
411
|
+
## Security
|
|
412
|
+
|
|
413
|
+
API keys are stored securely using your operating system's native credential storage:
|
|
414
|
+
|
|
415
|
+
- **macOS**: Keychain
|
|
416
|
+
- **Windows**: Credential Vault
|
|
417
|
+
- **Linux**: Secret Service API (libsecret)
|
|
418
|
+
|
|
419
|
+
Keys are never stored in plain text files or configuration files. When you run `gut auth login`, the key is encrypted and managed by your OS.
|
|
420
|
+
|
|
302
421
|
## Project Configuration
|
|
303
422
|
|
|
304
|
-
gut looks for
|
|
423
|
+
gut looks for template files in your repository's `.gut/` folder. Each template uses `{{variable}}` syntax for dynamic content.
|
|
305
424
|
|
|
306
425
|
| File | Purpose |
|
|
307
426
|
|------|---------|
|
|
308
|
-
| `.gut/commit
|
|
309
|
-
| `.gut/pr
|
|
310
|
-
| `.gut/
|
|
311
|
-
| `.gut/
|
|
312
|
-
| `.gut/
|
|
313
|
-
| `.gut/
|
|
314
|
-
| `.gut/
|
|
315
|
-
| `.
|
|
316
|
-
|
|
|
427
|
+
| `.gut/commit.md` | Commit message prompt |
|
|
428
|
+
| `.gut/pr.md` | PR description prompt |
|
|
429
|
+
| `.gut/branch.md` | Branch naming rules |
|
|
430
|
+
| `.gut/checkout.md` | Checkout branch name prompt |
|
|
431
|
+
| `.gut/merge.md` | Merge conflict resolution rules |
|
|
432
|
+
| `.gut/review.md` | Code review criteria |
|
|
433
|
+
| `.gut/explain.md` | Explanation context |
|
|
434
|
+
| `.gut/explain-file.md` | File explanation context |
|
|
435
|
+
| `.gut/find.md` | Commit search context |
|
|
436
|
+
| `.gut/changelog.md` | Changelog format |
|
|
437
|
+
| `.gut/stash.md` | Stash name prompt |
|
|
438
|
+
| `.gut/summary.md` | Work summary format |
|
|
439
|
+
| `.github/pull_request_template.md` | GitHub PR template (prioritized over `.gut/pr.md`) |
|
|
317
440
|
|
|
318
441
|
## Development
|
|
319
442
|
|