PHP CLI to update a CHANGELOG following the "Keep a Changelog" format with the latest release notes.

v1.0.0 2021-08-14 10:00 UTC

This package is auto-updated.

Last update: 2021-10-14 10:49:55 UTC


A PHP CLI to update a CHANGELOG following the "Keep a Changelog" format with the latest release notes.

Latest Version on Packagist Tests Check & fix styling Psalm Total Downloads

Want to automate the process of updating your Changelog with GitHub Actions? Checkout the stefanzweifel/changelog-updater-action which does exactly that.


You can install the changelog-updater CLI as a global composer dependency. It requires PHP 8.0 or higher.

composer global require wnx/changelog-updater


You can use changelog-updater by running the update command with the following options.

php changelog-updater update \
--release-notes="### Added
- New Feature A
- New Feature B

### Changed
- Update Feature C

### Removes
- Remove Feature D" \
--latest-version="v1.0.0" \
--release-date="2021-08-07" \
--path-to-changelog="CHANGELOG.md" \

--release-date, --path-to-changelog and --write are optional. Learn more about the options by running php changelog-updater update --help.


Note that the Changelog MUST follow the "Keep a Changelog"-format. The CLI looks for a second level "Unreleased"-heading with a link. The link MUST point to the compare view of the latest version and HEAD. The CLI also looks for a second level heading with the name of the previous version. (If you release v1.1.0 now, the previous version might be v1.0.0.)

Here is an example Markdown file, that will work fine with the CLI.

# Changelog
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [Unreleased](https://github.com/org/repo/compare/v0.1.0...HEAD)

*Please do not manually update this file. We've automated the process.*

## v0.1.0 - 2021-01-01

### Added
- Initial Release

The content between the "Unreleased"-heading and the latest version will remain untouched by the CLI.

CLI Options


Required. The release notes you want to add to your CHANGELOG. Should be markdown.


Required. Version number of the latest release. The value will be used as the heading text and as a parameter in the compare URL.

Example: v1.0.0


Optional (Defaults to current date). The date the latest version has been released. The value will be used in the release heading.


Optional (Defaults to CHANGELOG.md). Path to CHANGELOG.md file.


Optional. Write the changes to CHANGELOG.md or to the value of --path-to-changelog.


composer test


Please see CHANGELOG for more information on what has changed recently.


Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.



The MIT License (MIT). Please see License File for more information.