Dashboard › cli › Distillation
0b5e43e0-8184-4f53-9e86-d0254d167fcd["lore_tm_v1_xIyNYzYK6gzca_Y5TiQd7uQwREnQx6LxEYXqeV0amS4","lore_tm_v1_HrVduAOhDxMCOd4kzJwUijLHkUwAVPJ5SKUQXl7YaNE","lore_tm_v1_LGQjdtw176N-e9IkzSmJJc5idgXqJIh_0zX3R-b4mys","lore_tm_v1_6vLJTIJxEPeKsAZAd2hbp6qm95ZXtzvaxp8FDSQaeOY","lore_tm_v1_LupA2SQNanyHOlhSEhdoHt_TjxMkjRy0k6WJzlRw_5Q","lore_tm_v1_HW2TcoVeEkOWgjujsdmm_1AgohKH3lB8a2pRGNlMNSs","lore_tm_v1_55u4zgwTPniVFKlWiVUtF_wYIpWSNqcNK8do8vXcNCI","lore_tm_v1_9GyNwP6tmYdt9AGcsMZ8GWlAW6HFQAHk2RAbdDkozHk","lore_tm_v1_ST0ac7iuXKs1sr6aELIQuJesV0CJ_YKFKISn8jvmdgI","lore_tm_v1_MQNJtXdQE2SI4_V5A-v9yk4b28k61KiIbNNOPMkIio4"]
Date: Sep 8, 2026
packages/cli/src/lib/help.ts, introspectAllCommands() returns { routes: extractAllRoutes(routeMap), envVars: buildTopLevelEnvVars(), flags: buildCommonFlags() }; buildCommonFlags() exposes each common flagβs long, short, and description.packages/cli/src/lib/help.ts, introspectCommand(commandPath) resolves against the route map and returns command/group info or { error: \Command not found: ${commandPath.join(" ")}`, suggestions? }`; suggestions are omitted when the resolved suggestion list is empty.renderJsonHelp(prefix, unprocessedInputs) in packages/cli/src/lib/help.ts parses --json, --fields, and unresolved path tokens with parseHelpJsonFlags(); without --json it returns undefined so Stricli uses built-in text help.renderJsonHelp() forms the command path from prefix.slice(1) plus extraPath, uses introspectAllCommands() for an empty path or introspectCommand(commandPath) otherwise, optionally applies filterFields(data, fields), and returns ${formatJson(final)}\n.renderJsonHelp()βs command path ensures invocations such as sentry issue nope --help --json return a structured { error } object rather than silently showing the parent group.isVersionRequest(argv) in packages/cli/src/lib/help.ts returns true for a bare --version before any -- escape and false once -- is encountered; -v is deliberately excluded because GLOBAL_FLAGS maps it to --verbose, not version.isRecoverableUnknownCommand(argv) treats three unknown-command shapes as recoverable: 1. isVersionRequest(argv), 2. rewriteHelpJsonToHelpCommand(argv) !== undefined, 3. an argv of at least 2 tokens ending in help; this prevents recoverable help/version requests from emitting spurious unknown_command telemetry.rewriteHelpJsonToHelpCommand(argv) supports post-run recovery when the scanner rejects an unknown group token before the help renderer runs: a valid --help/-h plus --json request before -- is rewritten to ["help", "--json", ...path], with --fields retained, so the help command emits structured unknown-command JSON.packages/cli/src/lib/help.ts uses Oxford-comma grammar: 1 item β "issue", 2 β "issue or trace", 3 β "issue, trace, or auth".formatFlagHuman() renders aliases and syntax such as -l, --limit <value>; parsed/enum non-variadic flags receive <value>, variadic flags receive <value>..., briefs are appended with an em dash, and non-boolean defaults are rendered as (default: ${JSON.stringify(flag.default)}).formatCommandHuman() renders a command signature, brief, visible flags, andβwhen availableβa JSON fields (use --json --fields to select): section whose entries include field name, type, optionality, and description.formatGroupHuman() renders sentry ${group.name}, its brief, and aligned subcommand descriptions; empty groups show (no commands), and nested paths such as sentry dashboard widget add retain widget add as the displayed subcommand.formatHelpHuman(data) dispatches by data shape: full route tree β printCustomHelp().trimEnd(), route group β formatGroupHuman(), single command β formatCommandHuman(), error β Error: ... with optional Did you mean: ...?, unknown shape β "".--json never calls the human formatter formatHelpHuman; therefore JSON help never triggers printCustomHelp()βs sixel probe or terminal I/O.packages/cli/src/app.ts configures buildApplication(routes, ...) with app name sentry, CLI_VERSION, scanner case style "allow-kebab-for-camel", allowArgumentEscapeSequence: true, and topLevelFlags: buildTopLevelFlags() so global flags can be forwarded at any route depth.packages/cli/src/app.ts wires Stricliβs patched documentation.renderHelp hook as ({ prefix, unprocessedInputs }) => renderJsonHelp(prefix, unprocessedInputs); structured --help --json now uses the same introspection path as sentry help --json, while non-JSON help remains Stricliβs built-in text output. This replaces the old argv rewrite for normal routed help.packages/cli/script/generate-command-docs.ts generates docs/src/content/docs/commands/{route}.md, docs/src/content/docs/commands/index.md, and docs/src/content/docs/configuration.md from route/environment metadata, combining generated reference content with committed fragments under docs/src/fragments/.packages/cli/script/generate-command-docs.ts ensures src/generated/skill-content.ts exists before dynamically importing the route tree, creating src/generated/ and writing the stub export const SKILL_FILES: [string, string][] = [];\n when absent.generate-command-docs.ts, GENERATED_END_MARKER = "<!-- GENERATED:END -->" separates regenerated content from preserved hand-written content; global per-command exclusions are json, fields, help, helpAll, and log-level, and SKIP_ROUTES = new Set(["help"]).generate-command-docs.ts formats required positionals as `<placeholder>` and optional positionals as `[<placeholder>]`, escapes </> in descriptions, and formats flag aliases, parsed/enum values, variadic values, and non-boolean defaults in Markdown tables.## Usage for standalone commands or ## Commands for groups, per-command signatures/briefs/arguments/options/examples, the footer βAll commands support --json for machine-readable output and --fields to select specific JSON fields.β, and <!-- GENERATED:END -->.generate-command-docs.ts only when it has exactly 1 command whose path is sentry ${route.name}; title capitalization specially uppercases acronyms in new Set(["api", "cli"]).extractAllRoutes() and emits rows as | [\${route.name}`](./${route.name}/) | ${route.brief} |`.configuration.md includes frontmatter, an intro explaining config files/environment variables/local DB and sentry auth login, then one ### \VAR_NAME`section perENV_VAR_REGISTRYentry with description and optionalexport VAR=valuebash example, followed by<!-- GENERATED:END -->and thedocs/src/fragments/configuration.md` content.generate-command-docs.ts deletes the legacy docs/src/content/docs/commands/cli/ directory, writes one ${route.name}.md page per visible non-help route, writes the commands index and configuration page, and logs the exact generated page count plus INDEX_PATH and CONFIG_PATH.packages/cli/script/generate-skill-markdown.ts uses COMMAND_HEADING_RE to extract literal command paths while excluding positional usage; matchExampleToCommand() checks longest paths first so sentry auth login beats sentry auth, and bare-group examples map to defaultCommandPath when available.formatCommandExamples(examples) in packages/cli/script/generate-skill-markdown.ts returns "" for no examples; otherwise it emits an **Examples:** section containing one bash fence with examples separated by blank lines.packages/cli/script/generate-skill.ts produces 3 artifact groups: 1. plugins/sentry-cli/skills/sentry-cli/SKILL.md, 2. plugins/sentry-cli/skills/sentry-cli/references/*.md, 3. docs/public/.well-known/skills/index.json.generate-skill.ts bootstraps src/generated/skill-content.ts before dynamic route-tree import with the stub export const SKILL_FILES: ReadonlyMap<string, string> = new Map();\n.findDefaultCommandName(routeMap) maps a route mapβs default command back to its route entry; the hidden auth dispatcher named "default" is specially mapped to "login" so bare sentry auth examples document sentry auth login.generate-skill.ts uses SKILL_DESCRIPTION = "Guide for using the Sentry CLI to interact with Sentry from the command line. Use when the user asks about viewing issues, events, projects, organizations, making API calls, or authenticating with Sentry via CLI." and preferred route order ["help", "auth", "org", "project", "issue", "event", "api"]; unlisted routes follow with order rank 999.associateCodeBlocks() in generate-skill.ts walks marked AST tokens sequentially, tracks depth-3 command headings through extractCommandPathFromHeading(), associates bash blocks to that command when valid, and otherwise uses content matching through matchExampleToCommand().loadCommandExamples(commandGroup, defaultCommandName?) loads commands/${commandGroup}.md, lexes it with marked.lexer(), collects command paths, builds an optional sentry ${commandGroup} ${defaultCommandName} fallback, and supports both generated ### \sentry ...`` sections and hand-written example sections.loadCommandsOverview() extracts Global Options, JSON Output, and Opening in Browser from commands/index.md; loadAgentGuidance() loads agent-guidance.md.extractRoutes(routeMap) skips hidden entries, loads documentation examples per visible route, uses extractRouteGroupCommands() for groups, and uses buildCommandInfo(target, path, examples) for standalone commands.name: sentry-cli-${refName}, package version, route-derived description, requires.bins: ["sentry"], and requires.auth: true.--json, --fields, --help, --log-level, and --verbose flags.β; compact SKILL.md entries use - `${signature}` β ${cmd.brief} and intentionally omit full flags and examples.