Skip to main content

AI-powered git commit message generator

Project description

gitai

The Commit Genie

PyPI version Python versions MIT license

AI-powered git commit message generator. Analyzes your staged changes and suggests meaningful commit messages — using any LLM you already have access to.

Features

  • Reads your staged git diff and generates 3 commit message suggestions
  • Interactive selection: pick a suggestion or write your own
  • Supports multiple providers: Ollama (local), OpenAI, Anthropic, Gemini, and more
  • Two commit styles: Conventional Commits or free-form
  • Optional emoji (gitmoji) support

Installation

pip install gitai

Requires Python 3.11+.

Quick start

# 1. Stage your changes
git add .

# 2. Run gitai
gitai commit

gitai reads the diff, calls your configured LLM, and presents 3 suggestions to choose from.

Usage

gitai commit      Generate commit message suggestions for staged changes
gitai config      View and update settings
gitai --version   Show version
gitai --help      Show help

Configuration

Run gitai config to update settings interactively. Settings are stored in ~/.gitai.toml.

Key Default Description
provider ollama LLM provider
model llama3.2 Model name
ollama_url http://localhost:11434 Ollama API base URL (Ollama only)
commit_style conventional conventional or free-form
emoji false Prefix suggestions with gitmoji

Supported providers

Provider provider value Example model value API key env var
Ollama (local) ollama llama3.2, mistral
Anthropic anthropic claude-sonnet-4-6, claude-haiku-4-5-20251001 ANTHROPIC_API_KEY
OpenAI openai gpt-4o, gpt-4o-mini OPENAI_API_KEY
Gemini gemini gemini-2.0-flash GEMINI_API_KEY

For cloud providers, set the API key in your shell profile:

bash/zsh (~/.bashrc or ~/.zshrc):

export ANTHROPIC_API_KEY=sk-ant-...

PowerShell ($PROFILE):

$env:ANTHROPIC_API_KEY="sk-ant-..."

Example ~/.gitai.toml

provider = "anthropic"
model = "claude-haiku-4-5-20251001"
commit_style = "conventional"
emoji = false
ollama_url = "http://localhost:11434"

Local setup (Ollama)

If you want to run fully offline with Ollama:

  1. Install Ollama
  2. Pull a model: ollama pull llama3.2
  3. Run gitai commit — no API key needed

TODO

  • Allow configuring the number of suggestions generated
  • Add --push flag to commit and push in one step
  • Support unstaged changes with an optional --all flag

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gitai_cli-0.2.0.tar.gz (1.1 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gitai_cli-0.2.0-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

Details for the file gitai_cli-0.2.0.tar.gz.

File metadata

  • Download URL: gitai_cli-0.2.0.tar.gz
  • Upload date:
  • Size: 1.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for gitai_cli-0.2.0.tar.gz
Algorithm Hash digest
SHA256 48cb9713cc9d45d5959faf6d632528c2e9b886de70ca1c1cae3575eda0ff3f1c
MD5 f238b3399dd3d8b1c974d447a98aeb0e
BLAKE2b-256 4f9461651cefed24fdd586453af53de86c73e05b0ad7b408bd2f5748879258f9

See more details on using hashes here.

File details

Details for the file gitai_cli-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: gitai_cli-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 8.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for gitai_cli-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 066c01b9cf4c85c4e79690733c4c796d0e53302b70794685501a044ffd82d450
MD5 bd14b0fa4040cb784d0c1cc05663c0ae
BLAKE2b-256 203ca06e08fbc64371e95f94472c97c81fab0daacfa591ab27bf46925048d977

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page