https://github.com/theobrigitte/changelog-parser
A command-line tool to easily manage and manipulate changelog files, ensuring consistency with the keep a changelog format
https://github.com/theobrigitte/changelog-parser
changelog changelog-formatter changelog-generator changelog-parser keep-a-changelog
Last synced: 3 months ago
JSON representation
A command-line tool to easily manage and manipulate changelog files, ensuring consistency with the keep a changelog format
- Host: GitHub
- URL: https://github.com/theobrigitte/changelog-parser
- Owner: TheoBrigitte
- License: mit
- Created: 2025-01-22T08:53:55.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2025-01-23T09:58:32.000Z (5 months ago)
- Last Synced: 2025-02-23T06:18:36.665Z (4 months ago)
- Topics: changelog, changelog-formatter, changelog-generator, changelog-parser, keep-a-changelog
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/@theo.foobar/chlog
- Size: 48.8 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
![]()
# changelog parser
[](https://www.npmjs.com/package/@theo.foobar/chlog)
[](https://github.com/TheoBrigitte/changelog-parser/releases)
[](https://github.com/TheoBrigitte/changelog-parser/actions/workflows/build.yaml)A command-line tool to easily manage and manipulate changelog files, ensuring consistency with the [keep a changelog](https://keepachangelog.com) format.
## Features
- Format and parse: Validate and automatically format your changelog file.
- Initialize a new changelog file: Quickly set up a standardized changelog for your project.
- Add a new change to a release: Easily add a new change to your changelog.
- Add a new release: Cut a new release in your changelog.
- List all releases: Get a list of all releases in your changelog.
- Show all changes in a release: Display all changes in a specific release.
- Merge two or more changelog files: Combine multiple changelog files into one.## Installation
### From npm
```shell
npm install -g @theo.foobar/chlog
```### From source
```shell
git clone https://github.com/TheoBrigitte/changelog-parser.git
cd changelog-parser
sudo npm install -g
```## Usage
Default parameters use the `CHANGELOG.md` file in the current directory, this can be changed with the `-f` flag.
### Format and parse
The `fmt` command parses and formats the changelog file to adhere to the keep a changelog format.
```shell
chlog fmt
```This command exits with a non-zero status code if the changelog format is invalid.
```shell
chlog fmt --silent || echo "Invalid changelog format"
```Changes can be written back to the file with the `--write` flag.
### Initialize a new changelog file
The `init` command initializes a new changelog file.
```shell
chlog init
```This command creates a new changelog file with the following content:
```markdown
# ChangelogAll notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/)
and this project adheres to [Semantic Versioning](https://semver.org/).## [Unreleased]
## [0.1.0] - 2025-01-21
[Unreleased]: https://example.com/compare/v0.1.0...HEAD
[0.1.0]: https://example.com/releases/tag/v0.1.0
```This example uses default values, but title, description, url, and initial release version can be configured.
### Add a new change to a release
The `add` command adds a new change to the changelog file.
```shell
chlog add --type added "New feature"
chlog add --type security "Fix security issue"
```Those commands add the following content to the changelog file:
```markdown
### Added- New feature
### Security
- Fix security issue
```### Add a new release
The `release` command adds a new release to the changelog file.
```shell
chlog release 1.0.0
```This command adds the following content to the changelog file:
```diff
--- CHANGELOG.md
+++ CHANGELOG.md
@@ -9,2 +9,4 @@+## [1.0.0] - 2025-01-21
### Added
@@ -19,3 +21,4 @@-[Unreleased]: https://example.com/compare/v0.1.0...HEAD
+[Unreleased]: https://example.com/compare/v1.0.0...HEAD
+[1.0.0]: https://example.com/compare/v0.1.0...v1.0.0
[0.1.0]: https://example.com/releases/tag/v0.1.0
```A date can be specified with the `--date` flag.
### List all releases
The `list` command lists all releases in the changelog file.
```shell
chlog list
```This command prints the following content:
```
1.0.0
0.1.0
```### Show all changes in a release
The `show` command shows all changes in a release.
```shell
chlog show 1.0.0
```This command prints the following content:
```markdown
## [1.0.0] - 2025-01-21### Added
- New feature
### Security
- Fix security issue
```### Merge two or more changelog files
The `merge` command merges two (or more) changelog files.
```shell
chlog merge other/CHANGELOG.md
```This command merges the content from `other/CHANGELOG.md` latest release into the current changelog file.
The source release to be merged can be specified with `other/[email protected]`.
The destination release version can be specified with `--version` flag.Multiple changelog files can be merged by specifying multiple files.
## Credits
- https://github.com/oscarotero/keep-a-changelog