llm crafted release notes from your git history
DiffLog is a CLI tool that turns git history into polished release notes using AI. It scans commits, groups changes into clear sections, and formats the result for different audiences so you can ship release notes and changelogs faster.
- Generate notes from tags, ranges, or date filters.
- Multiple audiences and output formats (Markdown, HTML, Plain Text, JSON).
- Optional links to issues/PRs and contributor lists.
- Interactive mode for guided runs.
- Configurable system prompts per audience or per run.
- CI friendly command-line interface.
Install as a .NET tool:
dotnet tool install -g DiffLogdifflog generate -iGenerate release notes from git history.
difflog generate [options]Options:
-p|--path <PATH>: Repository path (default.).-f|--from <REF>: Start reference (tag/branch/commit).-t|--to <REF>: End reference (defaultHEAD).-a|--audience <AUDIENCE>: Developers, EndUsers, SocialMedia, Executive.--format <FORMAT>: Markdown, Html, PlainText, Json.-o|--output <FILE>: Output file path.--from-date <DATE>: Include commits from date (yyyy-MM-dd).--to-date <DATE>: Include commits until date (yyyy-MM-dd).--no-links: Exclude issue/PR links.--no-contributors: Exclude contributor list.--repo-url <URL>: Repository URL override.--exclude <CATEGORIES>: Comma-separated categories to exclude.--system-prompt <PROMPT>: Override the system prompt for this run.--system-prompt-file <FILE>: Read system prompt from file.-i|--interactive: Guided interactive mode.
Examples:
difflog generate --from v1.0.0 --to v1.1.0 --format Markdown
difflog generate -a EndUsers --format Html --output release-notes.html
difflog generate --system-prompt-file prompts/social.txtStore OpenAI settings and optional audience-specific system prompts.
difflog config [options]Options:
--api-key <KEY>: OpenAI API key.--base-url <URL>: Base URL for OpenAI-compatible APIs.--model <MODEL>: Model name (defaultgpt-4o).--audience <AUDIENCE>: Audience to set a custom system prompt for.--system-prompt <PROMPT>: Prompt to store for that audience.--system-prompt-file <FILE>: Read the prompt from a file.-i|--interactive: Prompt for missing values.
Examples:
difflog config --api-key sk-... --model gpt-4o
difflog config --audience Developers --system-prompt-file prompts/dev.txtList tags in a repository.
difflog tags --path .DiffLog reads configuration from environment variables or the saved config file:
OPENAI_API_KEYOPENAI_BASE_URLOPENAI_MODEL
The difflog config command saves values to a config file (location is printed after saving). Environment variables always take precedence.
System prompt resolution order:
--system-prompt/--system-prompt-file- Stored prompt for the selected audience
- Built-in defaults
Use DiffLog in your CI/CD pipeline to automatically generate release notes. Add your OpenAI API key as a repository secret (OPENAI_API_KEY).
name: Generate Release Notes
on:
push:
tags:
- 'v*'
jobs:
release-notes:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Required for full git history
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '10.0.x'
- name: Install DiffLog
run: dotnet tool install -g DiffLog
- name: Generate Release Notes
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
# Optional: override model or base URL
# OPENAI_MODEL: gpt-4o
# OPENAI_BASE_URL: https://your-endpoint.openai.azure.com
run: |
# Get the previous tag
PREV_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "")
CURRENT_TAG=${GITHUB_REF#refs/tags/}
if [ -n "$PREV_TAG" ]; then
difflog generate --from $PREV_TAG --to $CURRENT_TAG --format Markdown -o release-notes.md
else
difflog generate --to $CURRENT_TAG --format Markdown -o release-notes.md
fi
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
body_path: release-notes.mdFor scheduled changelog generation or PR-based workflows:
- name: Generate Weekly Changelog
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
run: |
difflog generate --from-date $(date -d '7 days ago' +%Y-%m-%d) --format Markdown -o changelog.mdBuild and pack locally:
dotnet build src/DiffLog.csproj -c Release
dotnet pack src/DiffLog.csproj -c Release -o ./artifactsor use test-local-tool.ps1 script to pack and install the tool from source.
- .NET 10 SDK
- Spectre.Console / Spectre.Console.Cli
- Microsoft.Extensions.AI + OpenAI client
Fork and submit pull requests! Happy coding!
