Dashboard › cli › Distillation
767d4fc1-190d-4cf3-81cf-95c4a20bbdf6["lore_tm_v1_bhJngQj-GZo9UxKb1NhgzWRv5m6aKRpROaAZDxuDgfI","lore_tm_v1_wOYnWctkeAd6Zt-inhCSiSU76yQaj1lCpn33Ut26v64","lore_tm_v1_nX1uLGGliVN_71a-rQsi5D2Qb51p_yAUfrxbZDu7IFE","lore_tm_v1_Bj0DP42ES_WjfrLTggzOOi--7Mlb9P_VT6NjnmzWIeM","lore_tm_v1_3ez7Zr_lvbwSBTTvhmYV98v20XndVSZ45mZmMnFFEfg"]
apps/cli-docs/src/fragments/commands/agent-conversation.md was emptied by removing 36 lines of hand-written examples for agent-conversation list and agent-conversation view; those examples are moving into canonical command metadata.packages/cli/script/check-fragments.ts now skips fragment subcommand-coverage checks for commands where cmd.examples.length > 0; only commands without metadata examples require fragment-based example coverage.packages/cli/script/generate-command-docs.ts now defines generated pages as combining: 1. auto-generated reference and examples from CLI metadata or the environment registry, and 2. hand-written guides and tips from docs/src/fragments/; fragments are the source of truth only for content that cannot live in command definitions.packages/cli/script/generate-command-docs.ts imports formatCommandExamples from ./generate-skill-markdown.js; generateCommandSection(cmd) calls formatCommandExamples(cmd.examples) and appends the nonempty result to each generated command section.packages/cli/script/generate-skill-markdown.ts adds exported formatCommandExamples(examples: readonly string[]): string; it returns "" for no examples, otherwise emits a Markdown section in the exact structure **Examples:**, blank line, fenced bash block, examples separated by blank lines, and closing fence.packages/cli/script/generate-skill.ts now reuses formatCommandExamples(cmd.examples) in generateFullCommandDoc(cmd) instead of assembling the **Examples:** fenced block inline.packages/cli/src/commands/agent-conversation/list.ts now centralizes canonical usage as const USAGE = "[<org>]" and const USAGE_HINT = \sentry ${COMMAND_NAME} ${USAGE}`; both docs.customUsageand unresolved-organizationContextError` use these constants.agent-conversation list metadata now has the concise full description “List recent agent conversations from a Sentry organization.\n\nThe organization is auto-detected when omitted.” and 5 ordered canonical examples: 1. “List recent agent conversations” → sentry agent-conversation list; 2. “Explicit organization” → sentry agent-conversation list my-org; 3. “Show more, last 24 hours” → sentry agent-conversation list --limit 50 --period 24h; 4. “Filter conversations” → sentry agent-conversation list -q "has:errors"; 5. “Paginate through results” → sentry agent-conversation list my-org -c next.packages/cli/src/commands/agent-conversation/view.ts now centralizes canonical usage as const USAGE = "[<org>/]<conversation-id>" and const USAGE_HINT = \sentry agent-conversation view ${USAGE}`; docs.customUsageusesUSAGE`.agent-conversation view metadata now keeps its organization auto-detection explanation and defines 3 ordered canonical examples: 1. “View full transcript (organization auto-detected)” → sentry agent-conversation view conv-123; 2. “Explicit organization” → sentry agent-conversation view my-org/conv-123; 3. “JSON output” → sentry agent-conversation view my-org/conv-123 --json.packages/cli/src/lib/command.ts adds exported type CommandExample with readonly fields description: string and command: string; CommandDocumentation extends native Stricli docs with optional readonly examples?: readonly CommandExample[].packages/cli/src/lib/command.ts adds prepareNativeDocs(docs): it strips extended examples before passing docs to Stricli and, when examples exist, appends native help text as Examples: followed by one line per example formatted as ${command} # ${description}.packages/cli/src/lib/command.ts adds attachDocumentationMetadata(command, docs): it retains the first customUsage line as __primaryUsage and structured examples as __examples on the built command because Stricli does not expose those extended fields.buildCommand() in packages/cli/src/lib/command.ts now computes const stricliDocs = prepareNativeDocs(enrichedDocs), passes docs: stricliDocs to stricliCommand(), and calls attachDocumentationMetadata(cmd, enrichedDocs) afterward, replacing the previous inline __primaryUsage attachment.packages/cli/src/lib/introspect.ts imports CommandExample, adds __examples?: readonly CommandExample[] to introspectable Command, and makes buildCommandInfo() prefer structured cmd.__examples over legacy document-derived examples; each structured example becomes # ${description}\n${command}.packages/cli/src/lib/list-command.ts imports CommandExample and expands list-command docs typing to accept readonly customUsage?: readonly string[] and readonly examples?: readonly CommandExample[].packages/cli/test/commands/agent-conversation/list.test.ts adds a test proving organization-resolution errors use the canonical optional-org command string sentry agent-conversation list [<org>].packages/cli/test/lib/command.test.ts adds a test proving buildCommand() retains structured metadata in __examples, using “Select an organization explicitly” and sentry thing list my-org.packages/cli/test/lib/introspect.test.ts adds a test proving structured examples override stale legacy document examples: sentry thing list stale-org is replaced by # Use automatic organization detection\nsentry thing list and # Select an organization explicitly\nsentry thing list my-org.packages/cli/test/script/generate-skill-markdown.test.ts replaces generated-file assertions with direct command-metadata assertions: list positional usage must be [<org>]; view positional usage must be [<org>/]<conversation-id>; list examples must include explicit organization; view examples must exactly preserve auto-detected, explicit my-org/conv-123, and --json forms; formatCommandExamples(view.examples) must render their exact Markdown fenced block.CommandReturn hints live exclusively on the generator return value, never on individual yields.--fields is always injected when output: { human: ... } is configured, even when the command defines its own json flag.packages/cli/src/lib/command.ts, all command functions are async generators: non-streaming commands yield one CommandOutput<T> and may return { hint }; streaming yields render immediately, but JSON-capable commands must yield one aggregate value when callers require one parseable JSON document because individual JSON chunks are pretty-printed rather than JSONL; void commands may return without yielding for early exits such as --web.packages/cli/src/lib/command.ts mandates using its buildCommand, not @stricli/core’s builder, because direct Stricli use bypasses telemetry and global flag handling.buildCommand() injects hidden --log-level and --verbose, strips injected flags before invoking the original function, captures flags and positional arguments as Sentry telemetry, injects --json and --fields when an OutputConfig exists, and enforces authentication by default with AuthError("not_authenticated"); auth: false opts out and auth: "dsn" bypasses token authentication and .sentryclirc URL trust checks.--verbose, its flag is not replaced or stripped and its value controls both command behavior and logger verbosity; if a command owns --json, its custom flag is preserved while --fields remains injected.handleYieldedValue() in packages/cli/src/lib/command.ts defers a ClearScreen token until the next render and ignores it in plain or JSON modes; only CommandOutput values with both an output config and renderer are rendered.packages/cli/src/lib/command.ts manually calls .next() instead of using for await...of, allowing capture of the final CommandReturn; each non-final yield is handled immediately and the final value supplies the footer hint.packages/cli/src/lib/command.ts runs only in human mode so JSON output is not corrupted; before rethrowing errors it can recover a positional help argument by rendering command help instead of a resolution/validation error.OutputError handling in packages/cli/src/lib/command.ts renders err.data through CommandOutput only when the data is neither null nor undefined, then rethrows the original error so entry points can set the exit code.appendCacheHint(returned.hint) but skips bare return; paths such as --web, where no rendered output means no footer.