Skip to content

Commit

Permalink
Merge pull request #3 from gitset-dev/feat/custom-mode-gitset-cli
Browse files Browse the repository at this point in the history
feat(cli): Add custom commit message mode
  • Loading branch information
imprvhub authored Jan 9, 2025
2 parents 8c0d635 + 4106565 commit cf15358
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 9 deletions.
49 changes: 44 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@
</a>
<br>
<br>
<p><em>Generate semantic commit messages using AI-driven analysis of staged code changes.</em></p>
<p><em>Generate commit messages using AI-driven analysis - now with style adaptation!</em></p>
</div>

## Features

- 🤖 AI-powered commit message generation
- 📝 Semantic commit message formatting
- 🎨 Personal style adaptation (New!)
- 🔍 Smart analysis of staged changes
- 🚀 Fast and lightweight
- 💻 Cross-platform support
Expand All @@ -37,7 +38,11 @@ git add .

2. Generate a commit message:
```bash
# Semantic mode (default)
gitset suggest

# Custom style mode
gitset suggest --mode custom
```

3. Review and use the generated message:
Expand All @@ -48,7 +53,7 @@ git commit -m "your generated message"
## Examples

```bash
# Basic usage
# Semantic mode (default)
$ gitset suggest
✨ Suggested message:
------------------
Expand All @@ -57,13 +62,47 @@ feat: Add user authentication feature with JWT support
- Implement JWT token generation and validation
- Add login and signup endpoints
- Create middleware for route protection

# Custom style mode
$ gitset suggest --mode custom
✨ Suggested message:
------------------
[Auth] Added JWT user authentication 🔐

Implemented token system, added login/signup routes,
and set up protection middleware! Ready for testing.
```

## Requirements

- Node.js >= 18.0.0
- Git installed and configured

## Commit Message Modes

### Semantic Mode (Default)
The default mode follows conventional commit standards to generate structured, semantic commit messages. Perfect for maintaining a clean and standard Git history in professional projects.

### Custom Mode
Custom mode analyzes your previous commit messages and adapts to your personal writing style:
- Studies your last commits (default: 20) to understand your patterns
- Learns from your formatting, tone, and structure
- Maintains your sequential patterns if you use them
- Adapts emoji usage based on your style
- Preserves your capitalization and punctuation preferences
- Keeps descriptive content while matching your style

Example of style adaptation:
```bash
# If your commits look like this:
FEATURE_123: added login page 🚀
FEATURE_124: updated navbar design ✨
FEATURE_125: fixed routing issues 🔧

# Custom mode will generate similar style:
FEATURE_126: implemented user settings 🎯
```

## Configuration

No additional configuration needed. The CLI automatically detects your Git repository and staged changes.
Expand All @@ -76,6 +115,8 @@ No additional configuration needed. The CLI automatically detects your Git repos

### Options

- `--mode <mode>` - Choose between 'semantic' (default) or 'custom' style
- `--commit-count <count>` - Number of previous commits to analyze (default: 20)
- `--version` - Show CLI version
- `--help` - Show help information

Expand Down Expand Up @@ -112,8 +153,6 @@ This project is licensed under the Mozilla Public License 2.0 - see the [LICENSE

- Thanks to all our contributors
- Built with [Commander.js](https://github.com/tj/commander.js)
- Powered by Anthropic's Claude AI
- Powered by Google's Gemini Pro

---

Made with ❤️ by [Gitset.dev](https://gitset.dev)
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@gitset-dev/cli",
"version": "1.0.0",
"version": "1.1.0",
"description": "Generate semantic commit messages using AI-driven analysis of staged code changes.",
"main": "src/index.js",
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ async function generateCommitMessage(options) {
program
.name('gitset')
.description('Smart AI Docs & Versioning for GitHub Repositories.')
.version('1.0.0');
.version('1.1.0');

program
.command('suggest')
Expand Down

0 comments on commit cf15358

Please sign in to comment.