Dashboard › cli › Distillation
fc5c6171-651e-4c25-8267-a7c28531a280["lore_tm_v1_BHxS1uUiDsDwM3iU7kBsrgHC_2sCgSyKB1LMEQM3sw0","lore_tm_v1_yLZTqY9uKSqDe-xQNDLWIEQxZv5ZXjh3EiONhiEEHRs","lore_tm_v1_-aumIMYbuEY5bis-9L8og8D9R1AlB7X414fmTTbqjGw","lore_tm_v1_yk4LVYdxMyr4IiKigjB7nSiygU7vL_y7NY0YnSgPJ5s","lore_tm_v1_s8U9jJ8JL9aU6zuqg5Q_5QvDLo1uI6KeTtvhyHukYww"]
packages/cli/src/lib/command.ts: hints live exclusively on the async generatorβs CommandReturn; never on individual yields.packages/cli/src/commands/agent-conversation/list.ts defines COMMAND_NAME = "agent-conversation list", PAGINATION_KEY = "agent-conversation-list", and DEFAULT_PERIOD = "7d".agent-conversation list implementation resolves the organization with resolveOrg({ org: target, cwd }); failure throws new ContextError("Organization", USAGE_HINT).agent-conversation list implementation builds pagination context with buildPaginationContextKey("agent-conversation", org, { q: flags.query, period: serializeTimeRange(flags.period) }), then resolves the cursor via resolveCursor(flags.cursor, PAGINATION_KEY, contextKey).agent-conversation list implementation calls listConversations(org, { query: flags.query, limit: flags.limit, cursor, ...timeRangeToApiParams(flags.period) }) inside withProgress() with message Fetching conversations (up to ${flags.limit})... and JSON awareness from flags.json.agent-conversation list implementation updates pagination through advancePaginationState(PAGINATION_KEY, contextKey, direction, nextCursor), derives hasPrev with hasPreviousPage(PAGINATION_KEY, contextKey), and defines hasMore as !!nextCursor.agent-conversation list implementation yields one CommandOutput<ConversationListResult> containing exact fields conversations, hasMore, hasPrev, nextCursor, and org.agent-conversation list human formatter returns No conversations on this page. when the current page is empty but hasMore is true, No agent conversations found. when empty with no more results, and otherwise Agent conversations in ${org}:\n\n${formatConversationTable(conversations)}.agent-conversation list JSON transform emits an envelope with data, hasMore, and Boolean hasPrev; includes nextCursor only when present; and applies filterFields(c, fields) to each conversation when a non-empty fields list is supplied.agent-conversation list pagination footer preserves an active query as -q "${flags.query}", adds a period hint through appendPeriodHint(parts, flags.period, DEFAULT_PERIOD), and returns paginationHint() with commands sentry agent-conversation list ${org} -c next${flagSuffix} and sentry agent-conversation list ${org} -c prev${flagSuffix}.agent-conversation list flags define limit through validateLimit(value, LIST_MIN_LIMIT, LIST_MAX_LIMIT) with default String(LIST_DEFAULT_LIMIT), optional query, and period: LIST_PERIOD_FLAG; aliases include ...PERIOD_ALIASES, n: "limit", and q: "query".CommandOutput<T> and may return { hint }; streaming yields render immediately; commands supporting --json must yield one aggregate value when callers require one parseable JSON document because individual chunks are pretty-printed rather than JSONL; void commands may return without yielding for early exits such as --web.buildCommand from packages/cli/src/lib/command.ts, not directly from @stricli/core; direct Stricli usage bypasses telemetry and global-flag handling.buildCommand: auth defaults to true; missing both token and refresh-token credentials causes AuthError("not_authenticated"); an expired token with a valid refresh token passes because the API client performs silent refresh; auth: false is for commands such as auth login, auth logout, auth status, help, and cli upgrade; auth: "dsn" is for commands such as event send and bypasses both the bearer-token guard and .sentryclirc URL trust check.skipRcUrlCheck: true is used for commands establishing or removing host trust, specifically auth login and auth logout, so they can run despite a repo-local .sentryclirc URL mismatch.--fields is always injected when output: { human: ... } is configured, even when a command already defines its own json flag.ALWAYS_STRIP are always stripped, so the command never sees them; the set currently contains LOG_LEVEL_KEY.mergeGlobalFlags() and added to stripKeys, whereas command-owned flags are not treated as injected. GLOBAL_FLAG_DEFAULTS contains [LOG_LEVEL_KEY]: LOG_LEVEL_FLAG, verbose: VERBOSE_FLAG, org: ORG_FLAG, and project: PROJECT_FLAG.verbose is used for logging side effects but is not stripped, so the original command function receives it; similarly, a command-owned json flag prevents injection of JSON_FLAG.mergeGlobalFlags() behavior injects json: JSON_FLAG when output configuration exists and the command does not own json; it unconditionally assigns fields = buildFieldsFlag(outputConfig) whenever output configuration exists.buildFieldsFlag() returns the base FIELDS_FLAG when no schema or no extractable schema fields exist; otherwise it appends . Available: ${fieldNames} to the flag brief, with names joined by , .enrichDocsWithSchema() appends formatSchemaForHelp(schemaFields) to docs.fullDescription ?? docs.brief, separated by two newlines, when an output schema exposes fields.buildCommand() derives global short aliases from GLOBAL_FLAGS; an alias is added only when the command does not define the corresponding flag and the short alias is not already present.ClearScreen until the next render, ignores it in plain or JSON output, and emits the clear prefix \x1b[H\x1b[J on the next rendered CommandOutput.CommandOutput; valid outputs are rendered by renderCommandOutput() with json, parsed fields, and any pending clear prefix.cleanRawFlags() removes every key in stripKeys and, when output configuration exists, converts a string fields value to string[] through parseFieldsList().renderer.finalize(hint) and writes its non-empty result, falling back to writeFooter(stdout, hint).CliError other than OutputError and a positional argument equals help, --h, or -help; if commandPrefix resolves through introspectCommand(), it writes the warning Tip: use --help for help (e.g., sentry ${pathSegments.join(" ")} --help)\n\n to stderr and formatted command help to stdout.help is unaffected when the command succeeds; OutputError is excluded because it may carry data that must be rendered.--org/--project flags to environment variables before authentication or target resolution, cleans raw flags, and records telemetry through setFlagContext(cleanFlags) and setArgsContext(args).this.env.SENTRY_OUTPUT_FORMAT === "json", unless JSON mode was already selected.json, yes, or "dry-run"; it intentionally uses parsed flags to avoid confusing command-specific aliases such as list -n for limit with init -n for dry-run.resolveRenderer(outputConfig.human), allowing renderer factories to create fresh state for streaming commands.OutputError handling renders non-null/non-undefined err.data through the normal output system as new CommandOutput(err.data), then rethrows the error so its exit code propagates..next() rather than for await...of, because manual iteration preserves the final CommandReturn value carrying the hint.try so positional-help recovery can intercept AuthError; it then performs .sentryclirc trust validation through assertRcUrlTrusted(this.cwd), executes the generator under withTracing("exec", "cli.command.exec", ...), and finalizes output under withTracing("render", "cli.command.render", ...).appendCacheHint(returned.hint) only when the generator returned a value; bare return; paths such as --web produce no footer.buildCommand() attaches an output schema as __jsonSchema for introspection and exposes the original generator as __rawFunc for internal dispatchers that must bypass telemetry, auth guard, rc-trust checks, and the output pipeline.sentry ${routeName} ${subcommand}.placeholder, brief, and optional; variadic array positionals are represented as ${placeholder}... and marked optional.extractFlags() preserves each flagβs name, brief, kind, default, optional, variadic, and hidden; absent optional defaults to true only for Boolean flags, while absent variadic and hidden default to false.input and fuzzy-matched suggestions, capped by MAX_SUGGESTIONS = 3.