git-coco 0.22.10 → 0.22.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 +276 -31
- package/dist/index.esm.mjs +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -12,11 +12,20 @@
|
|
|
12
12
|
|
|
13
13
|
Spawned by the dream to automate away the tedium of writing commit messages, `coco` has grown into a multi-facetted git assistant to expedite any developer git workflow.
|
|
14
14
|
|
|
15
|
-
Currently `coco` generates commit messages
|
|
15
|
+
Currently `coco` generates commit messages with **first-class Conventional Commits support**, creates changelogs, summarizes code changes, performs code reviews, and more - with new features being added regularly!
|
|
16
|
+
|
|
17
|
+
**✨ Key Features:**
|
|
18
|
+
|
|
19
|
+
- 🤖 **AI-Powered Commit Messages** - Generate contextual commits from your staged changes
|
|
20
|
+
- 📋 **Conventional Commits** - Full support with automatic validation and formatting
|
|
21
|
+
- 🔧 **Commitlint Integration** - Seamless integration with your existing commitlint configuration
|
|
22
|
+
- 📦 **Package Manager Friendly** - Works with npm, yarn, and pnpm (with automatic compatibility handling)
|
|
23
|
+
- 🛠️ **Robust Error Recovery** - Advanced JSON parsing with automatic repair capabilities
|
|
24
|
+
- 🏠 **Local AI Support** - Run completely offline with Ollama (no API costs, full privacy)
|
|
16
25
|
|
|
17
26
|
## Commands
|
|
18
27
|
|
|
19
|
-
- **`commit`**: generates commit messages based on staged changes.
|
|
28
|
+
- **`commit`**: generates commit messages based on staged changes with intelligent conventional commits support and robust error handling.
|
|
20
29
|
|
|
21
30
|
- **`changelog`**: create changelogs for the current branch or a range of commits.
|
|
22
31
|
|
|
@@ -54,67 +63,190 @@ coco
|
|
|
54
63
|
coco commit
|
|
55
64
|
```
|
|
56
65
|
|
|
57
|
-
#### Commitlint Integration
|
|
66
|
+
#### Conventional Commits & Commitlint Integration
|
|
67
|
+
|
|
68
|
+
`coco` provides first-class support for Conventional Commits with intelligent commitlint integration:
|
|
69
|
+
|
|
70
|
+
**Conventional Commits Support:**
|
|
58
71
|
|
|
59
|
-
|
|
72
|
+
- **Automatic Detection**: Enables conventional commits mode when commitlint config is detected
|
|
73
|
+
- **Smart Formatting**: Generates properly formatted conventional commits (feat, fix, docs, etc.)
|
|
74
|
+
- **Breaking Changes**: Supports breaking change syntax (`feat!:` and `feat(scope)!:`)
|
|
75
|
+
- **Scoped Commits**: Intelligent scope detection and formatting
|
|
76
|
+
- **Robust Parsing**: Advanced JSON parsing with automatic error recovery
|
|
77
|
+
|
|
78
|
+
**Commitlint Integration:**
|
|
60
79
|
|
|
61
80
|
- **Smart Detection**: Automatically finds commitlint config files (`.commitlintrc.*`, `commitlint.config.*`, or `package.json` with commitlint field)
|
|
62
81
|
- **AI-Aware Rules**: Passes your commitlint rules to the AI for better compliance from the start
|
|
63
82
|
- **Automatic Retry**: When validation fails, `coco` automatically retries generation with error feedback (up to 2 attempts)
|
|
83
|
+
- **Package Manager Compatibility**: Works seamlessly with npm, yarn, and pnpm (with automatic fallback for ES module issues)
|
|
64
84
|
- **User-Friendly Flow**: After auto-retries, offers options to try 2 more times or edit manually
|
|
65
85
|
- **Full Validation**: Both AI-generated and manually edited commit messages are validated against your rules
|
|
66
86
|
|
|
67
|
-
####
|
|
87
|
+
#### Command Options
|
|
88
|
+
|
|
89
|
+
**Basic Options:**
|
|
68
90
|
|
|
69
91
|
```bash
|
|
70
|
-
#
|
|
71
|
-
|
|
92
|
+
# Interactive mode - opens editor for review and editing
|
|
93
|
+
coco -i, --interactive
|
|
94
|
+
|
|
95
|
+
# Verbose output - shows detailed processing information
|
|
96
|
+
coco --verbose
|
|
97
|
+
|
|
98
|
+
# Help - display command help
|
|
99
|
+
coco --help
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
**Commit Enhancement Options:**
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
# Add content to the end of the generated commit message
|
|
72
106
|
coco --append "Resolves #128"
|
|
73
107
|
|
|
74
|
-
#
|
|
75
|
-
|
|
76
|
-
coco --append-ticket
|
|
108
|
+
# Automatically append Jira/Linear ticket ID from branch name
|
|
109
|
+
coco -t, --append-ticket
|
|
77
110
|
|
|
78
|
-
#
|
|
79
|
-
|
|
80
|
-
coco --additional "Resolves UX bug with sign up button"
|
|
111
|
+
# Add extra context to guide commit generation
|
|
112
|
+
coco -a, --additional "Resolves UX bug with sign up button"
|
|
81
113
|
|
|
82
|
-
#
|
|
83
|
-
|
|
84
|
-
|
|
114
|
+
# Include previous commits for context (specify number)
|
|
115
|
+
coco -p, --with-previous-commits 3
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
**Conventional Commits Options:**
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
# Force conventional commits mode
|
|
122
|
+
coco -c, --conventional
|
|
123
|
+
|
|
124
|
+
# Include/exclude branch name in context (default: true)
|
|
125
|
+
coco --include-branch-name
|
|
126
|
+
coco --no-include-branch-name
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
**Processing Options:**
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
# Ignore specific files (can be used multiple times)
|
|
133
|
+
coco --ignored-files "*.lock" --ignored-files "dist/*"
|
|
134
|
+
|
|
135
|
+
# Ignore file extensions (can be used multiple times)
|
|
136
|
+
coco --ignored-extensions ".map" --ignored-extensions ".min.js"
|
|
137
|
+
|
|
138
|
+
# Use basic git status instead of full diff (faster for large changes)
|
|
139
|
+
coco --no-diff
|
|
140
|
+
|
|
141
|
+
# Open commit message in editor before proceeding
|
|
142
|
+
coco --open-in-editor
|
|
85
143
|
```
|
|
86
144
|
|
|
87
145
|
### **`coco changelog`**
|
|
88
146
|
|
|
89
|
-
Creates changelogs.
|
|
147
|
+
Creates changelogs from commit history.
|
|
90
148
|
|
|
91
149
|
```bash
|
|
92
|
-
#
|
|
150
|
+
# Basic changelog for current branch
|
|
93
151
|
coco changelog
|
|
94
152
|
|
|
95
|
-
#
|
|
153
|
+
# Interactive mode
|
|
154
|
+
coco changelog -i, --interactive
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
#### Changelog Options
|
|
158
|
+
|
|
159
|
+
**Range Selection:**
|
|
160
|
+
|
|
161
|
+
```bash
|
|
162
|
+
# Specific commit range (HEAD references)
|
|
96
163
|
coco changelog -r HEAD~5:HEAD
|
|
97
164
|
|
|
98
|
-
#
|
|
165
|
+
# Specific commit range (commit hashes)
|
|
99
166
|
coco changelog -r abc1234:def5678
|
|
100
167
|
|
|
101
|
-
#
|
|
102
|
-
coco changelog -b
|
|
168
|
+
# Compare against target branch
|
|
169
|
+
coco changelog -b main, --branch main
|
|
103
170
|
|
|
104
|
-
#
|
|
105
|
-
coco changelog -t
|
|
171
|
+
# All commits since last tag
|
|
172
|
+
coco changelog -t, --since-last-tag
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
**Content Options:**
|
|
176
|
+
|
|
177
|
+
```bash
|
|
178
|
+
# Include diff for each commit in analysis
|
|
179
|
+
coco changelog --with-diff
|
|
180
|
+
|
|
181
|
+
# Generate changelog based only on branch diff
|
|
182
|
+
coco changelog --only-diff
|
|
183
|
+
|
|
184
|
+
# Include author attribution
|
|
185
|
+
coco changelog --author
|
|
186
|
+
|
|
187
|
+
# Add extra context to guide generation
|
|
188
|
+
coco changelog -a "Focus on user-facing changes" --additional "Focus on user-facing changes"
|
|
106
189
|
```
|
|
107
190
|
|
|
108
191
|
### **`coco recap`**
|
|
109
192
|
|
|
110
|
-
Summarize
|
|
193
|
+
Summarize changes across different time periods.
|
|
111
194
|
|
|
112
195
|
```bash
|
|
113
|
-
# Summarize
|
|
196
|
+
# Summarize current working directory changes
|
|
114
197
|
coco recap
|
|
115
198
|
|
|
116
|
-
#
|
|
117
|
-
coco recap
|
|
199
|
+
# Interactive mode
|
|
200
|
+
coco recap -i, --interactive
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
#### Recap Time Periods
|
|
204
|
+
|
|
205
|
+
```bash
|
|
206
|
+
# Yesterday's changes
|
|
207
|
+
coco recap --yesterday
|
|
208
|
+
|
|
209
|
+
# Last week's changes
|
|
210
|
+
coco recap --last-week, --week
|
|
211
|
+
|
|
212
|
+
# Last month's changes
|
|
213
|
+
coco recap --last-month, --month
|
|
214
|
+
|
|
215
|
+
# Changes since last git tag
|
|
216
|
+
coco recap --last-tag, --tag
|
|
217
|
+
|
|
218
|
+
# Current branch changes
|
|
219
|
+
coco recap --current-branch
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
### **`coco review`**
|
|
223
|
+
|
|
224
|
+
Perform AI-powered code review on your changes.
|
|
225
|
+
|
|
226
|
+
```bash
|
|
227
|
+
# Review current working directory changes
|
|
228
|
+
coco review
|
|
229
|
+
|
|
230
|
+
# Interactive mode
|
|
231
|
+
coco review -i, --interactive
|
|
232
|
+
|
|
233
|
+
# Review specific branch
|
|
234
|
+
coco review -b feature-branch, --branch feature-branch
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
### **`coco init`**
|
|
238
|
+
|
|
239
|
+
Interactive setup wizard for configuring coco.
|
|
240
|
+
|
|
241
|
+
```bash
|
|
242
|
+
# Setup wizard (will prompt for scope)
|
|
243
|
+
coco init
|
|
244
|
+
|
|
245
|
+
# Configure for current project only
|
|
246
|
+
coco init --scope project
|
|
247
|
+
|
|
248
|
+
# Configure globally for current user
|
|
249
|
+
coco init --scope global
|
|
118
250
|
```
|
|
119
251
|
|
|
120
252
|
### Stdout vs. Interactive Mode
|
|
@@ -137,13 +269,126 @@ coco -i
|
|
|
137
269
|
coco -s
|
|
138
270
|
```
|
|
139
271
|
|
|
272
|
+
### **Conventional Commits Examples**
|
|
273
|
+
|
|
274
|
+
`coco` excels at generating properly formatted conventional commits:
|
|
275
|
+
|
|
276
|
+
```bash
|
|
277
|
+
# Basic conventional commit
|
|
278
|
+
coco --conventional
|
|
279
|
+
# Output: feat: add user authentication system
|
|
280
|
+
|
|
281
|
+
# With scope
|
|
282
|
+
coco --conventional -a 'fixes login timeout'
|
|
283
|
+
# Output: fix(auth): resolve login timeout issue
|
|
284
|
+
|
|
285
|
+
# With additional context and ticket
|
|
286
|
+
coco --conventional --additional "Resolves login issues" --append-ticket
|
|
287
|
+
# Output: feat(auth): add OAuth2 integration
|
|
288
|
+
#
|
|
289
|
+
# Implement OAuth2 flow with Google and GitHub providers.
|
|
290
|
+
# Resolves login issues
|
|
291
|
+
#
|
|
292
|
+
# Part of **PROJ-123**
|
|
293
|
+
```
|
|
294
|
+
|
|
140
295
|
## Configuration
|
|
141
296
|
|
|
142
|
-
|
|
297
|
+
`coco` offers flexible configuration through multiple methods with a clear priority system. See the complete [Configuration Overview](CONFIG_OVERVIEW.md) for detailed setup instructions, all available options, and examples.
|
|
298
|
+
|
|
299
|
+
**Quick Start:**
|
|
300
|
+
|
|
301
|
+
```bash
|
|
302
|
+
# Interactive setup wizard
|
|
303
|
+
coco init
|
|
304
|
+
|
|
305
|
+
# Project-specific configuration
|
|
306
|
+
coco init --scope project
|
|
307
|
+
|
|
308
|
+
# Global user configuration
|
|
309
|
+
coco init --scope global
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
**Configuration Methods (in priority order):**
|
|
313
|
+
|
|
314
|
+
1. Command line flags (highest priority)
|
|
315
|
+
2. Environment variables
|
|
316
|
+
3. Project config (`.coco.config.json`)
|
|
317
|
+
4. Git config (`.gitconfig`)
|
|
318
|
+
5. XDG config directory (lowest priority)
|
|
319
|
+
|
|
320
|
+
**AI Providers:**
|
|
321
|
+
|
|
322
|
+
- **OpenAI**: GPT-4o, GPT-4o-mini, GPT-4 Turbo (API key required)
|
|
323
|
+
- **Anthropic**: Claude 3.5 Sonnet, Claude 3 Haiku (API key required)
|
|
324
|
+
- **Ollama**: Local models, no API costs, full privacy - [Setup Guide](USING_OLLAMA.md)
|
|
325
|
+
|
|
326
|
+
### **Ignoring Files & Extensions**
|
|
327
|
+
|
|
328
|
+
`coco` can ignore specific files and extensions to focus on meaningful changes. See the complete [Ignoring Files & Extensions Guide](IGNORING_FILES_EXTENSIONS.md) for detailed configuration options and examples.
|
|
329
|
+
|
|
330
|
+
**Quick Examples:**
|
|
331
|
+
|
|
332
|
+
```bash
|
|
333
|
+
# Command line flags
|
|
334
|
+
coco --ignored-files "*.lock" --ignored-extensions ".map"
|
|
335
|
+
|
|
336
|
+
# Config file
|
|
337
|
+
{
|
|
338
|
+
"ignoredFiles": ["package-lock.json", "dist/*"],
|
|
339
|
+
"ignoredExtensions": [".map", ".min.js"]
|
|
340
|
+
}
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
**Default Ignores:**
|
|
344
|
+
|
|
345
|
+
- Files: `package-lock.json` + contents of `.gitignore`
|
|
346
|
+
- Extensions: `.map`, `.lock`
|
|
347
|
+
|
|
348
|
+
## Troubleshooting
|
|
349
|
+
|
|
350
|
+
### **pnpm Compatibility**
|
|
351
|
+
|
|
352
|
+
If you encounter ES module errors with pnpm and commitlint:
|
|
353
|
+
|
|
354
|
+
```bash
|
|
355
|
+
# Update commitlint packages to latest versions
|
|
356
|
+
pnpm add -D @commitlint/config-conventional@latest @commitlint/cli@latest
|
|
357
|
+
|
|
358
|
+
# Or continue without commitlint validation
|
|
359
|
+
# coco will automatically fall back to built-in conventional commit rules
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
### **Conventional Commits Issues**
|
|
363
|
+
|
|
364
|
+
- **JSON Parsing Errors**: `coco` automatically repairs common JSON formatting issues from AI responses
|
|
365
|
+
- **Commitlint Validation**: If validation fails, `coco` provides clear error messages and retry options
|
|
366
|
+
- **Missing Dependencies**: `coco` gracefully handles missing commitlint packages with helpful installation guidance
|
|
367
|
+
|
|
368
|
+
## Documentation
|
|
369
|
+
|
|
370
|
+
For comprehensive guides, advanced usage, and detailed configuration options, visit our complete documentation:
|
|
371
|
+
|
|
372
|
+
### 📚 **[Coco Wiki](https://github.com/gfargo/coco/wiki)**
|
|
373
|
+
|
|
374
|
+
**Essential Guides:**
|
|
375
|
+
|
|
376
|
+
- **[Getting Started](https://github.com/gfargo/coco/wiki/Getting-Started)** - Complete beginner's guide from installation to first commit
|
|
377
|
+
- **[Configuration Overview](https://github.com/gfargo/coco/wiki/Config-Overview)** - All configuration options and setup methods
|
|
378
|
+
- **[Team Collaboration](https://github.com/gfargo/coco/wiki/Team-Collaboration)** - Enterprise deployment and team adoption strategies
|
|
379
|
+
- **[Using Ollama](https://github.com/gfargo/coco/wiki/Using-Ollama)** - Local AI setup for privacy and cost control
|
|
380
|
+
|
|
381
|
+
**Advanced Resources:**
|
|
382
|
+
|
|
383
|
+
- **[Advanced Usage](https://github.com/gfargo/coco/wiki/Advanced-Usage)** - Custom prompts, automation, and power-user features
|
|
384
|
+
- **[Troubleshooting](https://github.com/gfargo/coco/wiki/Troubleshooting)** - Solutions for common issues and debugging
|
|
385
|
+
- **[Ignoring Files & Extensions](https://github.com/gfargo/coco/wiki/Ignoring-Files-&-Extensions)** - Advanced file filtering and pattern matching
|
|
143
386
|
|
|
144
|
-
### **
|
|
387
|
+
### 🆘 **Need Help?**
|
|
145
388
|
|
|
146
|
-
|
|
389
|
+
- **[Troubleshooting Guide](https://github.com/gfargo/coco/wiki/Troubleshooting)** - Comprehensive problem-solving resource
|
|
390
|
+
- **[GitHub Issues](https://github.com/gfargo/coco/issues)** - Bug reports and feature requests
|
|
391
|
+
- **[Discord Community](https://discord.gg/KGu9nE9Ejx)** - Real-time help and discussion
|
|
147
392
|
|
|
148
393
|
## Contribution
|
|
149
394
|
|
package/dist/index.esm.mjs
CHANGED
|
@@ -47,7 +47,7 @@ import { pathToFileURL } from 'url';
|
|
|
47
47
|
/**
|
|
48
48
|
* Current build version from package.json
|
|
49
49
|
*/
|
|
50
|
-
const BUILD_VERSION = "0.22.
|
|
50
|
+
const BUILD_VERSION = "0.22.11";
|
|
51
51
|
|
|
52
52
|
const isInteractive = (config) => {
|
|
53
53
|
return config?.mode === 'interactive' || !!config?.interactive;
|
package/dist/index.js
CHANGED
|
@@ -69,7 +69,7 @@ var readline__namespace = /*#__PURE__*/_interopNamespaceDefault(readline);
|
|
|
69
69
|
/**
|
|
70
70
|
* Current build version from package.json
|
|
71
71
|
*/
|
|
72
|
-
const BUILD_VERSION = "0.22.
|
|
72
|
+
const BUILD_VERSION = "0.22.11";
|
|
73
73
|
|
|
74
74
|
const isInteractive = (config) => {
|
|
75
75
|
return config?.mode === 'interactive' || !!config?.interactive;
|