Skip to content
jshacks.dev
Packages

Generate a changelog from commits

Turn conventional commit messages into a CHANGELOG.md section with conventional-changelog, grouped by feature and fix. Works with any Git history.

1 min read
Summarize in AI

If your commits follow the Conventional Commits format, a changelog can be generated rather than written. conventional-changelog reads the history since the last tag and groups it.

Shell
npx conventional-changelog -p conventionalcommits -i CHANGELOG.md -s

After a fix: commit since version 1.0.0, the top of the file gains a section like this:

Text
## [1.0.1](https://github.com/acme/my-lib/compare/v1.0.0...v1.0.1) (2026-03-02)

### Bug Fixes

* handle empty input in parse ([a1b2c3d](https://github.com/acme/my-lib/commit/a1b2c3d))

The -i flag names the file and -s writes in place, so the new section is added above older ones. The date and hash are generated from your history. See the conventional-changelog project.

Only commits that follow the format appear, and commit types such as chore and docs are hidden by default. Review the output before releasing, since it reflects commit wording, which was written for developers, not users.

If you prefer to write release notes by hand, use Changesets instead, and keep the two approaches from mixing in one repository.

Share

More snippets

Packages

Initialize a package with npm init

Initialize a package.json with npm init, skip the questions with the yes flag, and set your own defaults for author and license in npm config.

1 min read

Get new posts by email

We send one email when a new post is published. No spam.

Unsubscribe in one click. No spam, ever.