Dashboard › cli › Distillation
ca319b6a-a459-44d4-88b0-4525284b5306["lore_tm_v1_xnsOC0JQWKReW6_KjZqMYmNu4jrA54s3oxTz3-ePuXU","lore_tm_v1__3Bb7oHD6jKAcUoBS0-bcJsN-Ykalve9W9_bZy90nEE","lore_tm_v1_dZXL-h-3PldxtUnwsDnLcMR4GMBLz86v3T3SfnzAv3s","lore_tm_v1_0wWjv-AFE9he7NHziTUC1UGg-e1m-xYtTInxEs8ubVg","lore_tm_v1_Y3QF0_ReTN-8ai-NcHzanmd9PCAUH17qVGP7AFfGwVY"]
Date: Sep 8, 2026
packages/cli/script/generate-skill.ts extractRoutes(routeMap) skips hidden entries, derives each routeβs defaultCommandName with findDefaultCommandName() when the target is a RouteMap, loads examples through loadCommandExamples(routeName, defaultCommandName), expands route groups with extractRouteGroupCommands(), and wraps standalone commands with buildCommandInfo(target, \sentry ${routeName}`, examples)`.packages/cli/script/generate-skill.ts sortRoutes() gives names in ROUTE_ORDER their configured index and all unlisted routes order 999.formatFlag() emits aliases as -${alias}, --${flag.name}, appends <value> for non-variadic parsed/enum flags or <value>... for variadic flags, includes the brief, and adds (default: ${JSON.stringify(flag.default)}) for defined non-boolean defaults. getVisibleFlags() excludes hidden flags and names in GLOBAL_FLAG_NAMES.generateFullCommandDoc() in packages/cli/script/generate-skill.ts emits a depth-3 heading containing the command signature, its brief, visible flags as bullets, an optional JSON-fields table, and examples in one bash block separated by blank lines. JSON field types and descriptions escape | as \|; the table instructs readers to use --json --fields."api" and "cli" via TITLE_ACRONYMS; other route names have only their first character uppercased.generateReferenceFile(refName, groupRoutes, version) creates per-route frontmatter with name: sentry-cli-${refName}, CLI version, the route brief as description, bins: ["sentry"], and auth: true; it then emits # ${capitalize(refName)} Commands, every full command document, and a footer stating support for --json, --fields, --help, --log-level, and --verbose.SKILL.md command reference excludes the "help" route. Each remaining route gets a capitalized heading, route brief, ordered command lines in the form - `signature` β brief, and, when present, a pointer β Full flags and examples: \references/${refFile}``.generateSupplementarySections() loads the commands overview and conditionally includes its globalOptions, jsonOutput, and webFlag. Fallback output says most commands support --json for integrations and view commands support -w or --web to open resources in a browser.groupRoutesByReference() implements a 1:1 visible-route-to-reference-file mapping, skips "help", and stores each included route as a single-element array under its route name.generateAllSkillFiles() loads package version, extracted route metadata, prerequisites, supplementary sections, and agent guidance; generates each route as references/${refName}.md; and generates SKILL.md with frontmatter, title # Sentry CLI Usage Guide, agent guidance, prerequisites, compact command reference, and supplementary sections.SKILL.md includes the core agent rule to run the requested command directly and rely on CLI org/project auto-detection from .sentryclirc, DSNs in .env/source, and directory name; it tells agents not to list organizations and projects manually and to pass explicit <org>/<project> only when detection fails or selects the wrong target.generateAllSkillFiles() nests it under ## Agent Guidance by increasing Markdown heading depth one level for headings of levels 2β6.generateIndexJson() builds a discovery manifest with SKILL.md first and all remaining generated paths sorted via localeCompare(). The JSON contains one skill named "sentry-cli" with SKILL_DESCRIPTION and the complete file list, and ends with a newline.generate-skill.ts main flow removes REFERENCES_DIR recursively with force: true, writes every generated file under SKILL_DIR after recursively creating its parent directory, and writes the manifest to INDEX_JSON_PATH.packages/cli/script/generate-skill.ts generates src/generated/skill-content.ts by sorting generated file entries by path, escaping backslashes, backticks, and ${ in content, and embedding each as a template-literal entry in export const SKILL_FILES: ReadonlyMap<string, string> = new Map([...]). The module is marked auto-generated and is used to install skills from the binary without network fetching.generate-skill.ts reports Generated ${OUTPUT_PATH} + ${refCount} reference files + ${INDEX_JSON_PATH} + ${SKILL_CONTENT_PATH}, where refCount counts keys beginning with "references/".packages/cli/script/generate-command-docs.ts generates one page at docs/src/content/docs/commands/{route}.md per visible route, docs/src/content/docs/commands/index.md, and docs/src/content/docs/configuration.md; generated command pages combine introspected metadata with committed hand-written fragments from docs/src/fragments/.../src/app.js, generate-command-docs.ts ensures src/generated/skill-content.ts exists. Its fresh-checkout stub is exactly export const SKILL_FILES: [string, string][] = [];\n, created under src/generated/; a later generate:skill run overwrites it.generate-command-docs.ts defines GENERATED_END_MARKER = "<!-- GENERATED:END -->", uses it to separate regenerated content from appended hand-written fragments, and excludes route "help" through SKIP_ROUTES."json", "fields", "help", "helpAll", and "log-level"). formatFlagRow() uses the flag name as the placeholder, such as --limit <limit>, supports aliases and variadic ..., and appends a serialized non-boolean default only when the brief does not already contain "default:".generate-command-docs.ts escapes < and > in positional descriptions as < and >. Positionals render in an Argument | Description table, while visible flags render in an Option | Description table.generateCommandSection() emits the full command signature in a depth-3 heading, command brief, optional arguments table, and optional options table. A route is treated as standalone only when it has exactly 1 command whose path equals sentry ${route.name}.generatePage() uses frontmatter title equal to the route name and description ${CapName} command for the Sentry CLI for standalone routes or ${CapName} commands for the Sentry CLI for groups; it labels the main section ## Usage or ## Commands accordingly and ends generated content with a footer documenting --json and --fields, followed by <!-- GENERATED:END -->."api" and "cli" and fully uppercases them; other names receive first-character capitalization.generateCommandsTable() preserves the route insertion order returned by extractAllRoutes() rather than applying a manual order and emits rows in the form | [`route`](./route/) | brief |.generateConfigurationPage(ENV_VAR_REGISTRY) creates configuration.md with frontmatter, an intro explaining config files/environment variables/local database and sentry auth login, and one ### \VAR_NAME`section per registry entry. Entries with examples include abashblock containingexport ${entry.name}=${entry.example}`.${DOCS_FRAGMENTS}/commands/${fragmentName}.md; top-level fragments are read from ${DOCS_FRAGMENTS}/${fragmentName}.md. Missing fragment files resolve to an empty string.extractAllRoutes(routeMap).filter((r) => !SKIP_ROUTES.has(r.name)), recursively creates DOCS_DIR, removes the legacy ${DOCS_DIR}/cli directory, writes ${DOCS_DIR}/${route.name}.md for each route, rebuilds index.md, and appends the "configuration" fragment to generated configuration content.generate-command-docs.ts reports the exact generated route-page count as Generated ${generatedFiles.length} command doc pages + ${INDEX_PATH} + ${CONFIG_PATH}.packages/cli/script/paths.ts centralizes monorepo-relative documentation paths for scripts run from packages/cli/: DOCS_ROOT = "../../apps/cli-docs", DOCS_SRC = \${DOCS_ROOT}/src`, DOCS_CONTENT = `${DOCS_SRC}/content/docs`, DOCS_FRAGMENTS = `${DOCS_SRC}/fragments`, and DOCS_PUBLIC = `${DOCS_ROOT}/public``.