# changelogen

> Generate Beautiful Changelogs using Conventional Commits

Latest version **0.6.2** (published 2025-07-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install changelogen
pnpm add changelogen
yarn add changelogen
bun add changelogen
```

Provides the command `changelogen`.

## Health

**Score 55/100 (C)** — status: stable.

Positive: has types; esm support; no vulnerabilities; high maintenance score; high quality score.

Warnings: low downloads; pre 1.0.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 0.6.2 |
| Published | 2025-07-06 |
| First published | 2022-05-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Dependencies | 13 |
| Unpacked size | 42.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1260 |
| Maintainers | pi0 |

## Links

- npm: https://www.npmjs.com/package/changelogen
- Repository: https://github.com/unjs/changelogen
- Homepage: https://github.com/unjs/changelogen#readme
- Issues: https://github.com/unjs/changelogen/issues
- npm.io page: https://npm.io/package/changelogen

## Dependencies (13)

- [c12](https://npm.io/package/c12.md) ^3.0.4
- [mri](https://npm.io/package/mri.md) ^1.2.0
- [open](https://npm.io/package/open.md) ^10.1.2
- [pathe](https://npm.io/package/pathe.md) ^2.0.3
- [scule](https://npm.io/package/scule.md) ^1.3.0
- [ofetch](https://npm.io/package/ofetch.md) ^1.4.1
- [semver](https://npm.io/package/semver.md) ^7.7.2
- [confbox](https://npm.io/package/confbox.md) ^0.2.2
- [consola](https://npm.io/package/consola.md) ^3.4.2
- [std-env](https://npm.io/package/std-env.md) ^3.9.0
- [pkg-types](https://npm.io/package/pkg-types.md) ^2.2.0
- [convert-gitmoji](https://npm.io/package/convert-gitmoji.md) ^0.1.5
- [node-fetch-native](https://npm.io/package/node-fetch-native.md) ^1.6.6

## Recent versions

- 0.6.2 (latest) — 2025-07-06
- 0.6.1 — 2025-03-03
- 0.6.0 — 2025-02-26
- 0.5.7 — 2024-09-19
- 0.5.6 — 2024-09-19
- 0.5.5 — 2023-08-22
- 0.5.4 — 2023-07-03
- 0.5.3 — 2023-04-13
- 0.5.2 — 2023-03-28
- 0.5.1 — 2023-03-03
- 0.5.0 — 2023-03-03
- 0.4.1 — 2023-01-20
- 0.4.0 — 2022-11-10
- 0.3.5 — 2022-10-16
- 0.3.4 — 2022-10-16
- … 18 more at https://npm.io/package/changelogen/versions

## README

# changelogen

[![npm version][npm-version-src]][npm-version-href]
[![npm downloads][npm-downloads-src]][npm-downloads-href]
[![Codecov][codecov-src]][codecov-href]
[![License][license-src]][license-href]

Generate Beautiful Changelogs using [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/)

## Quick Start

Generate a changelog in Markdown format and display in the console:

```sh
npx changelogen@latest
```

Generate a changelog, bump the version in `package.json` and update `CHANGELOG.md` (without commit):

```sh
npx changelogen@latest --bump
```

Bump the version, update `CHANGELOG.md` and make a git commit and tag:

```sh
npx changelogen@latest --release
```

## CLI Usage

```sh
npx changelogen@latest [...args] [--dir <dir>]
```

**Arguments:**

- `--from`: Start commit reference. When not provided, **latest git tag** will be used as default.
- `--to`: End commit reference. When not provided, **latest commit in HEAD** will be used as default.
- `--dir`: Path to git repository. When not provided, **current working directory** will be used as as default.
- `--clean`: Determine if the working directory is clean and if it is not clean, exit.
- `--output`: Changelog file name to create or update. Defaults to `CHANGELOG.md` and resolved relative to dir. Use `--no-output` to write to console only.
- `--noAuthors`: Skip contributors section in changelog.
- `--bump`: Determine semver change and update version in `package.json`.
- `--release`. Bumps version in `package.json` and creates commit and git tags using local `git`. You can disable commit using `--no-commit` and tag using `--no-tag`. You can enable the automatic push of the new tag and release commit to your git repository by adding `--push`.
- `--publish`. Publishes package as a new version on `npm`. You will need to set authorisation tokens separately via `.npmrc` or environment variables.
- `--publishTag` Use custom npm tag for publishing (Default is `latest`)
- `--nameSuffix`: Adds suffix to package name (Example: `--nameSuffix canary` renames `foo` to `foo-canary`)
- `--versionSuffix`: Adds suffix to package version. When set without value or to `true`, uses date + commit hash as commit
- `--canary`. Shortcut to `--bump --versionSuffix` (`--nameSuffix` will be also added if arg has a string value).
- `-r`: Release as specific version.
- `--major`: Bump as a semver-major version
- `--minor`: Bump as a semver-minor version
- `--patch`: Bump as a semver-patch version
- `--premajor`: Bump as a semver-premajor version, can set id with string.
- `--preminor`: Bump as a semver-preminor version, can set id with string.
- `--prepatch`: Bump as a semver-prepatch version, can set id with string.
- `--prerelease`: Bump as a semver-prerelease version, can set id with string.
- `--hideAuthorEmail`: Do not include author email in changelog if github username cannot be found.

> [!NOTE]
> Version numbers starting with `0.` or `0.0.` follow different rules.
>
> In these cases, the second or third digit is treated as the major version. They use the formats `0.major.minor` and `0.0.major` instead of the standard `major.minor.patch`.
>
> To ensure consistent semantic versioning, start version numbering at `1.0.0`.

### `changelogen gh release`

Changelogen has built-in functionality to sync with Github releases.

In order to manually sync a release, you can use `changelogen gh release`. It will parse current `CHANGELOG.md` from current repository (local, then remote) and create or update releases.

Usage:

```sh
npx changelogen@latest gh release [all|versions...] [--dir] [--token]
```

To enable this integration, make sure there is a valid `repository` field in `package.json` or `repo` is set in `.changelogenrc`.

By default in unauthenticated mode, changelogen will open a browser link to make manual release. By providing github token, it can be automated.

- Using environment variables or `.env`, use `CHANGELOGEN_TOKENS_GITHUB` or `GITHUB_TOKEN` or `GH_TOKEN`
- Using CLI args, use `--token <token>`
- Using global configuration, put `tokens.github=<token>` inside `~/.changlogenrc`
- Using [GitHub CLI](https://cli.github.com/) token when authenticated with `gh auth login`

## Configuration

Configuration is loaded by [unjs/c12](https://github.com/unjs/c12) from cwd. You can use either `changelog.config.json`, `changelog.config.{ts,js,mjs,cjs}`, `.changelogrc` or use the `changelog` field in `package.json`.

See [./src/config.ts](./src/config.ts) for available options and defaults.

## 💻 Development

- Clone this repository
- Enable [Corepack](https://github.com/nodejs/corepack) using `corepack enable` (use `npm i -g corepack` for Node.js < 16.10)
- Install dependencies using `pnpm install`
- Run interactive tests using `pnpm dev`

## License

Made with 💛

Published under [MIT License](./LICENSE).

<!-- Badges -->

[npm-version-src]: https://img.shields.io/npm/v/changelogen?style=flat&colorA=18181B&colorB=F0DB4F
[npm-version-href]: https://npmjs.com/package/changelogen
[npm-downloads-src]: https://img.shields.io/npm/dm/changelogen?style=flat&colorA=18181B&colorB=F0DB4F
[npm-downloads-href]: https://npmjs.com/package/changelogen
[codecov-src]: https://img.shields.io/codecov/c/gh/unjs/changelogen/main?style=flat&colorA=18181B&colorB=F0DB4F
[codecov-href]: https://codecov.io/gh/unjs/changelogen
[license-src]: https://img.shields.io/github/license/unjs/changelogen.svg?style=flat&colorA=18181B&colorB=F0DB4F
[license-href]: https://github.com/unjs/changelogen/blob/main/LICENSE

---
_Source: https://npm.io/package/changelogen · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
