Skip to main content

DiffSage

An AI-aware Git workflow toolkit for developers, automation, and AI agents.

DiffSage is a modern command-line toolkit that enhances Git workflows with AI while keeping Git as the single source of truth. Rather than replacing Git or competing with AI coding assistants, DiffSage provides a reliable, structured interface that helps developers and automation execute Git workflows consistently.


Why DiffSage?

AI coding assistants have dramatically improved code generation, but Git workflows still require reliable execution, proper validation, and consistent handling of repository state.

Today, developers often rely on:

  • Manual Git commands
  • Shell scripts
  • AI-generated terminal commands
  • Ad-hoc automation

Each approach solves part of the problem but leaves Git workflow logic scattered across tools.

DiffSage centralizes that logic into a single toolkit.

Instead of reinventing Git operations in every script or AI workflow, developers and automation can invoke DiffSage commands that handle repository validation, Git interactions, AI integration, and workflow execution through a consistent interface.


Philosophy

DiffSage is built around several core principles.

Git remains the source of truth

DiffSage builds on top of Git.

It never replaces Git.

Every operation ultimately delegates to Git while providing a safer and more consistent developer experience.

AI assists — it doesn't control

Artificial intelligence enhances Git workflows by generating suggestions, summaries, and explanations.

The developer always retains the final decision.

Reliability over cleverness

Predictable workflows are more valuable than overly complex automation.

Every feature should prioritize correctness, validation, and graceful failure.

Designed for automation

DiffSage is designed to be consumed by:

  • Developers
  • Automation scripts
  • AI agents

Each consumer interacts through the same consistent interface.


Features

Current capabilities include:

  • AI-assisted Conventional Commit generation
  • Interactive commit workflow
  • Commit message editing using the user's preferred editor
  • Commit message regeneration
  • Global, local, and resolved configuration management
  • Git repository validation
  • Environment diagnostics via diffsage doctor
  • Provider abstraction for AI integrations
  • Provider credential management with named profiles
  • AI provider authentication and error handling
  • Layered architecture
  • Comprehensive automated test suite

What DiffSage Is

DiffSage is:

  • An AI-aware Git workflow toolkit
  • A command-line application
  • Git-first
  • Automation-friendly
  • Extensible through a layered architecture
  • Designed for both developers and AI-driven workflows

What DiffSage Is Not

DiffSage is not:

  • A Git replacement
  • A code editor
  • A chatbot
  • A code generation platform
  • A project management tool
  • An IDE replacement
  • A general-purpose AI assistant

Its scope is intentionally focused on improving Git workflows.


Project Status

Current Stage: Alpha

DiffSage is an actively developed open-source project.

The project is published on PyPI and distributed as a Python package for developers, automation, and AI agents.

The current focus is on expanding Git workflow capabilities while maintaining a stable architecture, clear documentation, reliable automation, and strong engineering practices.


Installation

User Installation

DiffSage is published on PyPI and can be installed using pipx.

DiffSage currently requires Python 3.12.

pipx install diffsage

After installation verify the environment

diffsage doctor

Developer Installation

Clone the repository:

git clone <repository-url>
cd DiffSage

Create a virtual environment:

python -m venv .venv

Activate it:

macOS / Linux

source .venv/bin/activate

Windows

.venv\Scripts\activate

Install the project:

python -m pip install -e ".[dev]"

Releases

DiffSage releases are published through GitHub Releases and distributed through PyPI.

Released package versions can be installed directly with:

pipx install diffsage

A specific version can be installed with:

pipx install diffsage==1.2.0

Release builds and PyPI publishing are automated through GitHub Actions.


Configuration

DiffSage supports layered configuration through global and repository-local TOML files.

Application configuration controls how DiffSage behaves and can be managed through global, repository-local, and environment-based configuration.

Provider credentials are managed separately from application configuration and are not part of the Settings configuration model.

DIFFSAGE_PROVIDER=gemini
DIFFSAGE_AI_MODEL=<provider-supported-model>
DIFFSAGE_LOG_LEVEL=INFO
DIFFSAGE_TIMEOUT=60
DIFFSAGE_MAX_RETRIES=3

The configured model must be supported by the selected AI provider.

Configuration can also be managed directly from the CLI:

diffsage config list
diffsage config get provider
diffsage config set provider gemini
diffsage config unset provider

Quick Start

Set up your provider credential:

diffsage auth set gemini YOUR_API_KEY

Verify your environment:

diffsage doctor

View the current configuration:

diffsage config list

Ask the configured AI provider a question:

diffsage ask "Explain the current staged changes"

Generate a commit message:

diffsage commit

Interactive workflow:

Generate commit message
        │
        ▼
Display AI suggestion
        │
        ▼
[Y] Commit
[E] Edit
[R] Regenerate
[N] Cancel

Named credential profiles are also supported:

diffsage auth set gemini YOUR_API_KEY --name paid

View configured credentials:

diffsage auth list
diffsage auth get gemini

Remove a credential:

diffsage auth unset gemini

Commands

Command Description
diffsage doctor Validate the local DiffSage environment
diffsage commit Generate and manage AI-assisted commit messages
diffsage config list Display the current DiffSage configuration
diffsage config get Display the value of a configuration setting
diffsage config set Update a configuration setting
diffsage config unset Remove a configuration setting
diffsage auth set Store a provider credential
diffsage auth get Display a credential with the API key masked
diffsage auth list List configured credentials
diffsage auth unset Remove a provider credential
diffsage ask Ask the configured AI provider a question

More commands will be introduced as the project evolves.


Architecture Overview

DiffSage follows a layered architecture to separate responsibilities and improve maintainability.

CLI
│
▼
Commands
│
├── Configuration
│
├── Authentication
│
▼
Services
│
├── Git
├── AI
├── Prompt Generation
└── Credentials
│
▼
Providers / Storage

Key architectural principles include:

  • Single Responsibility Principle
  • Separation of concerns
  • Dependency inversion
  • Provider abstraction
  • Testability
  • Extensibility

Detailed documentation is available under the docs/ directory.


Project Structure

src/
└── diffsage/
    ├── commands/
    ├── config/
    ├── exceptions/
    ├── git/
    ├── logging/
    ├── models/
    ├── parsers/
    ├── prompts/
    ├── providers/
    ├── services/
    ├── storage/
    └── ui/

tests/

docs/

Documentation

Additional project documentation is available within the repository.

Document Purpose
docs/architecture.md High-level architecture
docs/conventions.md Coding conventions and project standards
docs/vision.md Project vision and scope
docs/changelog.md Project changes and milestones
docs/adrs/ADR-* Architecture Decision Records (ADRs)

Roadmap

The long-term roadmap focuses on strengthening Git workflows rather than expanding into unrelated developer tooling.

Planned capabilities include:

  • Pull request generation
  • Branch naming assistance
  • Merge assistance
  • Repository summaries
  • Git workflow automation
  • Machine-readable output for automation
  • Additional AI provider integrations

Every planned feature must satisfy the project's mission:

Improve Git workflows while making them more reliable and easier to automate.


AI-Agent Compatibility

DiffSage is designed to work equally well for humans and automation.

Instead of requiring every automation tool or AI agent to implement Git workflow logic independently, DiffSage provides a reusable interface that encapsulates:

  • Repository validation
  • Git operations
  • AI integration
  • Workflow execution
  • Error handling

This allows developers, scripts, and AI-driven workflows to interact with Git through a consistent, well-defined toolkit.

DiffSage does not replace AI coding assistants.

Instead, it complements them by providing reliable Git workflow capabilities.


Design Principles

Every feature in DiffSage should satisfy the following principles:

  • Strengthen Git workflows
  • Improve workflow reliability
  • Simplify automation
  • Preserve human control
  • Maintain architectural consistency

Features that fall outside these principles intentionally remain out of scope.


Contributing

DiffSage is an open-source project and contributions are welcome.

Before contributing, review the project architecture, coding conventions, and architectural decision records in the docs/ directory.

Additional contribution guidelines will be documented as the project evolves.


License

This project is licensed under the MIT License.

See the LICENSE file for details.

Download files

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

Source Distribution

diffsage-1.2.1.tar.gz (27.9 kB view details)

Uploaded Source

Built Distribution

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

diffsage-1.2.1-py3-none-any.whl (37.3 kB view details)

Uploaded Python 3

File details

Details for the file diffsage-1.2.1.tar.gz.

File metadata

  • Download URL: diffsage-1.2.1.tar.gz
  • Upload date:
  • Size: 27.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for diffsage-1.2.1.tar.gz
Algorithm Hash digest
SHA256 e4c30c4351f9ce604e474e8cd1b00c25cec4257cf417b4e06ab9a465d8d3e831
MD5 26e3df9682f3ffe24cb15c566cdc6fe7
BLAKE2b-256 cc83e08b1452ae7836ef0ecf9275ab053f65897ff40958013c8942d5e144eb88

See more details on using hashes here.

Provenance

The following attestation bundles were made for diffsage-1.2.1.tar.gz:

Publisher: release.yml on GunithaR/DiffSage

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file diffsage-1.2.1-py3-none-any.whl.

File metadata

  • Download URL: diffsage-1.2.1-py3-none-any.whl
  • Upload date:
  • Size: 37.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for diffsage-1.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 31cd574a5df379e9b653042c155f52314970b6a4b912cb22263efc69e6fb60f9
MD5 283e832060bc3ac0f726a7aa74893a2a
BLAKE2b-256 c9080b7325c17826f1a8679483cfd0487f77b15f9ee4081bba1788ed13d2bfc8

See more details on using hashes here.

Provenance

The following attestation bundles were made for diffsage-1.2.1-py3-none-any.whl:

Publisher: release.yml on GunithaR/DiffSage

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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