API Reference

Changesets

Release workflow tool that records intent per change, versions monorepo packages, and publishes with generated changelogs.

Official Documentation ↗
CompatibilityThis documentation covers version v2 (@changesets/cli). Check the official docs for the latest API surface.

Installation

npmnpm install --save-dev @changesets/cli
pnpmpnpm add -D @changesets/cli

Methods

Overview

Changesets is a release workflow tool that captures intent per change as small files, then versions packages and writes changelogs from them. This reference lists the most frequently used APIs with accurate signatures and runnable snippets.

Core APIs

  • changeset add — Interactive prompt that records a changeset file declaring which packages changed and how.
  • changeset version — Consumes changeset files, bumps versions, and updates changelogs across the workspace.
  • changeset publish — Publishes all packages whose version is not yet on the registry and creates git tags.

Example

npx changeset add

Notes

Changesets decouples change intent from version bumping, so PRs record impact without editing versions. CI should use changeset status to enforce that changes are described.

Verification

Add a changeset for a minor bump, run changeset version, and confirm the package version and changelog both reflect the bump.

API reference evidence

Fetched from official sources on 2026-11-08T18:41:00+08:00 via WebFetch https://raw.githubusercontent.com/changesets/changesets/main/docs/command-line-options.md.

FAQ

Where are changeset files stored?
Each changeset is a markdown file under .changeset/ with YAML frontmatter listing package names and bump types (patch, minor, major).
How do changelog entries get written?
The summary you type during changeset add becomes the changelog bullet; the changeset changelog generator prepends them at version time.
How do I gate CI on missing changesets?
Run changeset status --since=origin/main in CI and fail the job when it reports packages changed without a changeset.