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.4.tar.gz (9.4 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.4-py3-none-any.whl (11.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ask_git-0.1.4.tar.gz
  • Upload date:
  • Size: 9.4 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.4.tar.gz
Algorithm Hash digest
SHA256 01a0517fd754c003627b6fd28cb8305e9c83447eb2cbf2082c702542c7c30872
MD5 e5fededfef9bd67cb93776eead7c5584
BLAKE2b-256 8e62262120ec61d563a3b0470597147c43a605d007efb90100986222321077e4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ask_git-0.1.4-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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 ff7115762034634ce9d19e6d003e3c55c5b3d57d0a72fb491846a897e6968b8c
MD5 391fc90755cae3b67f5ff4493fb3f294
BLAKE2b-256 ef23a0cc289d67f10630f19c7dd4e5b7f7e90ca03db41877b2900a68e269602e

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