GenAI Assisted Changelog Generation
LogChange is a powerful tool that automatically generates meaningful changelogs from your git commit history using OpenAI's language models. It analyzes commit diffs and messages to create clear, professional changelog entries in multiple formats.
- AI-Powered Summaries: Uses OpenAI GPT models to generate human-readable changelog entries
- Multiple Output Formats: Export as Markdown, JSON, or CSV
- Flexible Configuration: Customize the number of commits, AI model, and output format
- Statistics: Optional statistics about contributors, date ranges, and commit counts
- Progress Tracking: Verbose mode shows real-time processing progress
- Easy Integration: Simple CLI interface with sensible defaults
# Clone the repository
git clone https://github.com/matmulai/logchange.git
cd logchange
# Install dependencies
pip install -r requirements.txt
# Install the package
pip install -e .- Python 3.8 or higher
- Git repository
- OpenAI API key
-
Set your OpenAI API key:
export OPENAI_API_KEY=sk-your-key-here -
Generate a changelog:
# Simple usage with defaults logchange # Or use the script directly python logchange.py
-
Check the output:
cat changelog.md
# Generate markdown changelog with default settings (last 50 commits)
logchange
# Generate JSON changelog with statistics
logchange --format json --stats --output changelog.json
# Generate changelog for last 100 commits using GPT-4
logchange --max-commits 100 --model gpt-4 --verbose
# Generate CSV format for data analysis
logchange --format csv --output results.csv --stats--repo PATH Path to git repository (default: current directory)
--output FILE Output file path (default: changelog.md)
--max-commits N Number of recent commits to include (default: 50)
--model MODEL OpenAI model to use (default: gpt-4)
--format FORMAT Output format: markdown, json, or csv (default: markdown)
--max-tokens N Maximum tokens per summary (default: 300)
--verbose Show progress information
--stats Include statistics in output
OPENAI_API_KEY(required): Your OpenAI API keyOPENAI_MODEL(optional): Default model to use (e.g.,gpt-4,gpt-3.5-turbo)
# Use GPT-3.5 for faster, cheaper results
logchange --model gpt-3.5-turbo
# Use GPT-4 for higher quality summaries
logchange --model gpt-4
# Set default model via environment variable
export OPENAI_MODEL=gpt-3.5-turbo
logchangeHuman-readable changelog suitable for README files and documentation.
logchange --format markdownStructured data format for programmatic processing.
logchange --format json --output changelog.jsonTabular format suitable for data analysis and spreadsheets.
logchange --format csv --output changelog.csvLogChange includes several utility scripts in the scripts/ directory:
- gen_commit_msg.py: Generate AI-powered commit messages for staged changes or existing commits
- gen_changelog.py: Alternative changelog generation script
- demo_commit_quality.py: Quality assessment tool for evaluating AI-generated commit messages
- run_experiment.py: Experimental features and testing
See QUALITY_ASSESSMENT_GUIDE.md for detailed testing instructions.
logchange/
├── src/logchange/ # Main package
│ ├── cli.py # Command-line interface
│ ├── ai_summarizer.py # OpenAI integration
│ ├── git_utils.py # Git repository operations
│ ├── formatters.py # Output format handlers
│ ├── config.py # Configuration management
│ └── statistics.py # Statistics calculation
├── scripts/ # Utility scripts
├── logchange.py # Entry point script
├── pyproject.toml # Package configuration
└── requirements.txt # Dependencies
logchange --max-commits 100 --stats --verboseOutput:
Fetching up to 100 commits from /path/to/repo...
Generating summaries using gpt-4...
Processing commit 100/100: a1b2c3d
Statistics:
Total commits: 100
Contributors: 5
Date range: 2024-01-01 to 2024-11-12
Model: gpt-4
✅ Changelog generated and saved to 'changelog.md'
logchange --format json --max-commits 20 --output data.jsonThis creates a structured JSON file with commit information and AI-generated summaries.
Refer to the QUALITY_ASSESSMENT_GUIDE.md for comprehensive testing instructions.
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
- Homepage: https://github.com/matmulai/logchange
- Issues: https://github.com/matmulai/logchange/issues
- Repository: https://github.com/matmulai/logchange