Dashboard › cli › Distillation
019ee3b9-df5f-4edf-be45-8245e57d8e6a["lore_tm_v1_mOgRZeSru0xrNQH707V_9nBezj9_Sl_TWTV33yCZK-U","lore_tm_v1_PxklewwgYU7ATF-LWs-UZzgVNcGYc7DLil6hekLZcWQ","lore_tm_v1_myZMmP87Qlnf0OGIZrzWjuxxFh-LhT8jBiTMqyScVu0"]
Date: Sep 9, 2026
packages/cli/src/lib/list-command.ts, buildListCommand() now accepts the shared CommandDocumentation type imported from ./command.js; OrgListCommandDocs is now an alias of CommandDocumentation, allowing canonical command examples and other shared documentation metadata.packages/cli/src/lib/mutate-command.ts, buildDeleteCommand() now accepts docs: CommandDocumentation, imported from ./command.js, instead of a local { brief; fullDescription? } type.buildDeleteCommand() must always inject --yes unless the command already defines it. It injects -y unless already defined; injects --force/-f unless DeleteCommandOptions.noForceFlag opts out or the definitions already exist; and injects --dry-run unless DeleteCommandOptions.noDryRunFlag opts out or the flag already exists./home/byk/Code/getsentry/cli-pr-1558/packages/cli/script/generate-command-docs.ts generates documentation by introspecting the CLI route tree and ENV_VAR_REGISTRY, combining generated reference/examples with hand-written fragments. Outputs are docs/src/content/docs/commands/{route}.md, docs/src/content/docs/commands/index.md, and docs/src/content/docs/configuration.md; generated output is gitignored, while docs/src/fragments/ is the committed source of truth for custom content.packages/cli/script/generate-command-docs.ts ensures src/generated/skill-content.ts exists before dynamically importing ../src/app.js: if absent, it creates src/generated/ and writes the exact stub export const SKILL_FILES: [string, string][] = [];\n. This avoids failure from the transitive agent-skills.ts β skill-content.ts import on fresh checkouts or CI; generate:skill later overwrites the stub.packages/cli/script/generate-command-docs.ts imports formatCommandExamples() from ./generate-skill-markdown.js, paths from ./paths.js, then dynamically loads routes, extractAllRoutes, and ENV_VAR_REGISTRY. Its output constants are DOCS_DIR = ${DOCS_CONTENT}/commands, FRAGMENTS_DIR = ${DOCS_FRAGMENTS}/commands, INDEX_PATH = ${DOCS_DIR}/index.md, and CONFIG_PATH = ${DOCS_CONTENT}/configuration.md.<!-- GENERATED:END -->. Per-command tables exclude hidden flags and global flags in GLOBAL_FLAG_NAMES: json, fields, help, helpAll, and log-level. SKIP_ROUTES contains help.generate-command-docs.ts, formatFlagRow() finds the first alias targeting a flag, renders syntax as -x, --name, appends <name> for non-variadic parsed/enum flags or <name>... for variadic flags, and appends (default: ${JSON.stringify(flag.default)}) only for defined non-boolean defaults when the brief does not already contain default:.generate-command-docs.ts, escapeAngleBrackets() converts </> to </>. formatPositionalsTable() returns "" for no positionals and otherwise creates an **Arguments:** table with required syntax <placeholder> or optional syntax [<placeholder>], escaping angle brackets in each brief.generate-command-docs.ts, formatFlagsTable() returns "" for no flags and otherwise creates an **Options:** table using formatFlagRow(). generateCommandSection() renders a ### heading from cmd.path plus cmd.positional, the command brief, optional argument and visible-option tables, and examples formatted by formatCommandExamples(cmd.examples).isStandaloneCommand(route) identifies a standalone route only when it has exactly 1 command whose path is sentry ${route.name}. generatePage() uses ## Usage for standalone commands and ## Commands for groups, emits YAML frontmatter, adds every command section, and ends with: All commands support \--json` for machine-readable output and `--fields` to select specific JSON fields.followed by<!-- GENERATED:END -->`.generate-command-docs.ts title capitalization special-cases api and cli through ACRONYMS, rendering them as API and CLI; other route names have only their first character uppercased.generateCommandsTable() preserves the route order returned by extractAllRoutes()βwhich reflects insertion order in app.tsβs buildRouteMapβand renders each entry as | [\${route.name}`](./${route.name}/) | ${route.brief} |`.generateEnvVarSection() renders each EnvVarEntry as a ### \VAR_NAME`section with its description and, whenexample !== undefined, a Bash block containing export ${entry.name}=${entry.example}`.generateConfigurationPage() emits Configuration frontmatter, explains that the CLI can use config files, environment variables, and a local database, notes project auto-detection and credential storage after sentry auth login, renders every ENV_VAR_REGISTRY entry under ## Environment Variables, and terminates generated content with <!-- GENERATED:END -->.generate-command-docs.ts, readCustomContent(fragmentName) reads docs/src/fragments/commands/${fragmentName}.md, while readTopLevelFragment(fragmentName) reads docs/src/fragments/${fragmentName}.md; both return "" on any read failure.routes to RouteMap, filters out routes in SKIP_ROUTES, creates the command output directory recursively, removes the legacy ${DOCS_DIR}/cli directory with { recursive: true, force: true }, writes one ${route.name}.md page per visible route, appends matching custom fragments, builds commands/index.md, and builds configuration.md with the top-level configuration fragment.commands/index.md uses title Commands, description Available commands in the Sentry CLI, intro The Sentry CLI provides commands for interacting with various Sentry resources., an ## Available Commands table, and <!-- GENERATED:END -->; the generator logs Generated ${generatedFiles.length} command doc pages + ${INDEX_PATH} + ${CONFIG_PATH}./home/byk/Code/getsentry/cli-pr-1558/packages/cli/script/generate-skill-markdown.ts defines the exact heading matcher COMMAND_HEADING_RE = /^sentry\s+([^<[\s]+(?:\s+[^<[\s]+))(?:\s(?:<|[)[^]*)?$/`, which extracts a literal command path while stopping before positional usage.extractCommandPathFromHeading(heading) in packages/cli/script/generate-skill-markdown.ts returns sentry ${match[1]} when COMMAND_HEADING_RE matches, otherwise undefined.matchExampleToCommand(code, commandPaths, groupFallback, defaultCommandPath?) sorts command paths by descending length so a specific path such as sentry auth login wins over sentry auth, returns the first path included in the code, returns undefined when the group fallback is absent, and assigns a bare-group example to defaultCommandPath ?? groupFallback.formatCommandExamples(examples) in packages/cli/script/generate-skill-markdown.ts returns "" for no examples; otherwise it emits an **Examples:** section with one bash fence and joins canonical examples using exactly 1 blank line between entries (examples.join("\n\n")).