feat(init): built-in diff viewer and auto-commit with --yes

Open
#660 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Quiet
Tech stack
typescript
Domain
cli

Research direction

Start with formatResult() and buildSummaryLines() in src/lib/init/formatters.ts, then trace WizardOptions.yes and ApplyPatchsetPayload in src/lib/init/types.ts through src/lib/init/wizard-runner.ts. Verify how the wizard currently displays summaries and handles --yes. Done means patched files show colored unified diffs, --yes commits afterward, and interactive mode retains the review prompt.

Written by the indexing model from the issue text.

Description

enhancement

Summary

After the init wizard applies file changes, the CLI prints a static message — "Please review the changes above before committing." — but doesn't actually show the diffs. Users have to manually inspect the working tree to understand what changed. Additionally, when running with --yes (non-interactive mode), the wizard still stops without committing, requiring manual intervention.

This issue proposes two improvements:

  1. Built-in diff viewer — display inline diffs of all applied patches so users can review changes without leaving the terminal
  2. Auto-commit with --yes — when the user opts into non-interactive mode, automatically commit the wizard's changes after displaying the diff summary

Current Behavior

  • formatResult() in src/lib/init/formatters.ts builds a summary of changed files (create/modify/delete) via buildSummaryLines() and displays it with note()
  • A static log.info("Please review the changes above before committing.") message follows
  • The --yes flag auto-selects prompts and confirms but does not commit the resulting changes
  • Full patch data (including diffs) is available in ApplyPatchsetPayload but is not surfaced to the user

Proposed Behavior

  • After the wizard completes, render a colored unified diff of each patched file (using the patch data already available in ApplyPatchsetPayload)
  • When --yes is set, auto-commit the changes after displaying the diff summary (skip the "please review" message)
  • When --yes is not set, show the diff and keep the existing review prompt

References

  • src/lib/init/formatters.tsformatResult() and buildSummaryLines()
  • src/lib/init/types.tsWizardOptions.yes and ApplyPatchsetPayload
  • src/lib/init/wizard-runner.ts — wizard execution flow

Originated from a review comment by @BYK.

Dominant language
TypeScript
Stars
121
Forks
14
Avg merge
22h 3m
Merged PRs (30d)
94

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from getsentry/cli

All issues in getsentry/cli

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.