Skip to content

High-performance AI-powered Git commit assistant with pluggable architecture. Cross-platform compatibility with zero-dependency binary and intelligent commit analysis. Written in Go. Built for every stack.

License

Notifications You must be signed in to change notification settings

Cre4T3Tiv3/gocmitra

Repository files navigation

GoC Mitra social preview

An AI-powered Git commit assistant that analyzes your code changes and generates smart, conventional commits right from your terminal.

CI Go Version Latest Tag License: MIT GitHub Stars Contributions welcome


About

GoC Mitra is your Git commit assistant. A developer-friendly CLI tool powered by AI that turns your Git diffs into clear, conventional, single-line commit messages. Built in Go and designed for developers who live in the terminal.

Supports:

  • OpenAI (GPT-4o, GPT-3.5, etc.)
  • Claude (3, 3.5)
  • Ollama (LLaMA 3 and other local models)

Installation

ℹ️ Requires Go 1.21 or higher.

git clone https://github.com/Cre4T3Tiv3/gocmitra.git
cd gocmitra
go build -o cmd/gocmitra/gocmitra ./cmd/gocmitra

Add to your $PATH or symlink to a local bin:

sudo ln -s $(pwd)/cmd/gocmitra/gocmitra /usr/local/bin/gocmitra

ℹ️ This places the compiled binary in cmd/gocmitra/, keeping the root of your repo clean.


Configuration

GoC Mitra looks for a .gocmitra.json config file in your project or home directory.

This file is automatically generated when you select a model using:

gocmitra config set-model gpt-4o

The command copies a predefined config from profiles/.gocmitra-<model>.json into your local .gocmitra.json.

You can also pass a custom path using the --config flag.

Example config:

{
  "model": "gpt-4o",
  "endpoint": "https://api.openai.com/v1/chat/completions",
  "tone": "neutral",
  "style": "conventional",
  "instructions": "You are an assistant that writes commit messages..."
}

Prebuilt model configs are available in the profiles/ directory.


Usage

Use the diff command to generate a commit message from your Git changes.

Examples

# Generate a commit message from all unstaged and staged changes
gocmitra diff
# Generate a commit message from only staged changes
gocmitra diff --staged
# Use a custom config file
gocmitra diff --config ~/.gocmitra.json
# Override the model temporarily
gocmitra diff --model claude-3-5-sonnet-20241022

ℹ️ Note: The --staged flag corresponds to git diff --staged, which only includes changes you've staged with git add.

To change the default model and regenerate the config file:

gocmitra config set-model gpt-4o

Shell Completion

GoC Mitra supports shell autocompletion for Bash, Zsh, Fish, and PowerShell.

Bash

gocmitra completion bash > /etc/bash_completion.d/gocmitra
# or for user-level
gocmitra completion bash > ~/.gocmitra_completion && source ~/.gocmitra_completion

Zsh

gocmitra completion zsh > "${fpath[1]}/_gocmitra"

Fish

gocmitra completion fish | source

ℹ️ Run gocmitra completion --help to view all shell options.


Supported LLMs

Provider Model Name Notes
OpenAI gpt-4o Requires OPENAI_API_KEY
Anthropic claude-3-5-sonnet-20241022 Requires CLAUDE_API_KEY
Ollama llama3 Local, privacy-friendly

Environment variables required:

  • OPENAI_API_KEY
  • CLAUDE_API_KEY

Docs

  • E2E Guide – How to integrate GoC Mitra in your dev flow
  • Contributing – Setup, coding standards, and dev notes

Contributing

We welcome contributions! Please read CONTRIBUTING.md before submitting PRs or opening issues.


License

MIT – © 2025 @Cre4T3Tiv3


Public Beta

GoC Mitra is now in public beta. It's stable, actively maintained, and ready for feedback. Try it in your dev workflow and help us improve it.


About

High-performance AI-powered Git commit assistant with pluggable architecture. Cross-platform compatibility with zero-dependency binary and intelligent commit analysis. Written in Go. Built for every stack.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Languages