Repository navigation
feat(cli): Answer wizard feature questions with flags - #2659
Merged
Merged
Conversation
`sentry wizard` gets one flag per yes/no question the wizards share: `--tracing`, `--replay`, `--logs`, `--profiling`, `--instrumentation-api` and `--example`. `--<flag>` answers yes and `--no-<flag>` answers no in every wizard that asks it; an unset flag still asks. The flags come from one registry (`WIZARD_ANSWER_FLAGS`), and the prompt helpers read the answers through `answerOrAsk`. `Feature.flag` is required, so a new feature question can't be added without one. Co-Authored-By: BYK <126780+BYK@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
BYK
approved these changes
Dec 1, 2026
BYK
left a comment
Member
There was a problem hiding this comment.
Nice, we should also deduplicate and centralise the text for the flags and the prompts so they cannot diverge.
Regarding "flags that make --help noisy", we can make them hidden as long as adding the flag serves a purpose like completing the wizard in a non-interactive manner.
I like your printing instructions idea. I think we can then connect this and sentry init together
`WIZARD_ANSWER_FLAGS` now holds each question's wording. The prompt (`askFlagQuestion`), the flag's `--help` text and the log line of an answered question are built from it, so they can't diverge. Features drop their own `prompt`, and the Android and React Native Logs/Replay confirms use the shared question too. `--example` splits into `--example-page` and `--example-component`, one flag per question. The @stricli/core patch now fixes `undoNegation` for kebab-case names: it sliced `no-` plus one more character, so `--no-example-page` and `--no-instrumentation-api` were rejected although `--help` listed them. Co-Authored-By: BYK <burak.kaya@sentry.io>
…wizard `runWizard` replaced the stored answers on every call, so the sourcemaps wizard's redirect to SvelteKit or React Native, which calls `runWizard` again without answers, wiped them and asked the questions the flags had answered. `sentry wizard` now stores the answers itself, once, before the first flow starts. Co-Authored-By: BYK <burak.kaya@sentry.io>
14 of 16 tasks
This branch was successfully deployed
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
Follow-up to the review on #2652: a systematic way to answer wizard questions with guessable, deterministic flags. This PR adds the mechanism and covers the yes/no feature questions the wizards share.
sentry wizardgets--tracing,--replay,--logs,--profiling,--instrumentation-api(reactRouter),--example-pageand--example-component.--<flag>answers yes and--no-<flag>answers no, in every wizard that asks the question. A flag that isn't set still asks. An answered question is logged (Session Replay: no (--no-replay)), so the run's output still shows it.How it stays systematic
WIZARD_ANSWER_FLAGS(lib/wizard/utils/answers.ts), holds each flag's label and the wording of its question. The prompt (askFlagQuestion), the flag's--helptext and the log line are all built from it, so they can't diverge. The command builds its flags from the registry, so--help, the docs and the skill reference list them with no extra step.askFlagQuestion(flag, hints)asks a question unless its flag answered it.sentry wizardstores the parsed flags once, before the first flow starts, so flows don't pass them along and a flow that hands over to another wizard (sourcemaps redirecting to SvelteKit or React Native) keeps them.Feature.flagis required andFeature.promptis gone, so everyfeatureSelectionPromptentry takes its wording from its flag. The Android and React Native Logs/Replay questions use the same shared wording, and their docs links move into hints.design/sentry-cli.mdgets the naming rule, plus a gap for the questions that still have no flag.@stricli/corepatch fixesundoNegationfor kebab-case names. It cut one character too many afterno-, so a negated multi-word flag such as--no-example-pagewas rejected even though--helplisted it.Scope
The wizards have about 78 prompt sites. They fall into four groups:
pod install, formatters--helpwould get noisy--forcesentry initOnce #2652 lands, its no-input message can name the exact flag for the unanswered question, read from the same registry.
Part of #2642.
via @BYK.
--
View Session [Sentry]