Generates auto commit messages with Polyfact
npm install @polyfact/ai-gitGit AI is a tool that helps generate commit messages using AI. It simplifies the commit process by automatically generating a short, descriptive commit message based on your code changes.
- Analyzes staged git diffs and generates a commit message summarizing the changes
- Leverages Polyfact's AI API to generate natural language
- Handles large diffs by splitting into multiple API requests
- Customizable options like commit message language, model name, etc.
- Auto-commit mode to directly commit the generated message
- Optional git commit --amend to open editor and refine message
- Node.js
- Git CLI
- Polyfact Token
```
npm install -g @polyfact/git-ai
or
``
yarn global add @polyfact/git-ai
Create a .ai-gitrc file to customize options.
``
ai-git init-config
Or set options as CLI flags:
``
ai-git commit --token YOUR_TOKEN --language english --model gpt-3.5-turbo
`Auto generate and commit
ai-git commit
Configuration
The CLI and config file options allow customizing the commit message generation:
-
token - Polyfact API key
- model - AI model name
- maxTokens - Max tokens per API request
- language - Commit message language
- autocommit - Directly create commit
- editor - Open editor after commit
- exclude - Patterns to exclude from diff
- filter - Git diff filter flag
- template` - Prompt template for AI