1.0.2 • Published 4 months ago
gpt-auto-commit v1.0.2
✌️ GPT Auto Commit
A cute little CLI tool that uses OpenAI's GPT-4 to ✨automatically✨ generate commit messages.
✨ Features
- One command, instant commit messages
- Edit a message in interactive mode
- Only checks staged changes
- Follows Conventional Commits to make you look good
- Clean, colorful CLI for smooth workflow
- Progress bars so you're never left hanging
📦 Installation
npm install -g gpt-auto-commit
🔑 API Key & Pricing
This tool requires an OpenAI API key to function. Here's what you need to know:
- Sign up for an OpenAI account
- Create a new API key
Also just a heads up that this does cost money:
🛠️ Setup
Before using the tool, you gotta configure your OpenAI API key:
gpt-auto-commit config --key YOUR_OPENAI_API_KEY
# or use the shorthand
gpc config --key YOUR_OPENAI_API_KEY
🚀 Usage
Quick Commit (Recommended)
Run gpc
in your git repository to automatically generate and commit your changes:
gpc
This will:
- Analyze your staged changes
- Generate a commit message
- Automatically commit with the generated message
Interactive Mode
If you want to review or edit the commit message before committing:
gpc generate
This will:
- Generate a commit message
- Give you options to:
- Press
c
to commit as is - Press
e
to edit the message - Press
q
to quit without committing
- Press
📝 Commands
All commands can be used with either gpt-auto-commit
or the shorthand gpc
:
gpc
- Quick generate and commit (default)gpc generate
- Interactive mode with edit optionsgpc config --key <key>
- Set your OpenAI API keygpc --help
- Show help information