ai-commit-gen
v1.0.1
Published
AI-powered commit message generator using OpenAI. Get meaningful and structured commit messages in seconds!
Readme
@aigen/commit-gen 🚀
AI-powered commit message generator using OpenAI. Get meaningful and structured commit messages in seconds!
✨ Features
✅ AI-generated Commit Messages – Get clear and structured commit messages based on your Git changes.
✅ Conventional Commit Format – Generates messages following best practices.
✅ Interactive Workflow – Review and confirm before committing.
✅ Secure API Key Storage – Stores your OpenAI API key locally.
🚀 Installation
No need to install globally. Use it directly via npx:
npx @aigen/commit-gen generate # Generate commit messageAlternatively, install globally:
npm install -g @aigen/commit-gen🔥 Usage
- When you run the generate command for the first time it will prompt you to add your OpenAI API key.
Generate a Commit Message
npx @aigen/commit-gen generate
// or
npx @aigen.commit-gen gConfigure OpenAI API Key
npx @aigen/commit-gen configureThis securely stores your API key in ~/.env.
Commit with AI-generated Message
git add .
npx @aigen/commit-gen generateAfter generating the commit message, you’ll be asked to confirm before it is committed.
🔍 How It Works
- Analyzes Git staged changes
(git diff --staged). - Sends the diff to the OpenAI API for analysis.
- Generates a structured and meaningful commit message.
- Prompts for user confirmation before committing.
🔒 Security
Your OpenAI API key is stored locally in ~/.env and never shared or transmitted elsewhere.
The tool only analyzes staged Git changes, ensuring sensitive files remain untouched.
🤝 Contributing
PRs are welcome! If you’d like to improve the tool, check out CONTRIBUTING.md for guidelines.
📜 License
This project is licensed under the MIT License. See LICENSE for details.
