molt add
Record a changeset -- which packages a change affects, how much each should bump, and what the changelog should say.
molt add is also the default command: running molt with no command word runs add (see CLI reference).
Synopsis
Description
molt add writes one changeset file into .changeset/, named with a random three-word slug (for example .changeset/tidy-eels-return.md). The file records a bump type per affected package plus a human-written summary. You commit it alongside your code. See Changesets and Adding a changeset for the full walkthrough, and Changeset file format for the grammar.
There are three ways to drive it.
Interactive
With no selection flags, molt add prompts:
- Which packages changed. In a workspace, packages you have changed since the base branch are listed first. In a single-package project this step is skipped.
- How much each bumps -- a
major,minor, orpatch. Anything not chosen as major or minor is patched. - A summary for the changelog. Submitting an empty summary opens
$EDITOR.
Cancelling any prompt with Ctrl-C exits 0 and writes nothing.
Non-interactive (flags)
Select packages and bumps entirely on the command line -- the path for Dependabot, Renovate, and code generation, none of which can answer prompts.
--package pkg-a --bump minorselects packages and applies one bump type to all of them.--major pkg-a --minor pkg-b --patch pkg-cselects per bump type, changesets-style. Both--package/--bumpand the per-type flags are repeatable.
Pair either with --message for a fully non-interactive run. Without --message, molt still prompts for the summary.
Non-interactive (stdin)
molt add --stdin reads a JSON payload from standard input and writes the changeset with no TTY:
Options
Repeatable flags always yield a list, and repeated scalars keep the last value (see Option-normalization rules).
Validation
molt add rejects an invalid selection before writing anything:
- A package named in
--major/--minor/--patch/--packagethat is not in the project producesThe package <name> is passed to the --<type> option but it is not found in the project. - The same package under two bump types produces
The package <name> is passed to multiple release type options ... Please select only one release type for this package. - A project with no versionable packages exits 1 with guidance to check
ignoreand that manifests carry a version.
Exit codes
Examples
Interactive (or just molt):
Fully non-interactive, one package:
changesets-style per-type selection, several packages:
An empty changeset for a change that needs no release:
From a machine, over stdin:
See also
- Adding a changeset -- the hands-on guide.
- Changesets and Changeset file format.
- molt version -- consume the changesets
addwrites.