Command line tool for generating a changelog from git tags and commit history
npm install -g auto-changelog
Just run in a local git repo. git log
is run behind the scenes in order to parse commits.
auto-changelog # Writes log to CHANGELOG.md in current directory
Specify an output file with -o
or --output
.
auto-changelog --output HISTORY.md # Writes log to HISTORY.md
Specify a theme with -t
or --template
.
auto-changelog --template compact # Writes log using compact template
npm install auto-changelog --save-dev
- Add
auto-changelog --package; git add CHANGELOG.md
to theversion
scripts in yourpackage.json
:
{
"name": "package",
"devDependencies": {
"auto-changelog": "*"
},
"scripts": {
"version": "auto-changelog --package; git add CHANGELOG.md"
}
}
Using --package
or -p
uses the version
from package.json
as the latest release, so that all commits between the previous release and now become part of that release. Essentially anything that would normally be parsed as Unreleased
will now come under the version
from package.json
Now every time you run npm version
, the changelog will automatically update and be part of the version commit.
See keep-a-changelog.
The command parses a git commit history and generates a changelog based on tagged versions, merged pull requests and closed issues. The default output attempts to follow the schema outlined by keep-a-changelog. See a simple example in this very repo.
Because keeping a changelog can be tedious and difficult to get right. If you don’t have the patience for a hand-crafted, bespoke changelog then this makes keeping one rather easy. It also can be automated if you’re feeling extra lazy (see What you might do if you’re clever above).