(This is a fork of https://github.com/rcmachado/changelog)
changelog
is a command-line application to read and manipulate
CHANGELOG.md
files that follows the keepachangelog.com spec.
It can normalize the file (fmt
), create a release (release
) and
show a specific version (show
). See Usage for details.
# Initialize a new CHANGELOG.md file
$ changelog init --compare-url=https://github.com/myorg/myrepo/compare/abcdef...1234
# Add a first message under "Added" section
$ changelog added "Initial commit"
# Create release
$ changelog release 0.1.0
# Show latest release number
$ changelog latest
=> 0.1.0
The easiest way to install it is to download the latest version from GitHub releases.
There are precompiled binaries for macOS and Linux.
Clone the repository and build the executable:
make build
This will generate a changelog
binary that can be copied to /usr/local/bin
:
cp changelog /usr/local/bin
changelog manipulate and validate markdown changelog files following the keepachangelog.com specification.
Usage:
changelog [command]
Available Commands:
added Add item under 'Added' section
bundle Bundles files containing unrelased changelog entries
changed Add item under 'Changed' section
deprecated Add item under 'Deprecated' section
fixed Add item under 'Fixed' section
fmt Reformat the change log file
help Help about any command
init Initializes a new changelog
latest Show latest released version number
release Change Unreleased to [version]
removed Add item under 'Removed' section
security Add item under 'Security' section
show Show changelog for [version]
Flags:
-f, --filename string Changelog file or '-' for stdin (default "CHANGELOG.md")
-h, --help help for changelog
-o, --output string Output file or '-' for stdout (default "-")
Use "changelog [command] --help" for more information about a command.
Outputs a changelog with only preamble and Unreleased version to standard output. You can specify a filename using --output/-o
flag:
$ touch CHANGELOG.md
$ changelog init -o CHANGELOG.md --compare-url https://github.com/cucumber/changelog/compare/abcdef...HEAD
Changelog file 'CHANGELOG.md' created.
Normalize file format (see Formatting for the specific transformation applied):
changelog fmt
Show what will be in the next release:
changelog show Unreleased
Show the change log for a specific version:
changelog show 1.2.3
Create a new release:
changelog release 1.2.4
If you use a prefix for git tags, specify a tag format:
changelog release --tag-format "v%s" 1.2.4
fmt
command normalizes the changelog file. The idea is to always have
the same output, no matter how messy the file is. Right now it doesn't
do much, but the plan is to evolve it as a kind of go fmt
for
changelogs.
Currently, the following transformations are applied:
-
Feel free to fork and submit a PR. You can also take a look, at the Issues tab to see some ideas.
Licensed under MIT. See LICENSE file for details.