Skip to main content

Keep a changelog, stupid! Generate changelogs from git commits using LLM.

Project description

kacs

CI PyPI version Python 3.9+ License: MIT

Keep a changelog, stupid!

A minimal Python CLI tool that generates changelogs from git commit messages using LLM analysis. Perfect for CI/CD pipelines and automated release workflows.

Features

  • 🚀 Minimal dependencies - Only requires ask2api + Python stdlib
  • 📝 Multiple formats - Keep a Changelog, GitHub, GitLab, or custom templates
  • 🤖 LLM-powered analysis - Automatically categorizes commits into Added, Changed, Fixed, etc.
  • CI/CD ready - Fast execution suitable for automated workflows
  • 🎯 Git tag based - Extract commits between any two git tags

Installation

pip install kacs

Setup

Set your API key as an environment variable:

export ASK2API_API_KEY="your-api-key"
# or
export OPENAI_API_KEY="your-openai-key"

Usage

Basic Usage

# Generate changelog between two tags
kacs --from-tag v1.0.0 --to-tag v1.1.0

# With custom date
kacs --from-tag v1.0.0 --to-tag v1.1.0 --date 2017-07-17

# Save to file
kacs --from-tag v1.0.0 --to-tag v1.1.0 --output CHANGELOG.md

Templates

# Use GitHub format
kacs --from-tag v1.0.0 --to-tag v1.1.0 --template github

# Use GitLab format
kacs --from-tag v1.0.0 --to-tag v1.1.0 --template gitlab

# Use custom template
kacs --from-tag v1.0.0 --to-tag v1.1.0 --custom-template ./my-template.j2

Commit Links

# Include commit links (auto-detects repository URL)
kacs --from-tag v1.0.0 --to-tag v1.1.0 --include-links

# With explicit repository URL
kacs --from-tag v1.0.0 --to-tag v1.1.0 --include-links --repo-url https://github.com/user/repo

Example Output

Keep a Changelog format (default):

## [1.1.0] - 2024-01-15

### Added
- New user authentication system
- Support for multiple database backends

### Changed
- Improved error handling in API endpoints
- Updated documentation structure

### Fixed
- Fixed memory leak in background tasks
- Resolved issue with concurrent requests

GitHub format:

## What's Changed in 1.1.0

### ✨ New Features
* New user authentication system
* Support for multiple database backends

### 🐛 Bug Fixes
* Fixed memory leak in background tasks

**Full Changelog**: https://github.com/user/repo/compare/v1.0.0...v1.1.0

CI/CD Integration

# GitHub Actions example
- name: Generate Changelog
  run: |
    pip install kacs
    kacs --from-tag ${{ github.event.release.tag_name }} --to-tag HEAD --output CHANGELOG.md
  env:
    ASK2API_API_KEY: ${{ secrets.ASK2API_API_KEY }}

Documentation

  • Template System - Learn about built-in templates and creating custom ones

License

MIT License - see LICENSE file for details.

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Run tests and linting
  5. Submit a pull request

Links

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

kacs-0.5.0.tar.gz (13.0 kB view details)

Uploaded Source

Built Distribution

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

kacs-0.5.0-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

Details for the file kacs-0.5.0.tar.gz.

File metadata

  • Download URL: kacs-0.5.0.tar.gz
  • Upload date:
  • Size: 13.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for kacs-0.5.0.tar.gz
Algorithm Hash digest
SHA256 a67ece4b38d752e53764323737867925ea7184922ee3b7d01c04fa9d8703f65a
MD5 7be585a374ef272f603f23fa8cf6c90e
BLAKE2b-256 949549bd5f0a9a124607d23007ca4cad261fcf88c0f1d2728df05ef0e72d6cde

See more details on using hashes here.

File details

Details for the file kacs-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: kacs-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 10.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for kacs-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1cda4a6a3fc3d319de1e9a9a74ee562ec1b76923306f75d883ec30490e35914a
MD5 74bd2ece5c8e8effb681eef82c9ba636
BLAKE2b-256 4ee264d8a948658a64a7f1db8bb9baccb9f7332f5a5932685f825c8b846ff8c1

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