@yuankui/auto-commit
v1.1.0
Published
AI-powered git commit message generator
Maintainers
Readme
Auto Commit
A TypeScript tool that helps generate commit messages using ChatGPT API.
Features
- Automatically detects changes in your git repository
- Uses OpenAI's GPT model to suggest commit messages based on your changes
- Interactive CLI to choose from suggested commit messages
- Automatically commits changes with the selected message
Setup
- Install the package:
npm install -g @yuankui/auto-commit- Run the tool:
auto-commitOn first run, you'll be prompted to enter your OpenAI API key. The key will be saved in ~/.auto-commit.env for future use.
Development Setup
- Install dependencies:
npm install- Copy
.env.exampleto.envand add your OpenAI API key:
cp .env.example .envThen edit .env and add your OpenAI API key:
OPENAI_API_KEY=your_api_key_hereUsage
When you have changes you want to commit, simply run:
npm run devThe tool will:
- Check for changes in your repository
- Generate commit message suggestions using ChatGPT
- Let you choose from the suggested messages
- Automatically commit your changes with the selected message
Development
- Build the project:
npm run build- Format code:
npm run format- Check code formatting:
npm run format:check