Skip to main content

gitaiflow

AI-assisted Git change summarization and engineering analysis for Python developers.

Maintained by: https://djangoplay.org

gitaiflow analyzes your Git changes with an AI model and produces a structured, timestamped change summary that can be used as a commit title/body, piped into Git workflows, or consumed by another tool or agent.

It is provider-agnostic: use Google Gemini, a local Ollama model, or any OpenAI-compatible endpoint such as OpenAI, Groq, DeepSeek, OpenRouter, vLLM, or LM Studio.

Features

  • Generate AI summaries from Git diffs
  • Summarize a directory or individual file
  • Generate commit-ready titles and bodies
  • Produce structured JSON output
  • Optionally generate a Markdown representation
  • Print commit messages directly to stdout
  • Skip selected paths such as migrations or tests
  • Compare against a specified remote and base branch
  • Use cloud or fully local AI models
  • Query OpenRouter's live model catalog
  • No vendor lock-in

Requirements

  • Python 3.11 or later
  • Git
  • An AI provider configured before running gitaiflow

Installation

pip install gitaiflow

Quick Start

Configure an AI provider and run:

gitaiflow --path .

For a commit-ready message:

gitaiflow --path . --print-commit

Example:

mailer: add retry backoff for failed sends

- Added exponential backoff retry logic in retry.py
- tasks.py now retries send_mail up to 3 times on failure
- No changes to public function signatures

The commit output can be piped directly into Git:

gitaiflow --path . --print-commit > /tmp/msg.txt
git commit -F /tmp/msg.txt

AI Provider Configuration

gitaiflow requires an AI model. It supports Gemini, Ollama, and OpenAI-compatible endpoints.

Configuration can be provided through environment variables or a .gitaiflow.env file in the repository root.

OpenRouter

OpenRouter can be used with its free model router or with a specific model available through your account.

AI_PROVIDER=custom
AI_BASE_URL=https://openrouter.ai/api/v1
AI_API_KEY=<your-openrouter-api-key>
AI_MODEL=openrouter/free

AI_TEMPERATURE=0.2
AI_MAX_TOKENS=10000
AI_REQUEST_TIMEOUT=60

Keep API keys private and never commit .gitaiflow.env to source control.

To list currently available free OpenRouter models:

gitaiflow --list-models --free-only

To list the full OpenRouter catalog:

gitaiflow --list-models

Add --json when you need the raw model metadata.

Google Gemini

export AI_PROVIDER=gemini
export AI_API_KEY=<your-key>

Ollama

For fully local inference:

export AI_PROVIDER=ollama
export AI_MODEL=llama3.2:3b

The model name must match a model available from your local Ollama installation.

OpenAI-Compatible Providers

export AI_PROVIDER=custom
export AI_BASE_URL=<endpoint>
export AI_API_KEY=<key>
export AI_MODEL=<model>

This can be used with OpenAI-compatible services including OpenAI, Groq, DeepSeek, OpenRouter, vLLM, LM Studio, and other compatible endpoints.

Configuration

Variable Default Description
AI_PROVIDER gemini gemini, ollama, openai, or custom
AI_BASE_URL Provider default Optional API endpoint override
AI_API_KEY None API key for cloud/OpenAI-compatible providers
AI_MODEL Provider default Model identifier
AI_TEMPERATURE 0.2 Model temperature
AI_MAX_TOKENS 10000 Maximum generated tokens
AI_REQUEST_TIMEOUT 60 Request timeout in seconds

Usage

Summarize a directory:

gitaiflow --path mailer/

Summarize a single file:

gitaiflow --path users/views/logout.py

Skip paths:

gitaiflow --path . --skip migrations tests

Use a specific remote and base branch:

gitaiflow --path . --remote upstream --base-branch develop

Write output to a custom location:

gitaiflow --path . -o artifacts/

Generate a Markdown representation in addition to JSON:

gitaiflow --path . --markdown

Print a commit-ready title and body:

gitaiflow --path . --print-commit

Output

Each run produces a structured JSON change summary containing Git-derived information such as:

  • Repository and branch
  • Target and target type
  • Base revision
  • Change window
  • Changed files and statuses
  • AI provider and model
  • Generated commit title
  • Generated commit body

The generated commit title and body are the model-generated portions of the result. Git metadata such as the branch, base, changed files, and change window comes directly from Git.

With --markdown, gitaiflow also produces a human-readable Markdown representation from the same JSON data.

Local Usage Tracking

gitaiflow maintains a local usage log at:

~/.gitaiflow/usage.jsonl

The log records local execution information such as timestamps, repository name, model used, estimated token counts, duration, and success status.

The usage log remains on the user's machine.

Optional local daily limits can be configured with:

export GITAIFLOW_MAX_RUNS_PER_DAY=20
export GITAIFLOW_MAX_TOKENS_PER_DAY=50000

These are local courtesy limits, not server-side quotas or enforcement.

Privacy and Telemetry

Telemetry is disabled by default.

If explicitly enabled with:

export GITAIFLOW_TELEMETRY=true

a run sends limited operational information to the configured telemetry receiver, including the gitaiflow version, AI provider, model name, target type, changed-file count, estimated token counts, duration, operating system, and success status.

The following are not sent through telemetry:

  • Repository name
  • File paths
  • File contents
  • Git diff contents
  • Git author or branch
  • Commit messages
  • AI-generated summary text

On the first telemetry-enabled run, gitaiflow prints the exact telemetry payload to stdout.

Limitations

  • An AI provider must be configured before gitaiflow can generate summaries.
  • Local usage limits are courtesy guardrails and can be removed by the user.
  • Secret redaction is best-effort pattern matching; generated summaries should be reviewed before being shared.
  • Token and cost estimates are approximate and are not provider billing measurements.

Links

License

gitaiflow is released under Apache License.

Download files

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

Source Distribution

gitaiflow-1.0.2.tar.gz (32.8 kB view details)

Uploaded Source

Built Distribution

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

gitaiflow-1.0.2-py3-none-any.whl (31.8 kB view details)

Uploaded Python 3

File details

Details for the file gitaiflow-1.0.2.tar.gz.

File metadata

  • Download URL: gitaiflow-1.0.2.tar.gz
  • Upload date:
  • Size: 32.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.11.16

File hashes

Hashes for gitaiflow-1.0.2.tar.gz
Algorithm Hash digest
SHA256 8aab08ce648e8c8a3e209aea81e123d6da83656cee2b2301413f5487380773af
MD5 3748bebe28ba32c75a0314b7a779129d
BLAKE2b-256 e81c1894d449162325eaf764893874e2512b112916092dd9e4801b573ad127c7

See more details on using hashes here.

File details

Details for the file gitaiflow-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: gitaiflow-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 31.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.11.16

File hashes

Hashes for gitaiflow-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 618795b07a39675f13e79be5dd6f6d91977e53b90df7c52d56874dd05554e6f7
MD5 ddc7d620cbb4b719b344649bab50c6c0
BLAKE2b-256 2b52940876e28d76b998d21347cb51a1d8e09e1eca7dec00b69aacfaed64e5aa

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.0.2 This release

2 files

1.0.1

2 files

1.0.0

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

Supported by

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