CLI
The conventional-changelog-writer binary renders a stream of already-parsed commits (as JSON) into a changelog on stdout. It’s a thin wrapper over the JS API — you supply the commits, a context, and options.
conventional-changelog-writer <path> [<path> ...]cat commits.ldjson | conventional-changelog-writerOptions
Section titled “Options”| Flag | Description |
|---|---|
-c, --context <path> | Path to a JSON file of changelog writer context variables (version, repository, …). |
-o, --options <path> | Path to a file exporting the Changelog Writer options object. .json is parsed; any other extension is imported and its default export is used. |
Providing commits
Section titled “Providing commits”Commits are read as JSON, either from stdin (a stream of newline-delimited JSON objects) or from file arguments (each file parsed as JSON):
# From stdincat commits.ldjson | conventional-changelog-writer
# From filesconventional-changelog-writer commit-1.json commit-2.jsonEach commit is an object as produced by conventional-commits-parser, so the usual shape is a pipeline that feeds parsed commits into the writer.
Example
Section titled “Example”Given a file of parsed commits and a context:
{ "type": "feat", "scope": "api", "subject": "add async write() generator", "header": "feat(api): add async write() generator", "hash": "0f7e2c1a9d3e4b5c6f7089abcdef0123456789ab", "notes": [], "references": [] }{ "type": "fix", "scope": "cli", "subject": "resolve config path relative to cwd", "header": "fix(cli): resolve config path relative to cwd", "hash": "a3b9d8472e1f0c9b8a7d6e5f4c3b2a1908f7e6d5", "notes": [], "references": [] }{ "version": "1.2.0", "repoUrl": "https://github.com/acme/app"}Rendering with just the context groups commits by their raw type (the unstyled default):
cat commits.ldjson | conventional-changelog-writer -c context.json## 1.2.0 (2026-07-01)
### feat
* feat(api): add async write() generator ([0f7e2c1](https://github.com/acme/app/commits/0f7e2c1))
### fix
* fix(cli): resolve config path relative to cwd ([a3b9d84](https://github.com/acme/app/commits/a3b9d84))To get formatted sections, point --options at a file that exports a preset’s writer options:
import createPreset from 'conventional-changelog-conventionalcommits'
export default createPreset().writercat commits.ldjson | conventional-changelog-writer -c context.json -o writer.mjs## 1.2.0 (2026-07-01)
### Features
* **api:** add async write() generator ([0f7e2c1](https://github.com/acme/app/commit/0f7e2c1a9d3e4b5c6f7089abcdef0123456789ab))
### Bug Fixes
* **cli:** resolve config path relative to cwd ([a3b9d84](https://github.com/acme/app/commit/a3b9d8472e1f0c9b8a7d6e5f4c3b2a1908f7e6d5))