cgmt
v1.0.0
Published
AI-powered CLI to generate git commit messages
Maintainers
Readme
Commit Generate Message Tool
Commit Generate Message Tool (cgmt) is an AI-powered CLI tool that generates professional git commit messages from your staged changes using Ollama models. It produces conventional commit messages.
Features
- Generates conventional commit messages automatically
- Supports optional body for explanations
- Configurable default AI model
- Handles large diffs safely
- Cross-platform (Windows, macOS, Linux)
- Professional CLI logging with colors
Prerequisites
Before using Commit Gen, make sure you have the following installed:
- Node.js (v16+ recommended)
- Git
- Ollama — required for running local AI models
Download here: https://ollama.com/download
Installation
Install globally via npm:
npm install -g cgmtUsage
Generate a commit message for your staged changes:
git add .
cgmtOptional flags:
--model <model_name>: Specify the Ollama AI model to use--limit <number>: Limit the number of characters from the git diff sent to AI--help, -h: Show help
Examples:
cgmt
cgmt --model gemma3
cgmt --limit 5000Configuration
Set or get the default model:
cgmt config --model gemma3
cgmt config --getConfiguration is stored at:
- macOS/Linux: ~/.config/cgmt/config.json
- Windows: %APPDATA%/cgmt/config.json
Development
Clone the repo and install dependencies:
git clone https://github.com/daniel-mad/cgmt.git
cd cgmt
npm installTest the CLI locally:
npm install -g .
cgmt --helpFolder Structure
cgmt/
├─ bin/
│ └─ cli.js # CLI entry with shebang
├─ src/
│ ├─ commit.js # AI commit generation
│ ├─ config.js # Config management
│ ├─ logger.js # CLI logging
│ └─ systemPrompt.js # AI system prompt
├─ package.json
└─ README.txtLicense
MIT
