AI Commit Message Generator is a tool that uses an AI model to generate commit messages based on the staged changes in your Git repository. It leverages the Ollama model to create concise, informative commit messages that follow best practices in version control.
git-commit-gen.mp4
- Generates commit messages using the Ollama AI model
- Supports various commit message types (feat, fix, refactor, etc.)
- Provides a detailed explanation of changes in bullet points
- Focuses on major changes and uses technical, precise language
- Interactive prompt to proceed with the commit, regenerate the message, or discard it
- Clone the repository:
git clone https://github.com/ssk090/ai-commit-gen.git cd ai-commit-gen
- Install the dependencies:
npm install
-
Ensure you have staged changes in your Git repository:
git add .
-
Run the AI Commit Message Generator:
node index.js
-
Follow the interactive prompt to proceed with the commit, regenerate the message, or discard it.
✨ Generating commit message... -------------------------------------------------- feat(package.json): update package.json with ai-commit-gen information - added new package name and version - updated scripts to include test command - set author and license details - impact: enables accurate dependency tracking for ai-commit-gen project Proceed to commit? [y(yes) | n(no) | r(regenerate)] ›
-
Choose an action:
y
oryes
: Proceed with the commitn
orno
: Discard the AI-generated commit messager
orregenerate
: Regenerate the commit message
- The tool uses the following configuration files:
commands.js
: Defines the shell commands used by the tool.systemPrompt.js
: Contains the system prompt used by the AI model to generate commit messages.index.js
: Main file that orchestrates the commit message generation process.