Dashboard › cli › Distillation
3081ca3d-c690-4e9d-860c-2e8a5948ff6b["lore_tm_v1_MKjswmwcMffxxtfzqRxckz3oY-RdtjXSXt6pK2PCr44"]
extractPackageManagerCommand(rawContent) in packages/cli/script/generate-skill.ts matches rawContent against PACKAGE_MANAGER_REGEX and returns capture group 1 (the npm command) or null.generateInstallSection(installSection, rawContent) emits a ### Installation heading, extracts all bash code blocks from the installation section, and extracts an npm command from the raw MDX content.generateInstallSection() combines extracted installation commands into one fenced bash block. When both shell code blocks and an npm command exist, it inserts a blank line and the exact comment # Or install via npm/pnpm/bun before the npm command; if neither exists, it emits only the heading and blank line.generateAuthSection(authSection) emits a ### Authentication heading and combines all extracted bash blocks into one fenced bash block; when no bash blocks exist, it emits only the heading and blank line.loadPrerequisites() in packages/cli/script/generate-skill.ts reads ${DOCS_PATH}/getting-started.mdx; if the file is absent, it returns getDefaultPrerequisites().getting-started.mdx exists, loadPrerequisites() strips frontmatter and MDX components, emits ## Prerequisites followed by the exact sentence The CLI must be installed and authenticated before use., extracts the Install Script section for generateInstallSection(), and extracts the Authentication section for generateAuthSection().getDefaultPrerequisites() returns fallback installation commands curl https://cli.sentry.dev/install -fsS | bash and npm install -g sentry, labeled with the exact comments # Install script and # Or use npm/pnpm/bun.getDefaultPrerequisites() returns fallback authentication examples in this exact order: 1. sentry auth under # OAuth login (recommended), 2. sentry auth --token YOUR_SENTRY_API_TOKEN under # Or use an API token, 3. sentry auth status under # Check auth status.appendExample(map, key, code) retrieves the existing string[] for key or creates an empty array, appends code, and stores the array back into the Map<string, string[]>.collectCommandPaths(tokens, examples) scans only depth-3 heading tokens, parses each heading with extractCommandPathFromHeading(token.text), preserves discovered path order, and initializes every previously unseen command path in the examples map with an empty array.associateCodeBlocks(tokens, context) accepts commandPaths, commandGroup, examples, and optional defaultCommandPath; its fallback group path is sentry ${commandGroup}.associateCodeBlocks() walks tokens sequentially and tracks currentCmd from depth-3 headings using extractCommandPathFromHeading(). It considers only code tokens whose language is exactly bash and trims their text.associateCodeBlocks() appends the block directly to that command. Otherwise it calls matchExampleToCommand(code, commandPaths, groupFallback, defaultCommandPath) and appends the block only when that function returns a target.loadCommandExamples(commandGroup, defaultCommandName?) loads commands/${commandGroup}.md; when the documentation file is absent, it returns an empty Map<string, string[]>.loadCommandExamples() parses documentation with marked.lexer(docContent), collects command paths from generated ### `sentry ...` headings, and derives an optional default path as sentry ${commandGroup} ${defaultCommandName}.loadCommandExamples() passes parsed tokens, collected command paths, the command group, the examples map, and the optional default command path to associateCodeBlocks(). This supports both auto-generated command reference sections and hand-written ## Examples sections by using heading context first and command-content matching as fallback.loadCommandsOverview() is declared to load supplementary content from commands/index.md and return an object beginning with globalOptions: string and jsonOutput: string; the remainder of its return type and implementation were outside the displayed excerpt.