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.2.tar.gz (4.2 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.2-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ask_git-0.1.2.tar.gz
  • Upload date:
  • Size: 4.2 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.2.tar.gz
Algorithm Hash digest
SHA256 a1201b2c594acccb9118d9a25aadc02dcc8ef11f73828b7c1cc37a607fe9b3c9
MD5 88da5cbedb27168a09fc1b5a58893985
BLAKE2b-256 41d37c8ecffe293909cf185eb524b1529b564339bf596bdda361abc60604be3f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ask_git-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 4.8 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b0361353f35ba61d2fc9b1a56a8ed7fa297b4ba037b2f00f0cf6502d932736b2
MD5 99c0df15ecc18dd14d2e88e0700212ce
BLAKE2b-256 67f6e58df07683ff66ec4522366380c17c4073759e9f749f69a34e21b884196b

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