Getting Started¶
This guide will help you get up and running with GPTChangelog quickly.
Prerequisites¶
- Python 3.8 or higher
- Git repository
- OpenAI API key
Installation¶
Install GPTChangelog using pip:
Configuration¶
Before using GPTChangelog, you need to configure it with your OpenAI API key:
This will prompt you for:
- Configuration type (global or project-specific)
- Your OpenAI API key
- The model to use (default: gpt-4o)
- Maximum context tokens (default: 80000)
Global vs. Project Configuration¶
- Global configuration is stored in
~/.config/gptchangelog/config.ini
and applies to all projects - Project configuration is stored in
./.gptchangelog/config.ini
and only applies to the current project
Project configuration takes precedence over global configuration when both exist.
Basic Usage¶
Generate a Changelog¶
To generate a changelog from your latest tag to the current HEAD:
This will:
- Find your latest git tag
- Fetch all commit messages since that tag
- Process and analyze the commit messages using OpenAI
- Determine the next version based on semantic versioning
- Generate a well-structured changelog
- Prepend it to your CHANGELOG.md file
Interactive Mode¶
For more control, use interactive mode:
This allows you to review and edit the changelog before saving it.
Custom Commit Range¶
You can specify a custom range of commits:
Output to a Different File¶
By default, the changelog is prepended to CHANGELOG.md
, but you can specify a different file:
Dry Run¶
To preview the changelog without saving it:
Next Steps¶
- Learn about configuration options
- Explore advanced usage
- Check out templates