committy
v1.0.3
Published
Smart git commit assistant powered by OpenAI
Maintainers
Readme
Committy
Smart git commit assistant powered by OpenAI that analyzes your changes and suggests meaningful commit messages.
Features
- Smart Analysis: Uses OpenAI to analyze git diffs and generate contextual commit messages
- Interactive Workflow: Guides you through staging changes and reviewing commit messages
- Change Grouping: Automatically groups related changes into logical commits
- Flexible Staging: Stage individual hunks or entire files
- Message Editing: Edit generated messages or regenerate them as needed
- Environment Config: Supports custom OpenAI endpoints and API keys
Installation
Install globally via npm:
npm install -g committyOr install locally:
npm install committyConfiguration
Set up your OpenAI API key:
export COMMITTY_OPENAI_API_KEY=your_openai_api_keyOr use the standard OpenAI environment variable:
export OPENAI_API_KEY=your_openai_api_keyFor custom OpenAI endpoints (optional):
export COMMITTY_OPENAI_BASE_URL=https://your-custom-endpoint.com
export OPENAI_BASE_URL=https://your-custom-endpoint.comUsage
- Navigate to your git repository
- Run
committy - Follow the interactive prompts
The tool will:
- First handle any staged changes and generate a commit message
- Then analyze unstaged changes and group them by topic
- Ask you to confirm staging each group
- Generate a commit message for each staged group
- Allow you to edit or regenerate messages before committing
How It Works
- Staged Changes: If you have staged changes, committy will generate a commit message for them first
- Unstaged Changes: Analyzes unstaged changes and groups them by topic using AI
- Interactive Review: Shows you a preview of each group and asks if you want to stage it
- Message Generation: Generates a concise commit message for each group
- Editing Options: Allows you to edit messages, regenerate them, or use them as-is
Requirements
- Node.js >= 14.0.0
- Git repository
- OpenAI API key
License
ISC
