A powerful tool that generates human-readable changelogs from Git commits using OpenAI's language models. It automatically categorizes changes, generates summaries, and produces well-formatted markdown output.
- π€ AI-Powered Analysis: Uses OpenAI's GPT models to intelligently categorize and summarize commits
- π Smart Categorization: Automatically groups changes into Features, Bug Fixes, Improvements, Breaking Changes, Documentation, and Internal
- π Human-Readable Output: Generates clean, GitHub-flavored markdown with links and emoji
- β‘ Fast & Efficient: Built in Go for excellent performance
- π§ Highly Configurable: Supports environment variables, config files, and CLI flags
- π― GitHub Integration: Seamlessly fetches commits and diffs from GitHub repositories
# Clone the repository
git clone https://github.com/rakshaksatsangi/changelog-generator.git
cd changelog-generator
# Build the binary
make build
# Or install to GOPATH/bin
make install# Build the project
cd /Users/rakshaksatsangi/repos/changelog-generator
make build
# Run the generator
./bin/changelog-generator generate v1.0.0..v1.1.0You'll need:
- A GitHub personal access token (create one at https://github.com/settings/tokens)
- An OpenAI API key (get one at https://platform.openai.com/api-keys)
Set these required environment variables:
export GITHUB_TOKEN=ghp_xxxxxxxxxxxxx
export OPENAI_API_KEY=sk-xxxxxxxxxxxxx# Generate changelog for a commit range
changelog-generator generate v1.0.0..v1.1.0 --owner=facebook --repo=react
# Use HEAD as the end ref
changelog-generator generate v1.0.0..HEAD --owner=myorg --repo=myrepo
# Output to a specific file
changelog-generator generate v1.0.0..v1.1.0 --owner=myorg --repo=myrepo --output=RELEASE_NOTES.md
# Verbose mode for debugging
changelog-generator generate v1.0.0..v1.1.0 --owner=myorg --repo=myrepo --verbose
# Output to stdout
changelog-generator generate v1.0.0..v1.1.0 --owner=myorg --repo=myrepo --output=-Create a .changelog.yaml file in your project root or home directory:
# GitHub configuration
repo_owner: facebook
repo_name: react
# OpenAI configuration
openai_model: gpt-4o
max_tokens: 4000
temperature: 0.3
# Output configuration
output_path: CHANGELOG.md
include_authors: true
include_dates: false
# Behavior
verbose: falseFlags:
--owner string Repository owner (required)
--repo string Repository name (required)
--output string Output file path (default "CHANGELOG.md")
--model string OpenAI model to use (default "gpt-4o")
--verbose Verbose output
--include-authors Include commit authors (default true)
--include-dates Include commit dates (default false)
-h, --help Help for generate# Changelog: v1.0.0 β v1.1.0
## Summary
This release introduces new authentication features, performance improvements,
and several bug fixes to enhance stability and user experience.
## Highlights
- β Added OAuth2 authentication support with Google and GitHub providers
- β 40% performance improvement in API response times
- β Fixed critical security vulnerability in session handling
## π Features
- **Add OAuth2 authentication** ([`abc123f`](https://github.com/user/repo/commit/abc123f)) by @johndoe
Implements OAuth2 flow with support for Google and GitHub providers.
Includes token refresh and secure storage.
- **Add user profile dashboard** ([`def456a`](https://github.com/user/repo/commit/def456a)) by @janedoe
New dashboard showing user activity, preferences, and recent changes.
## π Bug Fixes
- **Fix race condition in cache** ([`ghi789b`](https://github.com/user/repo/commit/ghi789b)) by @bobsmith
Resolved concurrent access issues causing intermittent failures under high load.
- **Fix memory leak in websocket handler** ([`jkl012c`](https://github.com/user/repo/commit/jkl012c)) by @alicejones
Fixed goroutine leak that caused memory usage to grow over time.
## β‘ Improvements
- **Optimize database queries** ([`mno345d`](https://github.com/user/repo/commit/mno345d)) by @charlielee
Added indexes and query optimization resulting in 40% faster response times.
## π§ Internal
- **Update dependencies** ([`pqr678e`](https://github.com/user/repo/commit/pqr678e)) by @davidkim
Bumped all dependencies to latest versions for security patches.The tool follows a clean, modular architecture:
pkg/
βββ github/ # GitHub API client for fetching commits
βββ llm/ # OpenAI client for AI-powered analysis
βββ generator/ # Orchestrates the changelog generation
βββ config/ # Configuration management
cmd/
βββ cli/ # Command-line interface
- Fetch Commits: Uses the GitHub API to fetch all commits in the specified range
- Prepare Data: Extracts commit messages, file changes, and diffs
- AI Analysis: Sends commit data to OpenAI for intelligent categorization and summarization
- Format Output: Generates clean, formatted markdown with links and emoji
changelog-generator/
βββ cmd/
β βββ cli/ # CLI entry point
βββ pkg/
β βββ github/ # GitHub API integration
β βββ llm/ # OpenAI/LLM integration
β βββ generator/ # Core changelog generation
β βββ config/ # Configuration management
βββ Makefile # Build automation
βββ go.mod # Go module definition
βββ README.md # This file
# Build the binary
make build
# Run tests
make test
# Run tests with coverage
make test-coverage
# Format code
make fmt
# Run linters
make lint
# Clean build artifacts
make clean# Run all tests
make test
# Run tests with coverage report
make test-coverage
# Test specific package
go test -v ./pkg/generator/...Configuration is loaded in the following priority order (highest to lowest):
- Command-line flags
- Environment variables
- Config file (
.changelog.yaml) - Defaults
If you see authentication errors:
- Ensure
GITHUB_TOKENis set and valid - Check that your token has
reposcope for private repositories - Verify
OPENAI_API_KEYis set and has sufficient credits
If you get "no commits found" errors:
- Verify the refs exist:
git tagorgit branch -a - Ensure the range is in the correct format:
from..to - Try using full commit SHAs instead of tags
- GitHub API has rate limits (5000 requests/hour for authenticated requests)
- OpenAI has rate limits based on your plan
- Use
--verboseto see detailed progress
Contributions are welcome! Please feel free to submit a Pull Request.
MIT License - see LICENSE file for details
- Inspired by triggerdotdev/ai-changelog
- Built with go-github
- Powered by OpenAI
- Add support for Anthropic Claude
- HTTP REST API server
- Commit scoring/filtering for cost optimization
- Additional output formats (JSON, HTML)
- Custom changelog templates
- Caching layer for repeated queries
- Webhook integration for automatic releases
- Multi-repository changelog aggregation