Skip to main content

AI-powered git commands for summarizing changes

Project description

Git AI Summarize

A command-line tool for summarizing changes in Git repositories using AI.

Installation

pip install git-ai-summarize

Requirements

  • Python 3.8 or higher
  • An API key for Anthropic (or your preferred LLM)

Setup

Set an environment variable with your LLM API key. To use the default Anthropic model, use:

export ANTHROPIC_API_KEY='your-api-key-here'

Add this to your shell profile to make it permanent.

Commands

Summarize changes between commits

Provide a commit hash or a range of commits to get a summary of the changes.

# Compare with HEAD
git summarize <commit-hash>

# Compare any two commits
git summarize <commit1>..<commit2>

Pull and summarize changes

Pass the --pull flag to pull changes from the remote and summarize the changes since the last pull.

git summarize --pull

Using alternative LLM providers/models

You can pass the --provider and --model argument to use a different LLM provider/model. The default provider is anthropic, and the default model is claude-3-5-sonnet-latest. To get a list of all supported providers, run:

git summarize --list-providers

To get a list of all supported models for a provider, see the LLM providers' documentation.

Depending on the provider, you may need to set additional environment variables with that provider's API key (e.g., ANTHROPIC_API_KEY for Anthropic/Claude, OPENAI_API_KEY for OpenAI/GPT, etc.).

To change your default provider/model, you can set the GIT_SUMMARIZE_PROVIDER and GIT_SUMMARIZE_MODEL environment variables.

If you would like to use a model by a provider that is not currently supported by this package, feel free to submit an Issue with the name of the model/provider and we can look into it. If it is supported by LangChain, we can most likely add it.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

GNU GPLv3 License

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

git_ai_summarize-0.1.0.tar.gz (19.0 kB view details)

Uploaded Source

Built Distribution

git_ai_summarize-0.1.0-py3-none-any.whl (19.2 kB view details)

Uploaded Python 3

File details

Details for the file git_ai_summarize-0.1.0.tar.gz.

File metadata

  • Download URL: git_ai_summarize-0.1.0.tar.gz
  • Upload date:
  • Size: 19.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.9

File hashes

Hashes for git_ai_summarize-0.1.0.tar.gz
Algorithm Hash digest
SHA256 97d7adc09418c7fd9aee743f85cf09151d46ab0948c0f1a8e5ea6bb535b41b6a
MD5 ee1352420faf7b2d382285c7829749d7
BLAKE2b-256 5d2b3f3f0c2e32e63acdce155269576e6f9423216c105d7da5387d8139b0af6f

See more details on using hashes here.

File details

Details for the file git_ai_summarize-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for git_ai_summarize-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 09650aea5c42af03a04d0f772c43267333b2435aaefe7c34c9c52946beaceed6
MD5 3b4a03920934c4f48fbd15a8b708b6dd
BLAKE2b-256 03528b490bfdbffea6c7d3d303acbc9c09bfbd460aeea2a55626dae98d6f4b28

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page