ghlog
Generate release notes based on GitHub Commits
ghlog
Changelog generator for GitHub repositories that automatically categorizes commits following the Conventional Commits specification.
Features
- Automatic commit categorization (feat, fix, docs, etc.)
- Breaking change detection (
feat!:or aBREAKING CHANGE:footer) - Sectioned markdown output with linked commit SHAs
- Configurable categories and contributor filtering
- Advanced commit filtering by type, scope, patterns, and authors
- Flat output mode without categories
- CLI and programmatic API
- Flexible ref ranges, any commit, tag, or branch
- GitHub API authentication support
Installation
Or run directly without installing:
Global installation (standalone binary)
Compiles a standalone executable and drops it into ~/.local/bin (make sure that's on your PATH).
Quick start
CLI reference
ghlog <owner/repo> [base_ref] [head_ref] [...options]
Arguments
base_ref base git ref (default: latest tag or initial commit)
head_ref head git ref (default: latest commit)
Options
-a, --append append to existing file
--auth <token> GitHub access token
--exclude-patterns <patterns> exclude commits matching regex (comma-separated)
--exclude-scopes <scopes> exclude commits with these scopes (comma-separated)
--exclude-types <types> exclude commits with these types (comma-separated)
-h, --help show help
--include-non-conventional include non-conventional commits
--include-patterns <patterns> include commits matching regex (comma-separated)
--include-scopes <scopes> include only commits with these scopes (comma-separated)
--include-types <types> include only commits with these types (comma-separated)
--no-categories flat list of all commits, no category grouping
--no-contributors hide contributors section
-o, --output <path> output file (default: CHANGELOG.md)
--skip-authors <authors> exclude these authors from contributors (comma-separated @logins)
--title <title> custom changelog title
-v, --version <version> release tag
Environment variables
| Variable | Description |
|---|---|
GITHUB_TOKEN |
GitHub API token (alternative to --auth) |
Output format
If base_ref and head_ref resolve to the same commit (nothing changed since the last tag), or every commit gets filtered out, the output body is just - No changes were required. instead of an empty section list.
Programmatic API
getDefaultChangelog(repo, release?, config?)
High-level, returns a formatted markdown string.
getChangeLog(repo, base?, head?, config?)
Low-level, returns structured data for custom processing.
Return shape:
Configuration
Config interface
Default categories
| Type | Section |
|---|---|
BREAKING |
Breaking Changes |
build |
Builds |
chore |
Chores |
ci |
CI/CD |
docs |
Documentation |
feat |
New Features |
fix |
Bug Fixes |
perf |
Performance |
refactor |
Refactors |
revert |
Reverts |
style |
Styles |
test |
Tests |
A commit lands in BREAKING instead of its usual type section when its header has a ! before the colon (feat!:, fix(api)!:, ...) or its body has a BREAKING CHANGE: (or BREAKING-CHANGE:) footer.
Pierre Roy