Skip to content

Added new --major, --minor, --patch flags to the add command - #1121

Merged
Andarist merged 9 commits into
changesets:mainfrom
Sh031224:feature/add-without-interaction
Jun 30, 2026
Merged

Added new --major, --minor, --patch flags to the add command#1121
Andarist merged 9 commits into
changesets:mainfrom
Sh031224:feature/add-without-interaction

Conversation

@Sh031224

@Sh031224 Sh031224 commented Mar 28, 2023

Copy link
Copy Markdown
Contributor

What is the Change?

Added new flag to add in @changeset/cli.

  • --major
  • --minor
  • --patch

If the major, minor, and patch flags are present, no package is selected by user interaction.
Also, if there is a message flag, the summary can be injected as a flag without being input through interaction.

Reference: #1118

@changeset-bot

changeset-bot Bot commented Mar 28, 2023

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 6e634d2

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@changesets/cli Minor

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

@codesandbox-ci

This comment was marked as outdated.

@1oglop1

1oglop1 commented Apr 9, 2023

Copy link
Copy Markdown

@Sh031224 Thanks for contributing this! I'd really like this feature.
Question though:
Can I select the package using glob --patch @pkg-*?

@Sh031224

Sh031224 commented Apr 9, 2023

Copy link
Copy Markdown
Contributor Author

@Sh031224 Thanks for contributing this! I'd really like this feature. Question though: Can I select the package using glob --patch @pkg-*?

I hadn't thought of a way to use glob.
I'll add it to the commit with an additional implementation!

@Sh031224

Sh031224 commented Apr 9, 2023

Copy link
Copy Markdown
Contributor Author

@1oglop1
I've pushed an extra commit so you can use it with the globs you said!

@Dimava

Dimava commented Jun 7, 2023

Copy link
Copy Markdown

I would like to also see a flag for the name of generated file, in case user doesn't want to have it randomly generated

@Sh031224

This comment was marked as off-topic.

@Dimava

Dimava commented Jun 14, 2023

Copy link
Copy Markdown

I would like to also see a flag for the name of generated file, in case user doesn't want to have it randomly generated

I didn't quite understand what you meant. Can you explain in more detail?

As a personal preference, I use changeset files not with randomized .changesets/unicorn-in-space.md but with some more meaningful unique names like .changesets/Issue1337.md

So I would be happy to see --filename foo which would create .changesets/foo.md instead of .changesets/wooden-icecream.md

@Sh031224

This comment was marked as off-topic.

@wujekbogdan

wujekbogdan commented Nov 2, 2023

Copy link
Copy Markdown

What is the status of this pull request? Is there any chance it will be merged soon?


// EDIT
I'm testing this feature, and everything works fine except that the final confirmation is still required:

🦋  Note: All dependents of these packages that will be incompatible with
🦋  the new version will be patch bumped when this changeset is applied.
🦋
🦋  Is this your desired changeset? (Y/n) › true

It would be great if there were an additional flag like --yes or --auto-approval so that we can apply changesets without any user interactions.

We can use a workaround by piping yes y to changesets, e.g.:

yes y | changesets add --message "My message" --patch @my/package

but it's kinda hacky.

@Sh031224

Sh031224 commented Nov 7, 2023

Copy link
Copy Markdown
Contributor Author

What is the status of this pull request? Is there any chance it will be merged soon?

// EDIT I'm testing this feature, and everything works fine except that the final confirmation is still required:

🦋  Note: All dependents of these packages that will be incompatible with
🦋  the new version will be patch bumped when this changeset is applied.
🦋
🦋  Is this your desired changeset? (Y/n) › true

It would be great if there were an additional flag like --yes or --auto-approval so that we can apply changesets without any user interactions.

We can use a workaround by piping yes y to changesets, e.g.:

yes y | changesets add --message "My message" --patch @my/package

but it's kinda hacky.

I would like to develop this PR further if I receive feedback from maintainers.

@Forever17s

This comment was marked as spam.

@anujshah3

Copy link
Copy Markdown

Is this PR still being tracked so it can me merged and used soon?

@Sh031224

This comment was marked as outdated.

@wujekbogdan

Copy link
Copy Markdown

@Sh031224, is there any chance you could resolve the merge conflicts? Then we would be able to apply these changes with the yarn / pnpm patch feature.

Currently, I'm using my private fork of your PR.

@Sh031224

Copy link
Copy Markdown
Contributor Author

@Sh031224, is there any chance you could resolve the merge conflicts? Then we would be able to apply these changes with the yarn / pnpm patch feature.

Currently, I'm using my private fork of your PR.

Merge conflicts were resolved by reflecting the latest code.

If you have any problems, please let me know.

@DevRCRun

DevRCRun commented Feb 7, 2024

Copy link
Copy Markdown

Is this PR still being tracked so it can me merged and used soon?

Maintainer doesn't seem to be interested in this PR at all. There isn't even an opinion.

This is a pity. For those of us wanting to automate workflows, especially if we're not on github, this sort of feature is necessary

@wujekbogdan

Copy link
Copy Markdown

There's a workaround for forking this repo; yarn and pnpm support patching dependencies.

@ramseyfeng

Copy link
Copy Markdown

What's the progress of this issue?
We want could have these flags to support Jenkins pipeline usage.

@Shurtu-gal

Copy link
Copy Markdown

This PR's merge is a urgent requirement for me to automate changeset cli workflows.

@Emadalshamery

This comment was marked as spam.

@Nelvia-07

Copy link
Copy Markdown

long waiting for this PR be merged, really need it in CI/CD.

@nazreen

nazreen commented Jul 9, 2025

Copy link
Copy Markdown

can we merge this PR @Andarist ?

@JGJP

This comment was marked as low quality.

@JGJP

This comment was marked as low quality.

@zachbellay

Copy link
Copy Markdown

@Andarist I will pay you $100 USD to merge this PR

@nazreen

nazreen commented Jun 30, 2026

Copy link
Copy Markdown

I will chip in another $2

@codecov

codecov Bot commented Jun 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.45%. Comparing base (4c26f2f) to head (6e634d2).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1121      +/-   ##
==========================================
+ Coverage   87.31%   87.45%   +0.13%     
==========================================
  Files          71       71              
  Lines        2546     2582      +36     
  Branches      681      690       +9     
==========================================
+ Hits         2223     2258      +35     
- Misses        299      300       +1     
  Partials       24       24              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Andarist Andarist changed the title feat: add new flags to run without interaction for @changesets/cli add Added new --major, --minor, --patch flags to the add command Jun 30, 2026
@Andarist
Andarist added this pull request to the merge queue Jun 30, 2026
Merged via the queue into changesets:main with commit ce2095d Jun 30, 2026
12 checks passed
@beeequeue

Copy link
Copy Markdown
Member

feel free to toss us some pennies to via OpenCollective or GH Sponsors 😉

@tats-u

tats-u commented Jun 30, 2026

Copy link
Copy Markdown

It would be much better if you don't have to repeat --major, --minor, or --patch multiple times by allowing the separation by commas (e.g. --minor pkg1,pkg2 --patch pkg3,pkg4 instead of --minor pkg1 --minor pkg2 --patch pkg3 --patch pkg4).

@beeequeue

Copy link
Copy Markdown
Member

It would be much better if you don't have to repeat --major, --minor, or --patch multiple times by allowing the separation by commas (e.g. --minor pkg1,pkg2 --patch pkg3,pkg4 instead of --minor pkg1 --minor pkg2 --patch pkg3 --patch pkg4).

please open a new issue and so we can track this!

@tats-u

tats-u commented Jun 30, 2026

Copy link
Copy Markdown

Created #2134

@zachbellay

zachbellay commented Jun 30, 2026

Copy link
Copy Markdown

@Andarist Thank you for merging this! As promised sent the $100 via GH Sponsors. Thanks for all the work you do to maintain this!

Screenshot 2026-06-30 at 9 58 22 AM

@nazreen

nazreen commented Jun 30, 2026

Copy link
Copy Markdown
Screenshot 2026-07-01 at 01 07 23

done too 🤣

@wuweiweiwu

Copy link
Copy Markdown

Thanks to the goat @Andarist 🙏🏼

https://x.com/wuweiweiwu/status/2072016283726655639?s=20

@Andarist

Copy link
Copy Markdown
Member

Note that we now have a wonderful team, and it's best to sponsor Changesets work using our OpenCollective

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[feat] Support non-interactive mode / command way to add changelog