git-coco 0.22.10 → 0.23.0

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 CHANGED
@@ -10,140 +10,134 @@
10
10
  [![Last Commit](https://img.shields.io/github/last-commit/gfargo/coco)](https://github.com/gfargo/coco/tree/main)
11
11
  [![Discord](https://img.shields.io/discord/1176716060825767948)](https://discord.gg/KGu9nE9Ejx)
12
12
 
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.
13
+ An AI-powered git assistant that generates meaningful commit messages, creates changelogs, and streamlines your development workflow.
14
14
 
15
- Currently `coco` generates commit messages, creates changelogs, summarizes code changes, perform code review, and more - with new features being added regularly!
15
+ **✨ Key Features:**
16
16
 
17
- ## Commands
18
-
19
- - **`commit`**: generates commit messages based on staged changes.
20
-
21
- - **`changelog`**: create changelogs for the current branch or a range of commits.
22
-
23
- - **`recap`**: summarize changes from working-tree, or yesterday, or in the last month, or since the last tag.
17
+ - 🤖 **AI-Powered Commit Messages** - Generate contextual commits from your staged changes
18
+ - 📋 **Conventional Commits** - Full support with automatic validation and formatting
19
+ - 🔧 **Commitlint Integration** - Seamless integration with your existing commitlint configuration
20
+ - 🏠 **Local AI Support** - Run completely offline with Ollama (no API costs, full privacy)
21
+ - 📦 **Package Manager Friendly** - Works with npm, yarn, and pnpm
22
+ - 👥 **Team Ready** - Shared configurations and enterprise deployment
24
23
 
25
- - **`review`**: perform a code review on the changes in the working directory.
24
+ ## Quick Start
26
25
 
27
- - **`init`**: step by step wizard to set up `coco` globally or for a project.
28
-
29
- - **`help`**: display help for `coco` commands.
30
-
31
- ## Getting Started
26
+ ```bash
27
+ # Try without installing
28
+ npx git-coco@latest init
32
29
 
33
- **`coco init`** is the first step to getting started with `coco`. It will guide you through the installation process, including setting up your OpenAI API key and configuring `coco` to your preferences.
30
+ # Install globally
31
+ npm install -g git-coco
34
32
 
35
- ```bash
36
- # For local project use
37
- npx git-coco@latest init -l project
33
+ # Setup and configure
34
+ coco init
38
35
 
39
- # For global use
40
- npx git-coco@latest init -l global
36
+ # Generate your first commit
37
+ git add .
38
+ coco -i
41
39
  ```
42
40
 
43
- ## Usage
41
+ ## Commands
42
+
43
+ - **`coco commit`** - Generate commit messages from staged changes
44
+ - **`coco changelog`** - Create changelogs from commit history
45
+ - **`coco recap`** - Summarize recent changes and activity
46
+ - **`coco review`** - AI-powered code review of your changes
47
+ - **`coco init`** - Interactive setup wizard
44
48
 
45
- ### **`coco commit`**
49
+ ## Usage Examples
46
50
 
47
- Generates commit messages based on staged changes with intelligent commitlint integration.
51
+ ### Basic Workflow
48
52
 
49
53
  ```bash
50
- coco
54
+ # Make your changes
55
+ git add .
51
56
 
52
- # or
57
+ # Generate commit message (interactive mode recommended)
58
+ coco -i
53
59
 
54
- coco commit
60
+ # Or use stdout mode
61
+ git commit -m "$(coco)"
55
62
  ```
56
63
 
57
- #### Commitlint Integration
58
-
59
- `coco` automatically detects and integrates with your project's commitlint configuration:
60
-
61
- - **Smart Detection**: Automatically finds commitlint config files (`.commitlintrc.*`, `commitlint.config.*`, or `package.json` with commitlint field)
62
- - **AI-Aware Rules**: Passes your commitlint rules to the AI for better compliance from the start
63
- - **Automatic Retry**: When validation fails, `coco` automatically retries generation with error feedback (up to 2 attempts)
64
- - **User-Friendly Flow**: After auto-retries, offers options to try 2 more times or edit manually
65
- - **Full Validation**: Both AI-generated and manually edited commit messages are validated against your rules
66
-
67
- #### Useful options
64
+ ### Conventional Commits
68
65
 
69
66
  ```bash
70
- # --append
71
- # Add content to the end of the generated commit
72
- coco --append "Resolves #128"
73
-
74
- # --append-ticket
75
- # Automatically append Jira/Linear ticket ID from the branch name to the commit message
76
- coco --append-ticket
67
+ # Enable conventional commits format
68
+ coco --conventional
77
69
 
78
- # --additional
79
- # Add extra context before generating the commit
80
- coco --additional "Resolves UX bug with sign up button"
70
+ # With additional context
71
+ coco -a "Fixes login timeout" --conventional
81
72
 
82
- # --conventional
83
- # Force conventional commits mode (also enabled automatically with commitlint config)
84
- coco --conventional
73
+ # Include ticket from branch name
74
+ coco --append-ticket --conventional
85
75
  ```
86
76
 
87
- ### **`coco changelog`**
88
-
89
- Creates changelogs.
77
+ ### Team Workflows
90
78
 
91
79
  ```bash
92
- # For the current branch
93
- coco changelog
80
+ # Generate changelog for releases
81
+ coco changelog --since-last-tag
94
82
 
95
- # For a specific range (using HEAD references)
96
- coco changelog -r HEAD~5:HEAD
83
+ # Summarize recent work
84
+ coco recap --yesterday
97
85
 
98
- # For a specific range (using commit hashes)
99
- coco changelog -r abc1234:def5678
100
-
101
- # For a target branch
102
- coco changelog -b other-branch
103
-
104
- # For all commits since the last tag
105
- coco changelog -t
86
+ # Code review before committing
87
+ coco review
106
88
  ```
107
89
 
108
- ### **`coco recap`**
90
+ ## Configuration
109
91
 
110
- Summarize the working-tree, or other configured ranges
92
+ Configure `coco` for your workflow with the interactive setup wizard:
111
93
 
112
94
  ```bash
113
- # Summarize all working directory changes
114
- coco recap
95
+ # Setup wizard
96
+ coco init
115
97
 
116
- # Or these available ranges
117
- coco recap --yesterday | --last-week | --last-month | --last-tag
98
+ # Project-specific setup
99
+ coco init --scope project
118
100
  ```
119
101
 
120
- ### Stdout vs. Interactive Mode
121
-
122
- `coco` offers two modes of operation: **stdout** and **interactive**, defaulting to **stdout**. You can specify your preferred mode in your config file or via command line flags.
123
-
124
- ```bash
125
- # Stdout mode
126
- git commit -m $(coco)
127
-
128
- # Interactive mode
129
- coco -i
102
+ **AI Providers:**
103
+ - **OpenAI** - GPT-4o, GPT-4o-mini (API key required)
104
+ - **Anthropic** - Claude 3.5 Sonnet (API key required)
105
+ - **Ollama** - Local models, no API costs, full privacy
106
+
107
+ **Example Configuration:**
108
+ ```json
109
+ {
110
+ "mode": "interactive",
111
+ "conventionalCommits": true,
112
+ "service": {
113
+ "provider": "openai",
114
+ "model": "gpt-4o"
115
+ }
116
+ }
130
117
  ```
131
118
 
132
- ### Generate and commit all in one
119
+ ## Documentation
133
120
 
134
- `coco` can generate and commit your changes in one command.
121
+ For comprehensive guides, advanced usage, and detailed configuration options, visit our complete documentation:
135
122
 
136
- ```bash
137
- coco -s
138
- ```
123
+ ### 📚 **[Coco Wiki](https://github.com/gfargo/coco/wiki)**
139
124
 
140
- ## Configuration
125
+ **Essential Guides:**
126
+ - **[Getting Started](https://github.com/gfargo/coco/wiki/Getting-Started)** - Complete beginner's guide from installation to first commit
127
+ - **[Command Reference](https://github.com/gfargo/coco/wiki/Command-Reference)** - Detailed command options and examples
128
+ - **[Configuration Overview](https://github.com/gfargo/coco/wiki/Config-Overview)** - All configuration options and setup methods
129
+ - **[Team Collaboration](https://github.com/gfargo/coco/wiki/Team-Collaboration)** - Enterprise deployment and team adoption strategies
141
130
 
142
- The `.coco.config` documentation has moved to our [wiki](https://github.com/gfargo/coco/wiki/Config-Overview). Here, you'll find detailed information on setting up and customizing your experience.
131
+ **Advanced Resources:**
132
+ - **[Using Ollama](https://github.com/gfargo/coco/wiki/Using-Ollama)** - Local AI setup for privacy and cost control
133
+ - **[Advanced Usage](https://github.com/gfargo/coco/wiki/Advanced-Usage)** - Custom prompts, automation, and power-user features
134
+ - **[Troubleshooting](https://github.com/gfargo/coco/wiki/Troubleshooting)** - Solutions for common issues and debugging
143
135
 
144
- ### **Ignoring Files**
136
+ ### 🆘 **Need Help?**
145
137
 
146
- You can specify files to be ignored when generating commit messages by adding them to your config file or via command line flags. Read more about ignoring files & extensions in the [wiki](https://github.com/gfargo/coco/wiki/Ignoring-Files-&-Extensions).
138
+ - **[Troubleshooting Guide](https://github.com/gfargo/coco/wiki/Troubleshooting)** - Comprehensive problem-solving resource
139
+ - **[GitHub Issues](https://github.com/gfargo/coco/issues)** - Bug reports and feature requests
140
+ - **[Discord Community](https://discord.gg/KGu9nE9Ejx)** - Real-time help and discussion
147
141
 
148
142
  ## Contribution
149
143
 
@@ -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.10";
50
+ const BUILD_VERSION = "0.23.0";
51
51
 
52
52
  const isInteractive = (config) => {
53
53
  return config?.mode === 'interactive' || !!config?.interactive;
@@ -11557,6 +11557,10 @@ const handler$3 = async (argv, logger) => {
11557
11557
  },
11558
11558
  factory,
11559
11559
  parser,
11560
+ reviewParser: (result) => {
11561
+ // Ensure the result is properly formatted as a string for display
11562
+ return typeof result === 'string' ? result : String(result);
11563
+ },
11560
11564
  agent: async (context, options) => {
11561
11565
  // Select the appropriate schema based on whether conventional commits are enabled
11562
11566
  const schema = USE_CONVENTIONAL_COMMITS
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.10";
72
+ const BUILD_VERSION = "0.23.0";
73
73
 
74
74
  const isInteractive = (config) => {
75
75
  return config?.mode === 'interactive' || !!config?.interactive;
@@ -11579,6 +11579,10 @@ const handler$3 = async (argv, logger) => {
11579
11579
  },
11580
11580
  factory,
11581
11581
  parser,
11582
+ reviewParser: (result) => {
11583
+ // Ensure the result is properly formatted as a string for display
11584
+ return typeof result === 'string' ? result : String(result);
11585
+ },
11582
11586
  agent: async (context, options) => {
11583
11587
  // Select the appropriate schema based on whether conventional commits are enabled
11584
11588
  const schema = USE_CONVENTIONAL_COMMITS
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "git-coco",
3
- "version": "0.22.10",
3
+ "version": "0.23.0",
4
4
  "description": "zero-effort git commits with coco.",
5
5
  "author": "gfargo <ghfargo@gmail.com>",
6
6
  "license": "MIT",