Command line tool for generating a changelog from git tags and commit history
Clone or download
Pull request Compare This branch is 148 commits behind CookPete:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src
test
.gitignore
.npmignore
.travis.yml
CHANGELOG.md
LICENSE
README.md
package.json

README.md

auto-changelog

Command line tool for generating a changelog from git tags and commit history

Latest npm version Build Status Dependency Status devDependency Status

Installation

npm install -g auto-changelog

Usage

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

What you might do if you’re clever

  • npm install auto-changelog --save-dev
  • Add auto-changelog --package; git add CHANGELOG.md to the version scripts in your package.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.

FAQ

What’s a changelog?

See keep-a-changelog.

What does this do?

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.

Why do I need it?

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).