Skip to main content

Ask Git anything — Powered by Ollama.

Project description

🧠 Ask-Git: Git History Explorer with Local LLMs

Ask-Git is a powerful CLI tool that lets developers understand Git history using natural language. It wraps around Git commands and feeds relevant context to local LLMs (via Ollama) to generate human-readable explanations and summaries — all without uploading your code or commits to the cloud.

🚀 Features

Ask-Git is currently focused on the following capabilities:

✅ Implemented

  • explain <file>
    Summarize recent changes made to a specific file.
    This combines recent commits, diffs, and blame information to explain how a file evolved.

  • summary --since <date> --until <date> [--author <name>]
    Summarize commit activity in a date range (optionally filtered by author).
    Ideal for understanding what happened during a sprint or review period.

🚧 In Progress

  • why "<question>"
    Ask why a feature, line, or change was made (coming soon).

  • pr-summary
    Generate a pull-request-style summary from recent commits (coming soon).


🛠️ Installation

Ask-Git is a Python CLI tool. Make sure you have Python 3.8+ installed.

You can install it directly from PyPI:

pip install ask-git

Or clone and install from source:

git clone https://github.com/ARJ2211/ask-git.git
cd ask-git
pip install -e .

🧠 Ollama Setup

You need Ollama running locally to use the LLM features.

Install and start Ollama:

ollama serve

Pull a supported model (e.g., CodeLlama):

ollama pull codellama

Make sure it's accessible at http://localhost:11434.


🧾 Usage

Once installed, you can run the tool via the ask-git command:

🔍 Summarize Git Activity

ask-git summary --since 2024-04-01 --until 2024-04-15

Optional filter by author:

ask-git summary --since 2024-04-01 --until 2024-04-15 --author "Alice"

📄 Explain a File's History

ask-git explain path/to/your/file.py

This will pull recent changes to the file and ask the LLM to describe what happened.


⚙️ How It Works

  • Uses GitPython and subprocess to gather git log, diff, and blame context.
  • Builds custom prompts for the LLM to explain or summarize changes.
  • Talks to Ollama via HTTP API for local LLM queries (e.g., Mistral, CodeLlama).
  • Outputs explanations and summaries directly to your terminal using rich.

🧪 Development Status

This project is still evolving. Contributions are welcome!

  • explain and summary are stable
  • why and pr-summary are under active development

📩 Contact

Questions or suggestions?
Check out askaayush.com or raise an issue on GitHub.

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

ask_git-0.1.3.tar.gz (9.5 kB view details)

Uploaded Source

Built Distribution

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

ask_git-0.1.3-py3-none-any.whl (11.0 kB view details)

Uploaded Python 3

File details

Details for the file ask_git-0.1.3.tar.gz.

File metadata

  • Download URL: ask_git-0.1.3.tar.gz
  • Upload date:
  • Size: 9.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.0

File hashes

Hashes for ask_git-0.1.3.tar.gz
Algorithm Hash digest
SHA256 159f1498c0f7018b5fe7ac9939f50b28595eb3c6ca75f51df8a8e5e5e03445f1
MD5 4bd40df72e741d24d57c9bbe0b7dc413
BLAKE2b-256 29c9f0b1bdbd01b2d666d1058b74686a579eff9d0a1938713d69988e397e242a

See more details on using hashes here.

File details

Details for the file ask_git-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: ask_git-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 11.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.0

File hashes

Hashes for ask_git-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 2cb85170d760924a96f128af59c78ff2460a996ba956cbe730108a1d2a109a62
MD5 d0b3cd5a58152e41c628de1a17ad8a85
BLAKE2b-256 f52f40c556463e9abf5439138b70a502f3fd7852f1f9d0fe33a5ee3d863ab56c

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