GitMind is a command-line interface (CLI) tool designed to automate the generation of Conventional Commits using Artificial Intelligence. It analyzes staged changes in your git repository and leverages Large Language Models (LLMs) to propose concise, standardized commit messages.
The tool supports multiple AI providers, including Google Gemini, OpenAI, and local inference via Ollama, making it adaptable to various workflows and privacy requirements.
- AI-Powered Analysis: Generates context-aware commit messages based on
git diff. - Conventional Commits: Strictly adheres to the Conventional Commits specification (feat, fix, chore, breaking changes, etc.).
- Multi-Provider Support: Seamless integration with Google Gemini, OpenAI, and Ollama.
- Interactive Workflow: Review, edit, or regenerate commit messages before finalizing.
- Git Integration: Automates committing and pushing changes upon user approval.
- Local Configuration: Persists user preferences and API keys locally.
To install GitMind globally on your system, ensure you have Node.js (version 18 or higher) installed, then run:
npm install -g gitmindAlternatively, you can run it directly using npx:
npx gitmindBefore using GitMind, you must configure your preferred AI provider. The CLI provides a guided configuration process.
Run the following command to start the interactive setup wizard:
gitmind configYou will be prompted to select a provider (Google, OpenAI, Anthropic, or Ollama) and enter your API credentials and preferred model.
You can also configure settings directly via command-line flags:
Google Gemini
gitmind config --provider google --api-key YOUR_API_KEY --model gemini-2.5-flashOpenAI
gitmind config --provider openai --api-key YOUR_API_KEY --model gpt-4oOllama (Local) For Ollama, the API key field is used to specify the Base URL (defaulting to http://127.0.0.1:11434).
gitmind config --provider ollama --model llama3To view your current configuration:
gitmind listGitMind analyzes files currently staged in git. First, add the files you intend to commit:
git add .Run the generation command:
gitmind genThe tool will:
- Analyze the staged diff.
- Generate a commit message proposal.
- Display the proposal for your review.
You will be presented with the following options:
- Confirm and Commit: Accepts the message and creates the commit.
- Edit Message: Allows you to manually modify the type, scope, subject, body, or footer.
- Cancel: Aborts the operation.
After a successful commit, the tool will ask if you wish to push the changes to the remote repository immediately.
To contribute or modify the source code, follow these steps:
-
Clone the repository
git clone https://github.com/vittordeaguiar/gitmind.git cd gitmind -
Install dependencies
npm install
-
Build the project
npm run build
-
Run tests
npm test -
Run locally
npm start -- gen
This project is licensed under the ISC License.