PHPackages                             wnx/changelog-updater - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [CLI &amp; Console](/categories/cli)
4. /
5. wnx/changelog-updater

ActiveLibrary[CLI &amp; Console](/categories/cli)

wnx/changelog-updater
=====================

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

v1.12.0(1y ago)27273↑100%10[1 PRs](https://github.com/stefanzweifel/php-changelog-updater/pulls)MITPHPPHP ^8.2CI passing

Since Aug 7Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/stefanzweifel/php-changelog-updater)[ Packagist](https://packagist.org/packages/wnx/changelog-updater)[ Fund](https://buymeacoff.ee/3oQ64YW)[ GitHub Sponsors](https://github.com/stefanzweifel)[ RSS](/packages/wnx-changelog-updater/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (9)Versions (30)Used By (0)

changelog-updater
=================

[](#changelog-updater)

A PHP CLI to update a changelog with the latest release notes.

[![Latest Version on Packagist](https://camo.githubusercontent.com/fd5a63e4e0e8b4db9f202fd11826d4aa29a023b07a3aba8d9dd8b85c8b676e32/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f776e782f6368616e67656c6f672d757064617465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/wnx/changelog-updater)[![Tests](https://github.com/stefanzweifel/php-changelog-updater/actions/workflows/run-tests.yml/badge.svg)](https://github.com/stefanzweifel/php-changelog-updater/actions/workflows/run-tests.yml)[![Check & fix styling](https://github.com/stefanzweifel/php-changelog-updater/actions/workflows/php-cs-fixer.yml/badge.svg)](https://github.com/stefanzweifel/php-changelog-updater/actions/workflows/php-cs-fixer.yml)[![phpstan](https://github.com/stefanzweifel/php-changelog-updater/actions/workflows/phpstan.yml/badge.svg)](https://github.com/stefanzweifel/php-changelog-updater/actions/workflows/phpstan.yml)[![Total Downloads](https://camo.githubusercontent.com/19efd84fbd47db43744732b86642d946db4e51df3f62757df8df252aad44a72d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f776e782f6368616e67656c6f672d757064617465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/wnx/changelog-updater)

Want to automate the process of updating your changelog with GitHub Actions? Checkout the [stefanzweifel/changelog-updater-action](https://github.com/stefanzweifel/changelog-updater-action) which does exactly that.

*If your changelog follows the ["Keep a Changelog"](https://keepachangelog.com/) format and has a "Unreleased" heading in it, the CLI will update the link in and place the release notes below heading.*

Installation
------------

[](#installation)

You can install the changelog-updater CLI as a composer dependency in your project or globally. It requires PHP 8.2 or higher.

```
composer global require wnx/changelog-updater
```

Usage
-----

[](#usage)

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" \
--compare-url-target-revision="1.x" \
--write
```

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

If a given version already exists in the CHANGELOG, the CLI will display a warning and not update the CHANGELOG.

### CLI Options

[](#cli-options)

### `--release-notes`

[](#--release-notes)

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

### `--latest-version`

[](#--latest-version)

**Required**. Version number of the latest release. The value will be used as the heading text if `--heading-text` is not set. If the changelog has a "Unreleased" heading, the value will be used in the updated compare URL.

Example: `v1.0.0`

### `--release-date`

[](#--release-date)

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

### `--path-to-changelog`

[](#--path-to-changelog)

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

### `--compare-url-target-revision`

[](#--compare-url-target-revision)

Optional (Defaults to `HEAD`). If the changelog has a "Unreleased" heading, the value will be used together with the `--latest-version` value in the updated compare URL.

### `--write`

[](#--write)

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

### `--github-actions-output`

[](#--github-actions-output)

Optional. Will output values for `UNRELEASED_COMPARE_URL` and `RELEASE_COMPARE_URL` that can be picked up by GitHub Actions and further used in ones Workflow.

### `--heading-text`

[](#--heading-text)

Optional (Defaults to value of `--latest-version`). The text value used in the heading that is created for the new release.

```
## heading-text - 2021-02-01
## [heading-text](https://github.com/org/repo/compare/v0.1.0...v1.0.0) - 2021-02-01
```

### `--parse-release-notes`

[](#--parse-release-notes)

Optional. Tell the CLI explicitly to use the content between an "Unreleased Heading" and the previous version heading as release notes. The value from `--release-notes` will be ignored.

### `--hide-release-date`

[](#--hide-release-date)

Optional. Don't add the release date to the release heading.

### `--parse-github-usernames`

[](#--parse-github-usernames)

Optional. Look for GitHub usernames in `--release-notes` and linkify them. Currently not supported for release notes that are located in the existing changelog.

```
- Added a new feature @stefanzweifel
+ Added a new feature [@stefanzweifel](https://github.com/stefanzweifel)
```

Expected Changelog Formats
--------------------------

[](#expected-changelog-formats)

The CLI does its best to place the given release notes in the right place. The CLI looks for the first second level heading in your current `CHANGELOG.md` file. It assumes that this heading represents the previous version. Here is an example of a `CHANGELOG.md` that the CLI can understand.

```
# Changelog

## v1.0.0 - 2021-11-01

### Added
- Initial Release

```

The CLI will then place the new version and its release notes **above** the existing versions.

```
# Changelog

+ ## v1.1.0 - 2021-11-10
+
+ ### Added
+
+ * New Feature
+
## v1.0.0 - 2021-11-01

### Added

* Initial Release
```

If the changelog does not contain a second level heading, it considers the changelog to be "empty". It will then place the release notes at the bottom of the document.

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

+## v1.0.0 - 2021-11-01
+
+### Added
+
+* Initial Release
```

---

If your changelog follows the ["Keep a Changelog"](https://keepachangelog.com/) format and contains an "Unreleased"-heading with a link to the repository compare view, the CLI will automatically update the link in the Unreleased heading.

Here is an example of a changelog, before it is updated with the CLI.

```
# Changelog

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

Please do not update the unreleased notes.

## v1.0.0 - 2021-01-01

### Added
- Initial Release

```

Below you find a diff-view of how the CLI will update the changelog.

```
# Changelog

+## [Unreleased](https://github.com/org/repo/compare/v1.1.0...HEAD)
-## [Unreleased](https://github.com/org/repo/compare/v1.0.0...HEAD)

Please do not update the unreleased notes.

+## [v1.1.0](https://github.com/org/repo/compare/v1.0.0...v1.1.0) - 2021-02-01
+
+### Added
+
+* New Feature A
+* New Feature B
+

## v1.0.0 - 2021-01-01

### Added
* Initial Release
```

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

---

If you don't have a "Unreleased"-heading in your changelog, but the headings of your previous releases contain a link to the repository compare view, the CLI will add links to the compare view to the added release heading.

```
# Changelog

+## [v1.1.0](https://github.com/org/repo/compare/v1.0.0...v1.1.0) - 2021-02-01
+
+### Added
+
+* New Feature A
+* New Feature B
+

## [v1.0.0](https://github.com/org/repo/compare/v0.1.0...v1.0.0) - 2021-01-01

### Added
* Initial Release
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Stefan Zweifel](https://github.com/stefanzweifel)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

50

—

FairBetter than 96% of packages

Maintenance67

Regular maintenance activity

Popularity28

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity74

Established project with proven stability

 Bus Factor1

Top contributor holds 72% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~48 days

Recently: every ~125 days

Total

26

Last Release

542d ago

Major Versions

v0.4.1 → v1.0.02021-08-14

PHP version history (3 changes)v0.1.0PHP ^8.0

v1.6.1PHP ^8.1

v1.11.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/b6e76cb0a5ed6788731857a8b4e1a27e283cef831fe42bf9636549bf9b35ddd7?d=identicon)[stefanzweifel](/maintainers/stefanzweifel)

---

Top Contributors

[![stefanzweifel](https://avatars.githubusercontent.com/u/1080923?v=4)](https://github.com/stefanzweifel "stefanzweifel (170 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (63 commits)")[![sy-records](https://avatars.githubusercontent.com/u/33931153?v=4)](https://github.com/sy-records "sy-records (2 commits)")[![davidrushton](https://avatars.githubusercontent.com/u/4039772?v=4)](https://github.com/davidrushton "davidrushton (1 commits)")

---

Tags

changelogcliphp-clicliconsolechangelogkeep-a-changelog

###  Code Quality

TestsPest

Static AnalysisPHPStan, Rector

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/wnx-changelog-updater/health.svg)

```
[![Health](https://phpackages.com/badges/wnx-changelog-updater/health.svg)](https://phpackages.com/packages/wnx-changelog-updater)
```

###  Alternatives

[symfony/console

Eases the creation of beautiful and testable command line interfaces

9.8k1.1B11.3k](/packages/symfony-console)[nunomaduro/collision

Cli error handling for console/command-line PHP applications.

4.6k331.8M8.5k](/packages/nunomaduro-collision)[nunomaduro/termwind

It's like Tailwind CSS, but for the console.

2.5k239.8M286](/packages/nunomaduro-termwind)[wp-cli/php-cli-tools

Console utilities for PHP

68325.0M367](/packages/wp-cli-php-cli-tools)[seld/cli-prompt

Allows you to prompt for user input on the command line, and optionally hide the characters they type

24725.8M17](/packages/seld-cli-prompt)[kevinlebrun/colors.php

Colors for PHP CLI scripts

3426.7M45](/packages/kevinlebrun-colorsphp)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
