gut-cli 0.1.9 → 0.1.11
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 +133 -34
- package/dist/index.js +900 -661
- 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,22 +18,23 @@ 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
|
|
27
|
-
| `gut config` |
|
|
28
|
-
| `gut lang` |
|
|
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 |
|
|
37
|
+
| `gut init` | Initialize .gut/ templates in your project |
|
|
29
38
|
|
|
30
39
|
### `gut commit`
|
|
31
40
|
|
|
@@ -45,11 +54,7 @@ gut commit --all
|
|
|
45
54
|
gut commit --provider openai
|
|
46
55
|
```
|
|
47
56
|
|
|
48
|
-
**
|
|
49
|
-
- `.gut/commit-convention.md`
|
|
50
|
-
- `.github/commit-convention.md`
|
|
51
|
-
- `.commit-convention.md`
|
|
52
|
-
- `.gitmessage`
|
|
57
|
+
**Template Support**: Create `.gut/commit.md` to customize the commit message prompt.
|
|
53
58
|
|
|
54
59
|
### `gut pr`
|
|
55
60
|
|
|
@@ -69,7 +74,7 @@ gut pr --create
|
|
|
69
74
|
gut pr --copy
|
|
70
75
|
```
|
|
71
76
|
|
|
72
|
-
**
|
|
77
|
+
**Template Support**: Automatically uses GitHub's `.github/pull_request_template.md` if present, or falls back to `.gut/pr.md`.
|
|
73
78
|
|
|
74
79
|
### `gut review`
|
|
75
80
|
|
|
@@ -191,7 +196,27 @@ gut branch 123 --type fix
|
|
|
191
196
|
gut branch -d "add user authentication"
|
|
192
197
|
```
|
|
193
198
|
|
|
194
|
-
**
|
|
199
|
+
**Template Support**: Create `.gut/branch.md` for custom naming rules.
|
|
200
|
+
|
|
201
|
+
### `gut checkout`
|
|
202
|
+
|
|
203
|
+
Generate a branch name from current diff and checkout.
|
|
204
|
+
|
|
205
|
+
```bash
|
|
206
|
+
# Generate branch name from uncommitted changes
|
|
207
|
+
gut checkout
|
|
208
|
+
|
|
209
|
+
# Auto-checkout without confirmation
|
|
210
|
+
gut checkout --yes
|
|
211
|
+
|
|
212
|
+
# Use only staged changes
|
|
213
|
+
gut checkout --staged
|
|
214
|
+
|
|
215
|
+
# Use specific provider
|
|
216
|
+
gut checkout --provider openai
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
**Template Support**: Create `.gut/checkout.md` to customize the prompt.
|
|
195
220
|
|
|
196
221
|
### `gut sync`
|
|
197
222
|
|
|
@@ -241,6 +266,46 @@ gut stash --drop 1
|
|
|
241
266
|
gut stash --clear
|
|
242
267
|
```
|
|
243
268
|
|
|
269
|
+
### `gut summary`
|
|
270
|
+
|
|
271
|
+
Generate a work summary from your commits (for daily/weekly reports).
|
|
272
|
+
|
|
273
|
+
```bash
|
|
274
|
+
# Today's summary (default: your commits)
|
|
275
|
+
gut summary
|
|
276
|
+
|
|
277
|
+
# Daily report
|
|
278
|
+
gut summary --daily
|
|
279
|
+
|
|
280
|
+
# Weekly report
|
|
281
|
+
gut summary --weekly
|
|
282
|
+
|
|
283
|
+
# Custom date range
|
|
284
|
+
gut summary --since "2024-01-01" --until "2024-01-31"
|
|
285
|
+
|
|
286
|
+
# Include diff for more detail
|
|
287
|
+
gut summary --weekly --with-diff
|
|
288
|
+
|
|
289
|
+
# Output as markdown (great for Slack/docs)
|
|
290
|
+
gut summary --weekly --markdown
|
|
291
|
+
|
|
292
|
+
# Copy to clipboard
|
|
293
|
+
gut summary --daily --copy
|
|
294
|
+
|
|
295
|
+
# Specify different author
|
|
296
|
+
gut summary --author "John Doe"
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
**Options:**
|
|
300
|
+
- `--daily` - Generate daily report (since today)
|
|
301
|
+
- `--weekly` - Generate weekly report (since 1 week ago)
|
|
302
|
+
- `--since <date>` - Start date (default: today)
|
|
303
|
+
- `--until <date>` - End date
|
|
304
|
+
- `--author <author>` - Filter by author (default: current git user)
|
|
305
|
+
- `--with-diff` - Include diff analysis for more detail
|
|
306
|
+
- `--markdown` - Output as markdown
|
|
307
|
+
- `--copy` - Copy to clipboard
|
|
308
|
+
|
|
244
309
|
### `gut changelog`
|
|
245
310
|
|
|
246
311
|
Generate a changelog from commits.
|
|
@@ -259,7 +324,7 @@ gut changelog --tag v1.0.0
|
|
|
259
324
|
gut changelog --json
|
|
260
325
|
```
|
|
261
326
|
|
|
262
|
-
**
|
|
327
|
+
**Template Support**: Create `.gut/changelog.md` to customize the changelog format.
|
|
263
328
|
|
|
264
329
|
### `gut lang`
|
|
265
330
|
|
|
@@ -304,6 +369,26 @@ gut config get lang
|
|
|
304
369
|
1. Local: `.gut/config.json` (per-repository)
|
|
305
370
|
2. Global: `~/.config/gut/config.json`
|
|
306
371
|
|
|
372
|
+
### `gut init`
|
|
373
|
+
|
|
374
|
+
Initialize `.gut/` templates in your project for customization.
|
|
375
|
+
|
|
376
|
+
```bash
|
|
377
|
+
# Copy all templates to .gut/ (translates if language is not English)
|
|
378
|
+
gut init
|
|
379
|
+
|
|
380
|
+
# Force overwrite existing templates
|
|
381
|
+
gut init --force
|
|
382
|
+
|
|
383
|
+
# Skip translation (copy English templates as-is)
|
|
384
|
+
gut init --no-translate
|
|
385
|
+
|
|
386
|
+
# Use specific provider for translation
|
|
387
|
+
gut init --provider openai
|
|
388
|
+
```
|
|
389
|
+
|
|
390
|
+
Templates are automatically translated to your configured language (set via `gut lang`).
|
|
391
|
+
|
|
307
392
|
### `gut cleanup`
|
|
308
393
|
|
|
309
394
|
Delete merged branches safely.
|
|
@@ -344,21 +429,35 @@ API keys can also be set via environment variables:
|
|
|
344
429
|
- `GUT_OPENAI_API_KEY` or `OPENAI_API_KEY`
|
|
345
430
|
- `GUT_ANTHROPIC_API_KEY` or `ANTHROPIC_API_KEY`
|
|
346
431
|
|
|
432
|
+
## Security
|
|
433
|
+
|
|
434
|
+
API keys are stored securely using your operating system's native credential storage:
|
|
435
|
+
|
|
436
|
+
- **macOS**: Keychain
|
|
437
|
+
- **Windows**: Credential Vault
|
|
438
|
+
- **Linux**: Secret Service API (libsecret)
|
|
439
|
+
|
|
440
|
+
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.
|
|
441
|
+
|
|
347
442
|
## Project Configuration
|
|
348
443
|
|
|
349
|
-
gut looks for
|
|
444
|
+
gut looks for template files in your repository's `.gut/` folder. Each template uses `{{variable}}` syntax for dynamic content.
|
|
350
445
|
|
|
351
446
|
| File | Purpose |
|
|
352
447
|
|------|---------|
|
|
353
|
-
| `.gut/commit
|
|
354
|
-
| `.gut/pr
|
|
355
|
-
| `.gut/
|
|
356
|
-
| `.gut/
|
|
357
|
-
| `.gut/
|
|
358
|
-
| `.gut/
|
|
359
|
-
| `.gut/
|
|
360
|
-
| `.
|
|
361
|
-
|
|
|
448
|
+
| `.gut/commit.md` | Commit message prompt |
|
|
449
|
+
| `.gut/pr.md` | PR description prompt |
|
|
450
|
+
| `.gut/branch.md` | Branch naming rules |
|
|
451
|
+
| `.gut/checkout.md` | Checkout branch name prompt |
|
|
452
|
+
| `.gut/merge.md` | Merge conflict resolution rules |
|
|
453
|
+
| `.gut/review.md` | Code review criteria |
|
|
454
|
+
| `.gut/explain.md` | Explanation context |
|
|
455
|
+
| `.gut/explain-file.md` | File explanation context |
|
|
456
|
+
| `.gut/find.md` | Commit search context |
|
|
457
|
+
| `.gut/changelog.md` | Changelog format |
|
|
458
|
+
| `.gut/stash.md` | Stash name prompt |
|
|
459
|
+
| `.gut/summary.md` | Work summary format |
|
|
460
|
+
| `.github/pull_request_template.md` | GitHub PR template (prioritized over `.gut/pr.md`) |
|
|
362
461
|
|
|
363
462
|
## Development
|
|
364
463
|
|