Dashboard › cli › Distillation
d3010f9e-f0cb-4715-a87d-2904cada7ce6["lore_tm_v1_KPsjk1y3jedLijR3iiDuBqxf54aVsMnLgz347GmnlXM","lore_tm_v1_hGTjaoKD-AXWxaYah1VPpGcPn91mQQDwN3AlGtx87VY","lore_tm_v1_WF6YrYwg4Ku9BbbdW_e_aflmIZ8I4hApg4WDmk2Z63g","lore_tm_v1_qleTbsm3gHWFghPy7gHmLl9ESMSkICLljpkC9yw2r68","lore_tm_v1_YFN3yoIQMx7hai8HZzNLLPXqsiM8RhYyF5-8eugUEAA","lore_tm_v1_IDst0k6vKLbxCzt97Zi6cWvdWmRCx3ek1jnbKdb8Z2A","lore_tm_v1_iMN0gyHKHD7yKDFFPaOI_-XGiNDsq8i_bBhXTPUXb2M","lore_tm_v1_4Q0ll3dn9QQDPovFX-QmrwN1hFsNHkUVxthTJ_o3k54","lore_tm_v1_XfqqeNxqQh8oFPElPgzaicNTbofo9tGEfM2sa1JLjO4"]
packages/cli/script/generate-skill.ts, formatFlag(flag, aliases) finds the short alias whose mapped value equals flag.name, formats boolean flags as --name, parsed/enum non-variadic flags as --name <value>, variadic flags as --name <value>..., prepends -alias, when present, appends flag.brief, and appends (default: ${JSON.stringify(flag.default)}) only for defined non-boolean defaults.packages/cli/script/generate-skill.ts, getVisibleFlags(cmd) excludes hidden flags and names in GLOBAL_FLAG_NAMES.generateFullCommandDoc(cmd) uses the positional-aware signature ${cmd.path} ${cmd.positional} when applicable, emits a depth-3 code-formatted heading and cmd.brief, lists visible flags through formatFlag(), emits examples through formatCommandExamples(cmd.examples), and documents cmd.jsonFields in a Field | Type | Description Markdown table.generateFullCommandDoc(cmd) labels JSON fields with the exact text **JSON Fields** (use \--json --fields` to select specific fields):and escapes|as|` in field types and descriptions.packages/cli/script/generate-skill.ts, TITLE_ACRONYMS contains exactly "api" and "cli"; capitalize(s) fully uppercases those known acronyms and otherwise uppercases only the first character.generateReferenceFile(refName, groupRoutes, version) uses groupRoutes[0], derives the title as ${capitalize(refName)} Commands and description from route.brief, and generates frontmatter with name: sentry-cli-${refName}, the CLI version, route description, bins: ["sentry"], and auth: true.route.commands entry, and the exact footer All commands also support \--json`, `--fields`, `--help`, `--log-level`, and `--verbose` flags.`generateCompactCommandLine(cmd) emits - \${signature}` β ${cmd.brief}, where the signature includes cmd.positional` when defined.generateCompactCommandsSection(routeInfos, referenceFiles) starts with ## Command Reference, sorts routes through sortRoutes(), skips the help route, and emits for each remaining route: a capitalized depth-3 heading, route brief, compact lines for every command, andβwhen mappedβthe pointer β Full flags and examples: \references/${refFile}``.generateSupplementarySections() loads commands/index.md content through loadCommandsOverview(), conditionally emits ## Global Options, always emits ## Output Formats, and uses extracted JSON Output and Opening in Browser sections when available.generateSupplementarySections() falls back to the exact JSON guidance Most commands support \--json` flag for JSON output, making it easy to integrate with other tools.and the exact browser guidanceView commands support `-w` or `--web` flag to open the resource in your browser.`groupRoutesByReference(routeInfos) implements a 1:1 visible-route-to-reference-file mapping, skips help, and maps each route name to a single-element RouteInfo[].generateAllSkillFiles(routeMap) obtains the package version, route information, prerequisites, supplementary sections, and agent guidance; generates each reference as references/${route.name}.md; then generates SKILL.md.SKILL.md frontmatter uses name: sentry-cli, the package version, description: ${SKILL_DESCRIPTION}, bins: ["sentry"], and auth: true; its title is # Sentry CLI Usage Guide and its introduction is Help users interact with Sentry from the command line using the \sentry` CLI.`SKILL.md includes the core agent rule to run the command directly because sentry auto-detects org/project from .sentryclirc, DSNs in .env or source, and the directory name; agents should not list organizations and projects manually, and should pass explicit <org>/<project> only if detection fails or selects the wrong target.generateAllSkillFiles() adds ## Agent Guidance and nests its existing Markdown headings one level deeper using /^(#{2,6})\s/gm.SKILL.md section order after its introduction/core rule is: 1. optional Agent Guidance, 2. Prerequisites, 3. compact Command Reference, 4. supplementary sections.generateIndexJson(generatedFiles) lexicographically sorts generated paths except that SKILL.md is always first, then emits pretty-printed JSON with one skill named sentry-cli, description: SKILL_DESCRIPTION, and the sorted files list, ending with a newline.packages/cli/script/generate-skill.ts calls generateAllSkillFiles(routes as unknown as RouteMap), recursively removes REFERENCES_DIR with force: true, writes every generated file under SKILL_DIR after recursively creating its parent directory, and writes the discovery manifest to INDEX_JSON_PATH.packages/cli/script/generate-skill.ts generates src/generated/skill-content.ts at SKILL_CONTENT_PATH, sorting file entries lexicographically and escaping backslashes, backticks, and ${ before embedding content in template literals.src/generated/skill-content.ts exports SKILL_FILES as ReadonlyMap<string, string> and warns that it is auto-generated by script/generate-skill.ts and must not be edited manually.references/ and reports Generated ${OUTPUT_PATH} + ${refCount} reference files + ${INDEX_JSON_PATH} + ${SKILL_CONTENT_PATH}.loadCommandsOverview() in packages/cli/script/generate-skill.ts loads commands/index.md; it returns null when absent, otherwise returns globalOptions, jsonOutput, and webFlag from the Global Options, JSON Output, and Opening in Browser sections respectively, substituting "" for missing sections.loadAgentGuidance() loads agent-guidance.md; its contract is to return body content with frontmatter and title stripped, or null.extractRoutes(routeMap) iterates routeMap.getAllEntries(), skips hidden entries, obtains each routeβs default command name via findDefaultCommandName() for route-map targets, and loads documentation examples via loadCommandExamples(routeName, defaultCommandName).extractRoutes() builds RouteInfo with target.brief and extractRouteGroupCommands(target, routeName, docExamples); for standalone commands, it uses path sentry ${routeName}, examples from that exact key or [], and buildCommandInfo(target, path, examples).sortRoutes(routeInfos) returns a copied array sorted by each routeβs index in ROUTE_ORDER; unknown routes receive order value 999.packages/cli/script/check-fragments.ts validates: 1. every route plus index.md has a command fragment, 2. every command fragment corresponds to a route or index.md, 3. fragments contain neither YAML frontmatter nor <!-- GENERATED:END -->, 4. required top-level fragments exist, and 5. multi-command fragments cover all subcommands.packages/cli/script/check-fragments.ts supports tsx script/check-fragments.ts for warnings and tsx script/check-fragments.ts --strict to treat missing-subcommand coverage as errors.check-fragments.ts ensures src/generated/skill-content.ts exists; if absent, it creates src/generated and writes the stub export const SKILL_FILES: [string, string][] = [];\n.check-fragments.ts uses ${DOCS_FRAGMENTS}/commands as FRAGMENTS_DIR, skips the help route, expects one .md fragment per extracted route plus index.md, and exits with code 1 when the fragment directory is missing.---\ntitle:, and rejects the marker <!-- GENERATED:END -->.REQUIRED_TOP_LEVEL_FRAGMENTS contains exactly "configuration", requiring ${DOCS_FRAGMENTS}/configuration.md.stripCodeBlocks(md) removes fenced code blocks using FENCED_CODE_BLOCK_RE so bash comments are not mistaken for Markdown headings.fragmentMentionsSubcommand(content, routeName, command, isDefaultCommand) accepts coverage when: 1. the full case-insensitive CLI path appears anywhere, 2. for a default command, a regex finds bare sentry <route> not followed as a subcommand, or 3. a depth-1 through depth-4 heading outside code blocks contains the leaf subcommand name.getMultiCommandRoutes() skips standalone routes only when they have at most 1 command and that command path equals sentry ${route.name}; other routes are included for subcommand coverage checks.findDefaultInRouteMap(target) identifies a default command by object-reference equality between target.getDefaultCommand() and each target.getAllEntries() subcommand target; getDefaultCommandName(routeName) uses this against the top-level route map.cmd.examples.length > 0 are skipped; uncovered subpaths are reported with the fragment path, comma-separated missing commands, and a hint using sentry ${routeName} ${missing[0]}.warnings normally and errors under --strict; any errors cause exit code 1, while success reports the exact actual fragment count, route count plus index, and required top-level fragment count.packages/cli/src/commands/agent-conversation/list.ts defines sentry agent-conversation list with usage [<org>], pagination key agent-conversation-list, default period 7d, optional org auto-detection, and list flags for limit, query, period, json, cursor, fresh, and optional fields.agent-conversation list documentation examples are ordered: 1. sentry agent-conversation list, 2. sentry agent-conversation list my-org, 3. sentry agent-conversation list --limit 50 --period 24h, 4. sentry agent-conversation list -q "has:errors", 5. sentry agent-conversation list my-org -c next.agent-conversation list uses buildListCommand("agent-conversation", ...), parses limits with validateLimit(value, LIST_MIN_LIMIT, LIST_MAX_LIMIT), defaults to String(LIST_DEFAULT_LIMIT), aliases n to limit and q to query, and uses LIST_PERIOD_FLAG with PERIOD_ALIASES.agent-conversation list is No conversations on this page. when the current page is empty but more results exist, No agent conversations found. when empty with no more results, or Agent conversations in ${org}:\n\n${formatConversationTable(conversations)}.agent-conversation list optionally filters every conversation through filterFields(c, fields) and returns an envelope containing data, hasMore, boolean hasPrev, and nextCursor only when present.agent-conversation list resolves the organization with resolveOrg({ org: target, cwd }), throws ContextError("Organization", USAGE_HINT) if unresolved, and builds pagination context using route "agent-conversation", the resolved org, query q, and serializeTimeRange(flags.period).agent-conversation list calls listConversations(org, { query, limit, cursor, ...timeRangeToApiParams(period) }) through withProgress() with message Fetching conversations (up to ${flags.limit})..., then advances pagination state and derives hasPrev and hasMore.agent-conversation list preserve the query as -q "${flags.query}" and a non-default period via appendPeriodHint(), producing next/previous commands in the forms sentry agent-conversation list ${org} -c next${flagSuffix} and sentry agent-conversation list ${org} -c prev${flagSuffix}./.packages/cli/src/commands/agent-conversation/view.ts defines usage [<org>/]<conversation-id> and usage hint sentry agent-conversation view [<org>/]<conversation-id>.parseConversationTarget(target) trims the target; with no slash it returns the whole value as conversationId, while with a slash it treats the prefix as org and the remainder as conversationId; an empty org or conversation ID causes ContextError("Conversation ID", USAGE_HINT, []).agent-conversation view documentation examples are ordered: 1. sentry agent-conversation view conv-123, 2. sentry agent-conversation view my-org/conv-123, 3. sentry agent-conversation view my-org/conv-123 --json.agent-conversation view defines fresh: FRESH_FLAG with FRESH_ALIASES, calls applyFreshFlag(flags), rejects a missing or whitespace-only target with ContextError("Conversation ID", USAGE_HINT, []), and resolves the optional parsed org through resolveOrg({ org: orgArg, cwd }).agent-conversation view fetches getConversationSpans(org, conversationId) through withProgress() with message Fetching conversation spans...; it builds output with buildTranscriptResult(conversationId, org, spans, title), sets result.truncated = truncated, and yields CommandOutput<TranscriptResult>.buildListCommand() always inject --fresh unless the command already defines it.packages/cli/src/lib/list-command.ts, ListCommandOptions supports noCursorFlag to suppress --cursor and -c for commands such as streaming log list, and noFreshAlias to suppress -f when a command such as log list uses it for --follow.buildListCommand() is a buildCommand() wrapper that: 1. intercepts subcommand names passed via plural aliases, 2. auto-injects --fresh and --cursor unless already defined, 3. auto-injects -f and -c subject to opt-outs, and 4. automatically calls applyFreshFlag(flags) before invoking the command function.cursor or fresh flags retain those definitions; auto-injection does not overwrite existing flags.buildListCommand() copies existing flags and aliases, injects FRESH_FLAG when "fresh" is absent, injects LIST_CURSOR_FLAG unless options.noCursorFlag or an existing cursor blocks it, injects alias f: "fresh" unless opted out or already defined, and injects alias c: "cursor" unless cursor is opted out or c already exists.buildListCommand() is always the target, following the org/project pattern.buildListCommand() wrapper only intercepts its first positional argument when at least one argument exists and the value is a string or undefined; it calls interceptSubcommand(args[0], ctx.stderr, routeName) and passes the modified arguments to originalFunc.call(this, flags, ...).packages/cli/test/lib/command.test.ts defines createTestContext() with shared stdout handling for both Stricliβs process.stdout and buildCommandβs top-level stdout, plus arrays output and errors for captured chunks.init -y β false, 2. init -n β false, 3. init --yes=false β true, 4. data -n 10 β true, 5. data -y 2 β true; it restores setInteractivePromptsAllowed(true) in finally.buildCommand tests verify it builds a command with a boolean verbose flag, handles empty parameters, retains customUsage[0] as __primaryUsage, retains structured docs.examples as __examples, and re-exports numberParser from Stricli as a function.<name>:<kind>...; the retained structured example is description Select an organization explicitly with command sentry thing list my-org./home/byk/Code/getsentry/cli-pr-1558/plugins/sentry-cli/skills/sentry-cli/references/agent-conversation.md was not found.