gitsage v1.0.0
GitSage
An intelligent Git commit message generator powered by OpenAI's GPT-4. This tool analyzes your staged changes and automatically generates meaningful, conventional commit messages.
Features
- 🤖 AI-powered commit message generation
- 📝 Conventional commit format support
- 🔍 Smart change analysis and grouping
- ✨ Interactive commit message selection
- 🛠️ Easy configuration and setup
Quick Start
You can use gitsage directly without installation using npx:
npx gitsage
Optional Installation
If you prefer, you can install the package globally:
npm install -g gitsage
Configuration
Before using gitsage, you'll need to configure your OpenAI API key. The tool will prompt you for the key on first use, or you can set it up manually:
- Get your API key from OpenAI's platform
- The tool will automatically store your API key securely for future use
Usage
- (Optional) Stage your changes using git add:
git add <files>
- Run gitsage:
gitsage
- Review and confirm the generated commit messages
Note: If no changes are staged, gitsage will automatically help you select which files to stage through an interactive interface. This makes the staging process optional and more user-friendly.
How It Works
- Analyzes staged Git changes
- Splits large diffs into manageable chunks
- Uses GPT-4 to analyze changes and generate appropriate commit messages
- Groups related changes together
- Presents commit suggestions for your approval
- Creates commits using conventional commit format
Commit Types
The tool generates commits following the conventional commits specification:
feat
: New featuresfix
: Bug fixesdocs
: Documentation changesstyle
: Code style changes (formatting, etc.)refactor
: Code refactoringperf
: Performance improvementstest
: Adding or updating testschore
: Maintenance tasks
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes using the tool itself! (
gitsage
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
- Powered by OpenAI's GPT-4
- Inspired by conventional commits
- Built with TypeScript and Node.js
4 months ago