2020 summer update

A long time has passed since we created this program. Our workflow has evolved since and we don't use it any more. Our npm packages live in a monorepo on Github, deployment is via Semaphore CI and commitizen automates all the versioning and changelog updates.

We're saying this because normally we use our programs, following the "eat what you cook" principle of Indieweb opens in a new tab

How it works

This is a CLI app. Once installed, call it in the root folder where your changelog.md sits:


On a default setting, chlu just silently does the job — checks and fixes your changelog. If you want some output, call it with --loud flag. It will say "OK" each time it writes successfully.

Chlu works on both GitLab, Bitbucket and GitHub repositories.

chlu stands for CHangeLog Update. We should note that all changelogs should follow the rules given by http://keepachangelog.com. Now, the tedious part is diff links. Chlu takes care of them. Also, changelog should have all dates in ISO format, should have diff links between changelog entries and use a consistent title format, for example, ## [1.11.0] - 2018-07-24. These are main things, and chlu-cli automates updating all that.

What it does


7 main features (see above):

  1. Wraps the version with a link (brackets) and creates the diff URL in the footer.
  2. Adds missing diff links in the footer. It's intelligent-enough to detect existing links and their order.
  3. If the .git repo data is successfully read, it will create/convert diff links either in Bitbucket- or GitHub-based repository changelogs.
  4. User account name in diff link is set correctly as per package.json
  5. Project's name in diff link is set correctly as per package.json
  6. "from" version is chosen wisely. If there is no git data available, a previous entry in the changelog will be used. But if there is, the real, previous version will be used. In practice, often there are many patch releases between changelog entries (hence the word used in the title — "notable changes"). If we merely calculated the diff between changelog entries (usually minor/major releases), all patch releases would get caught in between and skew the picture of what was released for real.
  7. If dates are not in ISO format opens in a new tab (year-month-date), we try to convert them. Couple well-known projects with messed-up changelogs are used as guinea pigs in our unit tests.

A nifty setup idea

It would be tedious and unnecessary to run chlu manually. Not to mention, you might even forget to run it.

What we suggest is, add chlu to one of your aliases, for example, git add .. That's what we do.

For example, edit your .zshrc (or Bash config, or whatever-you-are-using-shell's config) file to contain:

# create a function which runs commands if certain files exist, and skips if they don't:
my-git-add() {
[ -e readme.md ] && doctoc readme.md
[ -e changelog.md ] && chlu
git add .

# create alias for your command, call the function:
alias gaa=my-git-add

The example above runs:

It means, you always get your readme, changelog committed in a correct, updated state and all dependencies checked.


See it in the monorepo opens in a new tab, on GitHub.


To report bugs or request features or assistance, raise an issue on GitHub opens in a new tab.

Any code contributions welcome! All Pull Requests will be dealt promptly.


MIT opens in a new tab

Copyright © 2010–2021 Roy Revelt and other contributors

Related packages:

📦 array-of-arrays-sort-by-col 4.0.1
Sort array of arrays by column, rippling the sorting outwards from that column
📦 array-includes-with-glob 4.0.1
Like _.includes but with wildcards
📦 all-named-html-entities 2.0.1
List of all named HTML entities
📦 array-of-arrays-into-ast 3.0.1
Turns an array of arrays of data into a nested tree of plain objects
📦 array-group-str-omit-num-char 5.0.1
Groups array of strings by omitting number characters
📦 array-pull-all-with-glob 6.0.1
Like _.pullAll but with globs (wildcards)
📦 arrayiffy-if-string 4.0.1
Put non-empty strings into arrays, turn empty-ones into empty arrays. Bypass everything else