Commita-AI is a CLI tool designed to streamline your Git commit process by leveraging AI to summarize changes and generate meaningful commit messages. It supports conventional commit types and allows for custom messages or AI-generated summaries.
- Automatically summarize staged changes using AI.
- Generate commit messages following conventional commit standards.
- Configure your OpenAI API key for AI-powered features.
Clone the repository and build the binary:
go install github.com/guths/commita-ai
Before using Commita-AI, you need to configure your OpenAI API key.
-
Run the configuration command:
commita-ai config
-
This will create a configuration file at:
~/.config/commitaai/config.yaml
-
Open the file and replace
YOUR-API-KEY
with your actual OpenAI API key:open_api_key: YOUR-API-KEY
Commita-AI provides commands to help you commit changes efficiently.
To commit changes, use the c
command:
./commita-ai c -t <type> [-m <custom-message>]
-t, --type
: Specify the commit type (e.g.,feat
,fix
,chore
,docs
,test
).-m, --message
: Provide a custom commit message (optional) (do not use ia).
-
Commit with AI-generated summary:
./commita-ai c -t feat
-
Commit with a custom message:
./commita-ai c -t fix -m "Fixed a critical bug in the payment module"
Here’s a simple representation of how Commita-AI works:
| Staged Changes |
↓
| Git Diff |
↓
| AI Summarization |
↓
| Commit Message |
↓
| Git Commit |
feat
: New featuresfix
: Bug fixeschore
: Maintenance tasksdocs
: Documentation updatestest
: Adding or updating tests
Feel free to open issues or submit pull requests to improve Commita-AI.
This project is licensed under the MIT License.