Skip to main content

A Python project that generates AI-based changelogs.

Project description

ai_changelog

License: MIT python security: bandit Ruff Code style: black pre-commit Checked with mypy Update AI Changelog on Push to Main

ai_changelog is a Python project that automatically generates changelog files summarizing code changes, using AI.

It uses LangChain and OpenAI models to analyze Git commit diffs and generate natural language descriptions of the changes. This allows maintaining an up-to-date changelog without manual effort.

This README was written by Claude, an LLM from Anthropic.

Usage

Local

To generate a changelog locally:

pip install -r requirements.txt
pip install .

ai_changelog --help
ai_changelog main..HEAD  # to summarize changes locally
ai_changelog origin/main^..origin/main  # in a GitHub action to summarize changes in response to a push to main
ai_changelog origin/main..HEAD  # in a GitHub action to summarize changes in response to a PR

GitHub Workflow

The ai_changelog_main_pr.yml workflow runs on pushes to main.

It generates summaries for the new commits and appends them to AI_CHANGELOG.md. The updated file is then committed back to the PR branch.

This workflow may be buggy if you are pushing directly to main. It is primarily designed to work after a pull request is merged.

Another flow was made to commit an updated changelog to an incoming PR before it was merged, but that seemed less useful although it did work well.

Configuration

  • Set OPENAI_API_KEY in your environment to use a specific OpenAI API key.
  • Set LangSmith environment variables to enable LangSmith integration, if applicable.

License

This project is licensed under the MIT License - see the LICENSE file for details.

TODO

  • Testing
  • Customization / parameterization
  • Actions for publishing on pypi & dockerhub
  • Published GitHub action(s)

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

ai_changelog-0.0.2.tar.gz (6.5 kB view hashes)

Uploaded Source

Built Distribution

ai_changelog-0.0.2-py3-none-any.whl (8.4 kB view hashes)

Uploaded Python 3

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