Skip to content

Use sub commands instead of options #1200

@Lms24

Description

@Lms24

With increasing wizard flows, I'm leaning towards refactoring the wizard CLI flags. Right now, everything is an option, making it very hard to grasp which options can be used in which combinations.

# correct
npx @sentry/wizard@latest -i nextjs --saas --tracing --logs
npx @sentry/wizard@latest --skills --scope=user

# wrong
npx @sentry/wizard@latest -i nextjs --saas --tracing --logs --scope=user #scope does nothing
npx @sentry/wizard@latest --skills --scope=user --saas # saas does nothing

We could/should leverage sub commands, to clearly differentiate key flows from options.

npx @sentry/wizard@latest install nextjs --saas --tracing --logs
npx @sentry/wizard@latest install skills --scope=user

The cool part about this is that the --help commands will suddenly become much more helpful because they can be called at any sub command level.

I would even make the specific SDK a sub command because we have cases where some SDK setup wizards respect options that others don't (yet, or never).

This becomes especially important with an increasing number of non-SDK setup flows like #1187

The obvious counter argument here is that this is a breaking change and requires close coordination with docs and any other place where we currently publicly document wizard usage. Opening this issue now to gauge some thoughts.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions