A simple tool to make changes to your CHANGELOG.md file easier, if they
follow the keep a changelog convention.
- This is a Rust project and the binaries are not published anywhere. This means that you need to have Rust/Cargo installed.
- This tool talks to the GitHub API, therefore you need to have a
GITHUB_API_TOKENenvironment variable.
cargo build --releaseThis will create a changelog binary at ./target/release/changelog.
I am using zshrc, and I make sure to export the ./target/release/ folder so
that I can automatically run the changelog binary.
PATH=./target/release:$PATHIn addition, I also have this PATH, so that I can run changelog from
anywhere on my system.
PATH=/path-to-changelog-project/target/release:$PATHEvery command has the following options:
-f, --filename <FILENAME> The changelog filename [default: CHANGELOG.md]
-h, --help Print help information
--pwd <PWD> The current working directory [default: .]
This will create a new CHANGELOG.md file if it doesn't already exist. It will also take the shared options into account from above.
changelog initEvery command behaves exactly the same and will add a new entry to the
CHANGELOG.md file in their own section.
You can use a GitHub link to a PR, issue, commit or discussion. This will add a link with the title of the resource from above and a link to it.
changelog <command> https://github.com/<owner>/<repo>/pull/<number>If you want to write your own message instead of fetching the title from the
GitHub resource, then you can use the -m or --message flag instead:
changelog <command> -m "My new changelog entry"Here is a list of all the commands and their sections:
changelog addadds a new entry to the### Addedsectionchangelog fixadds a new entry to the### Fixedsectionchangelog changeadds a new entry to the### Changedsectionchangelog removeadds a new entry to the### Removedsectionchangelog deprecateadds a new entry to the### Deprecatedsection
This will print out the contents of a version as plain text, which is useful if you want to get this data to insert into your release notes.
By default we will print out the notes from the [Unreleased] section if
entries already exist in that section. If not, then we will copy the contents
of the latest version.
changelog notes unreleasedthis will always print the notes of the[Unreleased]section, even if nothing exists yet.changelog notes latestthis will always print the notes of the newest version in the list.changelog notes 3.0.5, this will print the notes of a specific version.
This will allow you to list the available versions (without the notes) as a quick summary. By default we will list the 10 most recent versions.
-a, --amount <AMOUNT>amount of versions to show [default: 10]--allshorthand for "--amount all"
E.g.:
$ changelog list
- unreleased https://github.com/<owner>/<repo>/compare/v0.1.0...HEAD
- 0.1.0 https://github.com/<owner>/<repo>/releases/tag/v0.1.0This allows you to create a new "release". It will take anything from the
[Unreleased] section into the new version. It will also add the current date
and update the references.
Currently we assume that you have a
package.jsonfile, if you are using one of the implicit/relative strategies.
We have different strategies for releasing:
inferwhen you run thechangelog releaseas-is, then we willinferthe version found in thepackage.json. This is useful in case you just rannpm version patchfor example.majorwhen you runchangelog release major, then we will take the current version frompackage.json, and increase themajorpart of the semver.minorwhen you runchangelog release minor, then we will take the current version frompackage.json, and increase theminorpart of the semver.patchwhen you runchangelog release patch, then we will take the current version frompackage.json, and increase thepatchpart of the semver.<explicit>when you runchangelog release 3.0.2, then we use the semver you provided.
You can also add the --with-npm flag, this will:
- Run
git add <changelog-file.md> && git commit -m "update changelog" - Run
npm version <version>- This will update the
package.jsonfile with the new version - This will also create a git tag
- This will update the