Dashboard › cli › Distillation
9ac583eb-28bc-41a8-ba37-b5ae6e28b2bc["lore_tm_v1_8XerD8qtnT5dtUKgihP3bvBVKjLAeMVqkRrpvr7mCXo","lore_tm_v1_pEn6w2Ari57UYzna7nX5EMYZgIrHmINZO1MWf31PBRM","lore_tm_v1_zDKisL8ZDUCaEaIVe0ZJs8KR8GG7IjDr8cTPn3ICkSM"]
packages/cli/src/lib/command.ts: hints live exclusively on the CommandReturn return value, never on individual yields.packages/cli/src/lib/command.ts defines CommandExample with readonly description: string and readonly command: string; the command must include the sentry executable.CommandDocumentation extends native Stricli docs with optional readonly examples?: readonly CommandExample[]; when customUsage exists, its first line is the canonical signature suffix and later lines may describe equivalent forms.SentryCommandFunction requires all command functions to be async generators returning AsyncGenerator<unknown, CommandReturn | void, undefined>: non-streaming commands yield one CommandOutput<T>, streaming yields render immediately, commands requiring parseable --json output yield one aggregate value rather than pretty-printed individual chunks, and void commands may return without yielding.LocalCommandBuilderArguments.output?: OutputConfig<any> automatically injects --json and --fields; commands yield new CommandOutput(data), the wrapper handles JSON/human rendering, and void yields are ignored.LocalCommandBuilderArguments defaults to true; absent credentials cause AuthError("not_authenticated") before command execution, while expired tokens with a valid refresh token pass because the API client silently refreshes them, and auto-auth middleware in cli.ts catches the error to trigger login.enrichDocsWithSchema() in packages/cli/src/lib/command.ts returns docs unchanged when no output schema exists or extractSchemaFields() returns no fields; otherwise it appends formatSchemaForHelp(schemaFields) to fullDescription, using docs.fullDescription ?? docs.brief as the base.prepareNativeDocs() removes extended examples before passing docs to Stricli. When examples exist, it renders each as ${command} # ${description} under an Examples: section appended to fullDescription; without examples, it returns the remaining native docs unchanged.attachDocumentationMetadata() stores the first docs.customUsage entry as metadata.__primaryUsage, using the string directly or .input for a structured entry, and stores nonempty docs.examples as metadata.__examples.packages/cli/script/generate-command-docs.ts, escapeAngleBrackets(text) replaces < with < and > with > so literal angle brackets are not interpreted as HTML.formatPositionalsTable() returns an empty string for no positionals; otherwise it emits an **Arguments:** Markdown table whose syntax is [<placeholder>] for optional arguments and <placeholder> for required arguments, wraps syntax in backticks, and escapes angle brackets in each positional description.formatFlagsTable() returns an empty string for no flags; otherwise it emits an **Options:** Markdown table and delegates each row to formatFlagRow(flag, aliases).generateCommandSection() creates a ### heading from cmd.path plus cmd.positional when present, then emits cmd.brief, an arguments table when positionals exist, an options table for getVisibleFlags(cmd), and formatted examples from formatCommandExamples(cmd.examples) when nonempty.isStandaloneCommand(route) returns true only when route.commands.length === 1 and the sole command path is exactly sentry ${route.name}.