Metadata-Version: 2.4
Name: gitaiflow
Version: 0.1.2
Summary: AI-assisted git diff intelligence and engineering change summary platform for Django and Python projects.
Author: CodeFleet Labs
License-Expression: MIT
Project-URL: Homepage, https://gitlab.com/codefleet-labs/aiassist
Project-URL: Repository, https://gitlab.com/codefleet-labs/aiassist
Project-URL: Issues, https://gitlab.com/codefleet-labs/aiassist/-/issues
Keywords: gitaiflow,ai,git,diff,engineering,django,ollama,llm,pr-summary,developer-tools,git-analysis
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development
Classifier: Topic :: Software Development :: Version Control :: Git
Classifier: Topic :: Utilities
Classifier: Environment :: Console
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: ollama>=0.3.0
Provides-Extra: dev
Requires-Dist: ruff>=0.5.0; extra == "dev"
Requires-Dist: pytest>=8.0; extra == "dev"
Requires-Dist: build>=1.2.1; extra == "dev"
Requires-Dist: twine>=5.0.0; extra == "dev"
Dynamic: license-file

# AIAssist : gitaiflow

<p align="left">
  Maintained by 
  <img
    src="aiassist/static/assets/logo/dp/icon.svg"
    alt="DjangoPlay Icon"
    width="20"
    valign="middle"
  />
  <img
    src="aiassist/static/assets/logo/dp/name.svg"
    alt="DjangoPlay"
    width="72"
    valign="middle"
  />
</p>
<a href="https://djangoplay.org">https://djangoplay.org</a>

## 

![Python](https://img.shields.io/pypi/pyversions/gitaiflow)
![License](https://img.shields.io/badge/license-MIT-green)
![AI](https://img.shields.io/badge/AI-Ollama-blue)
![Git](https://img.shields.io/badge/git-diff%20intelligence-orange)

## AI-Assisted Git Intelligence & Engineering Analysis Platform

`gitaiflow ` is a local-first AI-assisted engineering intelligence platform for:

- Git diff analysis
- engineering change summaries
- pull request summaries
- architectural analysis
- Django-aware change detection
- hierarchical diff summarization

The platform combines:

- deterministic Python analysis
- Git intelligence
- local LLM synthesis
- architecture-aware summarization

to generate high-quality engineering summaries from Git changes.

---

## Philosophy

`gitaiflow ` follows several core principles:

- local-first execution
- privacy-preserving workflows
- deterministic preprocessing
- AI-assisted synthesis
- architecture-aware engineering analysis
- no cloud dependency required

The system intentionally avoids:

- agent framework complexity
- vector databases
- autonomous orchestration
- unnecessary infrastructure

---

## Features

### Current Features

- recursive Git diff analysis
- single-file diff analysis
- file-level diff generation
- folder-level aggregate summaries
- compact GitHub-style summaries
- detailed engineering summaries
- aggregate-only summary generation
- Django-aware workflows
- local Ollama integration
- per-file markdown summaries
- aggregate engineering summaries
- GitHub/GitLab remote support
- configurable artifact output directory
- configurable git remote selection
- configurable base branch selection
- configurable model family selection
- configurable model size selection
- configurable path skipping
- local-first execution
- sensitive token filtering
- deterministic preprocessing
- prompt caching for faster execution
- interrupt-safe execution handling
- tracked and untracked file diff support

---

## Prerequisites

### 1. Install Ollama

Official website:

https://ollama.com

Verify installation:

```bash
ollama --version
```

---

### 2. Pull Recommended Model

```bash
ollama pull llama3.2:3b
```

Alternative recommended models:

```bash
ollama pull qwen2.5-coder:7b
```

```bash
ollama pull mistral:7b
```

---

### 3. Start Ollama

```bash
ollama serve
```

---

## Installation

### Option 1 — Install from PyPI

```bash
pip install gitaiflow
```

Verify installation:

```bash
gitaiflow --help
```

---

### Option 2 — Install from Source

```bash
git clone https://gitlab.com/codefleet-labs/aiassist.git

cd aiassist

pip install -e .
```
For Mac Users

```
pip install -e ".[dev]"
```

---

## Quick Start

### Analyze Entire Folder

```bash
gitaiflow \
    --path mailer/
```

Generates:

```text
change-summary/
├── cache/
├── diff/
├── json/
├── markdown/
└── metadata/
```

---

### Analyze Single File

```bash
gitaiflow \
    --path users/views/ui/logout.py
```

---

### Generate Detailed Engineering Summary

```bash
gitaiflow \
    --path users/views/ui/logout.py \
    --full
```

---

### Generate Aggregate Summary Only

```bash
gitaiflow \
    --path mailer/ \
    --aggregate
```

---

### Re-Generate Summary From Existing Diff

```bash
gitaiflow \
    --target logout
```

---

## Supported CLI Arguments

| Argument | Description |
|---|---|
| `--path` | File or folder path to analyze |
| `--target` | Re-generate summary from existing diff |
| `--aggregate` | Generate aggregate summary only |
| `--full` | Generate detailed engineering summary |
| `--remote` | Override git remote name |
| `--base-branch` | Override git base branch |
| `--model` | Override model family |
| `--size` | Override model size |
| `-o`, `--output-dir` | Override artifact output root directory |
| `--skip` | Additional files/directories to skip |

---

## CLI Examples

### Default Artifact Output

```bash
gitaiflow \
    --path mailer/
```

Generates:

```text
change-summary/
├── cache/
├── diff/
├── json/
├── markdown/
└── metadata/
```

---

### Custom Artifact Output Directory

```bash
gitaiflow \
    --path mailer/ \
    -o artifacts/
```

Generates:

```text
artifacts/
├── cache/
├── diff/
├── json/
├── markdown/
└── metadata/
```

---

### Use Specific Git Remote

```bash
gitaiflow \
    --path mailer/ \
    --remote github
```

---

### Use Specific Base Branch

```bash
gitaiflow \
    --path mailer/ \
    --base-branch develop
```

---

### Override Both Remote And Branch

```bash
gitaiflow \
    --path mailer/ \
    --remote upstream \
    --base-branch master
```

---

### Use Specific Model

```bash
gitaiflow \
    --path . \
    --model qwen2.5-coder \
    --size 7b
```

---

### Skip Additional Paths

```bash
gitaiflow \
    --path . \
    --skip migrations legacy tests
```

---

### Skip Multiple Directories

```bash
gitaiflow \
    --path . \
    --skip \
        aiassist/config/ \
        tests/ \
        docs/
```

---

### Generate Aggregate Summary Only

```bash
gitaiflow \
    --path . \
    --aggregate
```

---

## Artifact Generation

By default, `gitaiflow ` generates artifacts inside:

```text
./change-summary/
```

relative to the current execution directory.

Generated structure:

```text
change-summary/
└── 2026/
    └── 2026-05-16/
        └── v0.1.0/
            ├── cache/
            ├── diff/
            ├── json/
            ├── markdown/
            └── metadata/
```
Artifact directories are grouped by:

- generation year
- generation date
- {app_version}

This allows:

- release-day traceability
- historical summary preservation
- multiple generation runs per day
- isolated summaries across gitaiflow versions

Directories are automatically:

- created if missing
- reused if existing
- regenerated safely during execution

The system clears only generated runtime artifacts:

- `diff/`
- `markdown/`

while preserving:

- `cache/`
- `json/`
- `metadata/`

This prevents stale summaries while preserving reusable metadata.

Custom output root may be specified using:

```bash
-o artifacts/
```

---

## Git Comparison Strategy

`gitaiflow ` compares changes against:

```text
<remote>/<base-branch>
```

Examples:

```text
origin/main
github/main
upstream/develop
gitlab/main
```

Default values:

```text
remote       = origin
base-branch  = main
```

Both may be overridden dynamically:

```bash
gitaiflow \
    --path mailer/ \
    --remote github \
    --base-branch develop
```

If remote or branch does not exist, execution halts safely with validation errors.

---

## Security & Sensitive Data Handling

`gitaiflow ` automatically redacts common sensitive credential patterns from generated diffs.

Current protected patterns include:

- `SECRET_KEY`
- `API_KEY`
- `PRIVATE_KEY`
- `ACCESS_KEY`
- `CLIENT_SECRET`
- `secret_key`
- `api_key`
- `private_key`
- `access_key`
- `client_secret`

Sensitive lines are replaced with:

```text
[REDACTED SENSITIVE CONTENT]
```

The filtering system intentionally avoids false positives for:

- imports
- comments
- variable names like `token_count`
- helper functions

---

## Generated Artifact Structure

```text
change-summary/

├── cache/
├── diff/
├── json/
├── markdown/
└── metadata/
```

Generated artifacts include:

| Directory | Purpose |
|---|---|
| `diff/` | Generated Git diffs |
| `markdown/` | AI-generated markdown summaries |
| `cache/` | Cached runtime artifacts |
| `json/` | Structured machine-readable outputs |
| `metadata/` | Internal execution metadata |

---

## Prompt System

`gitaiflow ` ships with multiple prompt templates:

- compact summaries
- full engineering summaries
- aggregate summaries
- aggregate engineering summaries

Prompt templates are preloaded into memory during startup for:

- fail-fast validation
- reduced filesystem overhead
- stable long-running execution

---

## Supported Summary Modes

### Compact Summary

Designed for:

- PR descriptions
- quick reviews
- GitHub/GitLab summaries
- concise engineering updates

Example:

```bash
gitaiflow \
    --path . \
    --compact
```

---

### Full Engineering Summary

Designed for:

- architecture reviews
- senior engineering analysis
- implementation audits
- detailed engineering reporting

Example:

```bash
gitaiflow \
    --path . \
    --full
```

---

## Recommended Models

| Model | Usage |
|---|---|
| llama3.2:3b | lightweight default |
| llama3.1:8b | higher-quality summaries |
| qwen2.5-coder:7b | strong code reasoning |
| mistral:7b | fast summarization |
| deepseek-coder:6.7b | code-aware analysis |

---

## Example Large Repository Analysis

```bash
gitaiflow \
    --path . \
    --target aiassist/ \
    --o summary/dir/ \
    --remote gitlab \
    --model qwen2.5-coder \
    --size 7b \
    --skip aiassist/config/
```

---

## Development Setup

Clone repository:

```bash
git clone https://gitlab.com/codefleet-labs/aiassist.git

cd aiassist
```

Install development environment:

```bash
pip install -e .[dev]
```

Run linting:

```bash
ruff check .
```

Run tests:

```bash
pytest
```

---

## PyPI Publishing

Build package:

```bash
python -m build
```

Upload to TestPyPI:

```bash
twine upload --repository testpypi dist/*
```

Upload to PyPI:

```bash
twine upload dist/*
```

---

## Planned AI Provider Support

Future releases will support:

| Provider | Status |
|---|---|
| Ollama | Current Default |
| OpenAI GPT-5 | Planned |
| Claude | Planned |
| Gemini | Planned |
| DeepSeek API | Planned |
| OpenRouter | Planned |
| Azure OpenAI | Planned |

Ollama will remain the default local-first provider.

---

## Versioning

This project follows Semantic Versioning.

```text
0.x → active development
1.x → stable production releases
```

### Current Version
v.0.1.0

---

## License

MIT License.

See `LICENSE`.

---

## Planned Release Features

See `TODO`.


### 👤 Maintainer

DjangoPlay 

<contact@djangoplay.org>

Actively maintained (updated May 16, 2026)

---

### 🌟 Contributing

Pull requests welcome. Follow DRY principles to ensure code quality and maintainability.
