Skip to content

feat: make init command interactive - #2087

Merged
bluwy merged 11 commits into
changesets:mainfrom
trueberryless:feat/interactive-init-command
Jun 30, 2026
Merged

feat: make init command interactive#2087
bluwy merged 11 commits into
changesets:mainfrom
trueberryless:feat/interactive-init-command

Conversation

@trueberryless

@trueberryless trueberryless commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Description

This PR adds support for making the init command interactive.

The new command flow uses the clack utilities and has the following flow:

  1. Should the GitHub integration be used for changelogs?
    (Options: Yes / No, defaults to No)

    1a. [If Yes]: What is the GitHub repository? (e.g. org/repo)
    (Text input: requires a non-empty string)

  2. Should changeset files and version bumps be automatically committed?
    (Options: Yes / No, defaults to No)

  3. Should packages be published publicly or privately by default?
    (Options: Private, Public, defaults to Private since the access option defaults to "restricted")

  4. Which base branch should be used?
    (Text input: defaults to "main" if left blank)


I have also added new test cases to confirm the behaviour and tested it manually after running pnpm build.

I also ran pnpm check-all before committing.
I hope targeting main is correct. Please let me know if next should be the branch target.

I did the docs in #2088 since it needs to target next-docs. To be honest, I am a little confused about the correct workflow 😅

@changeset-bot

changeset-bot Bot commented Jun 11, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: c1cdb01

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

@codecov

codecov Bot commented Jun 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 91.42857% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.31%. Comparing base (bdf3431) to head (c1cdb01).
⚠️ Report is 20 commits behind head on main.

Files with missing lines Patch % Lines
packages/cli/src/utils/cli-utilities.ts 0.00% 2 Missing ⚠️
packages/cli/src/commands/init/index.ts 96.96% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2087      +/-   ##
==========================================
+ Coverage   85.05%   87.31%   +2.25%     
==========================================
  Files          66       71       +5     
  Lines        2530     2546      +16     
  Branches      701      680      -21     
==========================================
+ Hits         2152     2223      +71     
+ Misses        348      299      -49     
+ Partials       30       24       -6     

☔ 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.

Comment thread packages/cli/src/commands/init/index.ts Outdated
Comment thread packages/cli/src/commands/init/index.ts Outdated
Comment thread packages/cli/src/commands/init/index.ts Outdated
Comment thread packages/cli/src/commands/init/index.ts Outdated
trueberryless and others added 2 commits June 20, 2026 17:56
Co-authored-by: Bjorn Lu <34116392+bluwy@users.noreply.github.com>
Comment thread packages/cli/src/commands/init/index.ts Outdated

@beeequeue beeequeue left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i don't really like the order of the properties in this generated config, but we can fix that later if we want to.

@trueberryless

Copy link
Copy Markdown
Contributor Author

i don't really like the order of the properties in this generated config, but we can fix that later if we want to.

I played around with the idea before but thought it was unnecessary. Given that you mention it as well know, I decided to reimplement it, so the order of properties is now:

const priorityOrder = [
  "$schema",
  "changelog",
  "baseBranch",
  "commit",
  "access",
  "ignore",
  "fixed",
  "linked",
  "format",
  "updateInternalDependencies",
];

Feel free to suggest your desired sorting of properties (I just took the one that is used in current (main) init command.

Comment thread packages/cli/src/commands/init/index.ts
trueberryless and others added 2 commits June 27, 2026 12:25
@bluwy

bluwy commented Jun 30, 2026

Copy link
Copy Markdown
Member

Probably don't need to ask for the github repo anymore with #1871 but we can also follow up on that later

@bluwy
bluwy added this pull request to the merge queue Jun 30, 2026
Merged via the queue into changesets:main with commit edc30c8 Jun 30, 2026
12 checks passed
@trueberryless
trueberryless deleted the feat/interactive-init-command branch June 30, 2026 05:59
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.

Improve init command

3 participants