Repository navigation
feat: add msg flag to add command - #1839
Merged
Andarist merged 8 commits intoFeb 23, 2026
Merged
Conversation
- Introduced a new `--msg` option for the `add` command to allow users to provide a custom summary for changesets. - Updated the `CliOptions` type to include the `msg` property. - Modified the `add` function and `createChangeset` to handle the new message parameter, enhancing user experience by allowing direct input of change summaries.
- Added tests to verify that the `--msg` option correctly passes a custom summary to the `add` command. - Included scenarios for handling empty summaries and using messages with empty changesets. - Ensured that the confirmation flow remains intact when a summary is provided.
🦋 Changeset detectedLatest commit: 20b9441 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1839 +/- ##
==========================================
+ Coverage 81.33% 81.46% +0.12%
==========================================
Files 54 55 +1
Lines 2277 2336 +59
Branches 679 692 +13
==========================================
+ Hits 1852 1903 +51
- Misses 420 428 +8
Partials 5 5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
leochiu-a
marked this pull request as draft
February 6, 2026 03:26
leochiu-a
marked this pull request as ready for review
February 6, 2026 05:12
Andarist
force-pushed
the
feat/add-msg-flag-to-add-command
branch
from
February 23, 2026 13:08
2de1b51 to
20b9441
Compare
Merged
This was referenced Apr 3, 2026
nnecec
pushed a commit
to nnecec/changesets-docs
that referenced
this pull request
Apr 16, 2026
* feat(cli): add support for custom message in `add` command - Introduced a new `--msg` option for the `add` command to allow users to provide a custom summary for changesets. - Updated the `CliOptions` type to include the `msg` property. - Modified the `add` function and `createChangeset` to handle the new message parameter, enhancing user experience by allowing direct input of change summaries. * test(cli): enhance tests for `add` command with custom message support - Added tests to verify that the `--msg` option correctly passes a custom summary to the `add` command. - Included scenarios for handling empty summaries and using messages with empty changesets. - Ensured that the confirmation flow remains intact when a summary is provided. * docs(cli): update command line options to include `--msg` for custom summary * chore: update changelog * rename to message * add test * tweak --------- Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds a new
--msg <text>flag tochangeset add(and the defaultchangesetcommand path) so users can provide the changeset summary directly from the CLI.The goal is to support non-interactive and script-friendly usage while preserving the existing confirmation workflow before writing the changeset.
resolve: #1833
Key Changes
--msgin argument parsing and option typing, then passed it through the run pipeline into theaddcommand.add/createChangesetflow to use the CLI-provided summary and skip only the summary prompt when--msgis present.--msgin tests, including default-command forwarding, explicitaddforwarding, empty-string summaries, and--emptywith a provided summary.docs/command-line-options.md,packages/cli/README.md) and added a release note changeset for@changesets/cli.Type of Change
Test Plan
Manual Testing
changeset add --msg "Fix auth token refresh handling", complete package/version selections, and confirm the changeset..changeset/*.mdcontains the provided summary.changeset --msg "Default command summary"andchangeset add --empty --msg ""to verify both command paths forward--msg, including empty summaries.Automated Testing
yarn test packages/cli/src/run.test.ts -t "should pass --msg"yarn test packages/cli/src/commands/add/__tests__/add.ts -t "summary passed via msg|empty summary when msg is an empty string|using msg with empty changesets"Breaking Changes
None
Checklist