Dashboard › cli › Session 01YYMF1sNl2E
01YYMF1sNl2EXT9BCPerform a read-only security and robustness review of the uncommitted changes in /home/byk/Code/getsentry/cli-pr-1558 for PR #1558. Do not edit files or mutate git state. Inspect the exact working-tree diff against HEAD and relevant source/tests. Focus independently on unsafe Markdown/help injection, command metadata trust boundaries, generated output corruption, prototype/property hazards, runtime output compatibility, and any misuse of user-controlled values. The feature moves agent-conversation examples into command definitions, attaches metadata to built Stricli commands, emits it through docs generators, and updates fragment validation/runtime usage hints. Report only verified findings with exact file:line evidence and concrete fixes. Classify each point PASS/CONCERN/MUST-FIX. If none, explicitly state PASS and residual risk. End exactly MERGE or DO-NOT-MERGE.
/home/byk/Code/getsentry/cli-pr-1558/AGENTS.md /home/byk/Code/getsentry/cli-pr-1558/.lore.md
<path>/home/byk/Code/getsentry/cli-pr-1558/AGENTS.md</path> <type>file</type> <content> 1: # Jared (Outpost agent) 2: 3: Autonomous GitHub coding agent. Work in `/workspace/repo`. 4: 5: ## Model tiers 6: 7: The primary model is chosen per event (see `src/agents/models.ts`): heavy for 8: code-producing situations, cheaper for lightweight ones. 9: 10: | Role | Subagent | Model | 11: | --- | --- | --- | 12: | Triage / plan / review (heavy) | (primary Jared) | Claude Opus 4.8 | 13: | Triage / plan / review (light) | (primary Jared) | xAI Grok 4.3 | 14: | Explore | `explore` | OpenAI gpt-5-mini | 15: | Implement | `implement` | Moonshot kimi-k2.7-code | 16: | Ship (commit/push/PR) | `ship` | xAI Grok (`grok-build-0.1`) | 17: 18: Pipeline: triage → explore → plan → implement → review → ship. 19: (`worker` is a deprecated alias of `implement`.) 20: 21: Operators also talk to Jared directly from the Outpost dashboard. ...
<path>/home/byk/Code/getsentry/cli-pr-1558/.lore.md</path>
<type>file</type>
<content>
1: <!-- Managed by lore (https://github.com/BYK/loreai) — manual edits are imported on next session. -->
2:
3: ## Long-term Knowledge
4:
5: ### Architecture
6:
7: <!-- lore:01a02357-f0a8-7fdb-9e9d-b0710cfe65c9 -->
8: * **API output binary and HTTP contracts**: Always preserve strict output-mode and binary-safety contracts. `sentry api` must preserve `rawApiRequest()` status text; empty textual non-2xx bodies must produce an HTTP status/request fallback, and JSON mode must expose `{status, statusText, body}` so empty success and error responses are distinguishable. Binary `Uint8Array` successes bypass formatters and remain raw; binary errors emit only status/content-type/byte-count summaries, never bytes or JSON coercion. Prompts must never block scripted runs or interleave with stdout JSON.
9:
10: <!-- lore:019ef480-47f1-7708-80cb-514ac37a3fde -->
11: * **@sentry/symbolic 13.4.0 API surface: ...
<path>/home/byk/Code/getsentry/cli-pr-1558</path> <type>directory</type> <entries> .craft.yml .git .github/ .gitignore .lore.md .nojekyll .npmrc AGENTS.md apps/ CHANGELOG.md codemods/ LICENSE.md node_modules/ package.json packages/ pnpm-lock.yaml pnpm-workspace.yaml README.md (18 entries) </entries>
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/AGENTS.md /home/byk/Code/getsentry/cli-pr-1558/AGENTS.md
/home/byk/Code/getsentry/cli-pr-1558/apps/cli-docs/src/content/docs/contributing.md /home/byk/Code/getsentry/cli-pr-1558/packages/cli/plugins/sentry-cli/skills/sentry-cli/SKILL.md /home/byk/Code/getsentry/cli-pr-1558/packages/cli/CONTRIBUTING.md
No files found
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/AGENTS.md</path> <type>file</type> <content> 1: # AGENTS.md 2: 3: Guidelines for AI agents working in this codebase. 4: 5: ## Project Overview 6: 7: **Sentry CLI** is a command-line interface for [Sentry](https://sentry.io), built with Node.js, [pnpm](https://pnpm.io), and [Stricli](https://bloomberg.github.io/stricli/). It lives in `packages/cli` of a pnpm workspace; the docs site lives in `apps/cli-docs`. 8: 9: ### Goals 10: 11: - **Zero-config experience** - Auto-detect project context from DSNs in source code and env files 12: - **AI-powered debugging** - Integrate Seer AI for root cause analysis and fix plans 13: - **Developer-friendly** - Follow `gh` CLI conventions for intuitive UX 14: - **Agent-friendly** - JSON output and predictable behavior for AI coding agents 15: - **Fast** - Native binaries via Node SEA (fossilize), SQLite caching for API responses 16: 17: ### Key Features 18: 19: - **DSN Auto-Detection** - ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/.cursor/rules/ultracite.mdc</path>
<type>file</type>
<content>
1: ---
2: description: Ultracite Rules - AI-Ready Formatter and Linter
3: globs: "**/*.{ts,tsx,js,jsx,json,jsonc,html,vue,svelte,astro,css,yaml,yml,graphql,gql,md,mdx,grit}"
4: alwaysApply: false
5: ---
6:
7: # Ultracite Code Standards
8:
9: This project uses **Ultracite**, a zero-config Biome preset that enforces strict code quality standards through automated formatting and linting.
10:
11: ## Quick Reference
12:
13: - **Format code**: `npx ultracite fix`
14: - **Check for issues**: `npx ultracite check`
15: - **Diagnose setup**: `npx ultracite doctor`
16:
17: Biome (the underlying engine) provides extremely fast Rust-based linting and formatting. Most issues are automatically fixable.
18:
19: ---
20:
21: ## Core Principles
22:
23: Write code that is **accessible, performant, type-safe, and maintainable**. Focus on clarity and explicit intent over brevity. ...
## fix/agent-conversation-reference-root-cause...origin/pr-1558 [gone] M apps/cli-docs/src/fragments/commands/agent-conversation.md M packages/cli/script/check-fragments.ts M packages/cli/script/generate-command-docs.ts M packages/cli/script/generate-skill-markdown.ts M packages/cli/script/generate-skill.ts M packages/cli/src/commands/agent-conversation/list.ts M packages/cli/src/commands/agent-conversation/view.ts M packages/cli/src/lib/command.ts M packages/cli/src/lib/introspect.ts M packages/cli/src/lib/list-command.ts M packages/cli/test/commands/agent-conversation/list.test.ts M packages/cli/test/lib/command.test.ts M packages/cli/test/lib/introspect.test.ts M packages/cli/test/script/generate-skill-markdown.test.ts bbaa7b3b722b87f1bccfe84063269cbbcabe2741 bbaa7b3b7 (HEAD -> fix/agent-conversation-reference-root-cause) fix(docs): correct agent conversation argument syntax
.../src/fragments/commands/agent-conversation.md | 36 ------------ packages/cli/script/check-fragments.ts | 3 + packages/cli/script/generate-command-docs.ts | 12 +++- packages/cli/script/generate-skill-markdown.ts | 11 ++++ packages/cli/script/generate-skill.ts | 11 ++-- .../cli/src/commands/agent-conversation/list.ts | 35 +++++++++--- .../cli/src/commands/agent-conversation/view.ts | 25 ++++++--- packages/cli/src/lib/command.ts | 64 ++++++++++++++++++---- packages/cli/src/lib/introspect.ts | 9 ++- packages/cli/src/lib/list-command.ts | 4 +- .../test/commands/agent-conversation/list.test.ts | 13 +++++ packages/cli/test/lib/command.test.ts | 28 ++++++++++ packages/cli/test/lib/introspect.test.ts | 23 ++++++++ .../test/script/generate-skill-markdown.test.ts | 55 ++++++++++++------- 14 files changed, 234 insertions(+), 95 ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/package.json</path>
<type>file</type>
<content>
1: {
2: "name": "sentry",
3: "version": "0.45.0-dev.0",
4: "description": "Sentry CLI - A command-line interface for using Sentry built by robots and humans for robots and humans",
5: "repository": {
6: "type": "git",
7: "url": "git+https://github.com/getsentry/cli.git"
8: },
9: "main": "./dist/index.cjs",
10: "type": "module",
11: "types": "./dist/index.d.cts",
12: "exports": {
13: ".": {
14: "import": {
15: "types": "./dist/index.d.mts",
16: "default": "./dist/index.mjs"
17: },
18: "require": {
19: "types": "./dist/index.d.cts",
20: "default": "./dist/index.cjs"
21: }
22: }
23: },
24: "bin": {
25: "sentry": "./dist/bin.cjs"
26: },
27: "files": [
28: "dist/bin.cjs",
29: "dist/index.cjs",
30: "dist/index.mjs",
31: "dist/index.d.cts",
32: "dist/index.d.mts",
33: ...
...output truncated...
Full output saved to: /home/byk/.local/share/opencode/tool-output/tool_082f86a0c001GRK38rr67CZoBZ
* and the global flags footer.
*/
function generatePage(route: RouteInfo): string {
const standalone = isStandaloneCommand(route);
const description = standalone
? `${capitalize(route.name)} command for the Sentry CLI`
: `${capitalize(route.name)} commands for the Sentry CLI`;
const lines: string[] = [];
// YAML frontmatter
lines.push("---");
lines.push(`title: ${route.name}`);
lines.push(`description: ${description}`);
lines.push("---");
diff --git a/packages/cli/script/generate-skill-markdown.ts b/packages/cli/script/generate-skill-markdown.ts
index eb19074f4..847f6a7bd 100644
--- a/packages/cli/script/generate-skill-markdown.ts
+++ b/packages/cli/script/generate-skill-markdown.ts
@@ -8,30 +8,41 @@ const COMMAND_HEADING_RE =
/** Extract the literal command path from a generated command heading. ...
diff --git a/apps/cli-docs/src/fragments/commands/agent-conversation.md b/apps/cli-docs/src/fragments/commands/agent-conversation.md index 3fa952c15..e69de29bb 100644 --- a/apps/cli-docs/src/fragments/commands/agent-conversation.md +++ b/apps/cli-docs/src/fragments/commands/agent-conversation.md @@ -1,36 +0,0 @@ - - - -## Examples - -### List conversations - -```bash -# List recent agent conversations -sentry agent-conversation list - -# Explicit organization -sentry agent-conversation list my-org - -# Show more, last 24 hours -sentry agent-conversation list --limit 50 --period 24h - -# Filter conversations -sentry agent-conversation list -q "has:errors" - -# Paginate through results -sentry agent-conversation list my-org -c next -``` - -### View a conversation transcript - -```bash -# View full transcript (organization auto-detected) -sentry agent-conversation view conv-123 - -# Explicit organization -sentry agent-conversation view my-org/conv-123 - -# JSON output -sentry ...
diff --git a/packages/cli/script/generate-skill-markdown.ts b/packages/cli/script/generate-skill-markdown.ts
index eb19074f4..847f6a7bd 100644
--- a/packages/cli/script/generate-skill-markdown.ts
+++ b/packages/cli/script/generate-skill-markdown.ts
@@ -1,37 +1,48 @@
/**
* Markdown parsing helpers shared by the skill generator and its tests.
*/
/** Matches a generated command heading and stops before positional usage. */
const COMMAND_HEADING_RE =
/^`sentry\s+([^<[`\s]+(?:\s+[^<[`\s]+)*)(?:\s*(?:<|\[)[^`]*)?`$/;
/** Extract the literal command path from a generated command heading. */
export function extractCommandPathFromHeading(
heading: string
): string | undefined {
const match = COMMAND_HEADING_RE.exec(heading);
return match?.[1] ? `sentry ${match[1]}` : undefined;
}
/** Find the command whose literal path appears in a loose example block. ...
diff --git a/packages/cli/src/commands/agent-conversation/list.ts b/packages/cli/src/commands/agent-conversation/list.ts
index 555b1f677..df893bfbd 100644
--- a/packages/cli/src/commands/agent-conversation/list.ts
+++ b/packages/cli/src/commands/agent-conversation/list.ts
@@ -1,212 +1,231 @@
/**
* sentry agent-conversation list
*
* List recent agent conversations from Sentry projects.
*/
import type { SentryContext } from "../../context.js";
import { listConversations } from "../../lib/api-client.js";
import { validateLimit } from "../../lib/arg-parsing.js";
import {
advancePaginationState,
buildPaginationContextKey,
hasPreviousPage,
resolveCursor,
} from "../../lib/db/pagination.js";
import { ContextError } from "../../lib/errors.js";
import { formatConversationTable } from "../../lib/formatters/conversation.js";
import { filterFields } from "../../lib/formatters/json.js";
import { CommandOutput } from "../../lib/formatters/output.js";
import {
...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/command.ts</path> <type>file</type> <content> 1: /** 2: * Command builder with telemetry, global flag injection, and output modes. 3: * 4: * Provides `buildCommand` — the standard command builder for all Sentry CLI 5: * commands. It wraps Stricli's `buildCommand` with: 6: * 7: * 1. **Automatic flag/arg telemetry** — captures flag values and positional 8: * arguments as Sentry span context for observability. 9: * 10: * 2. **Hidden global logging flags** — injects `--log-level` and `--verbose` 11: * into every command's parameters. These are intercepted before the original 12: * `func` runs: the logger level is set, and the injected flags are stripped 13: * so the original function never sees them. If a command already defines its 14: * own `--verbose` flag (e.g. `api` uses it for HTTP output), the injected 15: * one is skipped and the command's own value is used for both purposes. ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/command.ts</path>
<type>file</type>
<content>
380: * side-effects, and it is **not** stripped — the original func receives it as usual.
381: *
382: * Similarly, when a command already defines its own `json` flag (e.g. for
383: * custom brief text), the injected `JSON_FLAG` is skipped. `--fields` is
384: * always injected when `output: { human: ... }` regardless.
385: *
386: * Flag keys use kebab-case because Stricli uses the literal object key as
387: * the CLI flag name (e.g. `"log-level"` → `--log-level`).
388: *
389: * @param builderArgs - Same shape as Stricli's buildCommand arguments,
390: * plus an optional `output` mode
391: * @returns A fully-wrapped Stricli Command
392: */
393:
394: /**
395: * Build the `--fields` flag definition, enriched with available field names
396: * when a schema is registered on the output config. ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/command.ts</path>
<type>file</type>
<content>
537: export function buildCommand<
538: const FLAGS extends BaseFlags = NonNullable<unknown>,
539: const ARGS extends BaseArgs = [],
540: const CONTEXT extends CommandContext = CommandContext,
541: >(
542: builderArgs: LocalCommandBuilderArguments<FLAGS, ARGS, CONTEXT>
543: ): Command<CONTEXT> {
544: const originalFunc = builderArgs.func;
545: const outputConfig = builderArgs.output;
546: const requiresAuth = builderArgs.auth !== false && builderArgs.auth !== "dsn";
547: const skipRcUrlCheck =
548: builderArgs.skipRcUrlCheck === true || builderArgs.auth === "dsn";
549:
550: // Merge global flags into the command's flag definitions.
551: const existingParams = (builderArgs.parameters ?? {}) as Record<
552: string,
553: unknown
554: >;
555: const existingFlags = (existingParams.flags ?? ...
Found 9 matches /home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/introspect.ts: Line 111: examples: string[]; Line 286: examples: string[] = [] Line 301: examples: cmd.__examples?.length /home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/formatters/local.ts: Line 270: * Output examples: /home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/errors.ts: Line 520: examples: string[], Line 542: examples: string[], /home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/commands/agent-conversation/view.ts: Line 68: examples: [ /home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/commands/agent-conversation/list.ts: Line 107: examples: [ /home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/commands/dashboard/widget/index.ts: Line 47: "Row-filling examples:\n" +
Found 11 matches
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/script/generate-skill.ts:
Line 504: commands: [buildCommandInfo(target, path, examples)],
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/introspect.ts:
Line 283: export function buildCommandInfo(
Line 333: commands.push(buildCommandInfo(subTarget, path, examples));
Line 375: commands: [buildCommandInfo(target, path)],
Line 450: info: buildCommandInfo(target, `sentry ${entry.name.original}`),
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/test/script/generate-skill-markdown.test.ts:
Line 33: const list = buildCommandInfo(
Line 37: const view = buildCommandInfo(
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/test/lib/introspect.test.ts:
Line 218: const info = buildCommandInfo(cmd, "sentry thing list", [
Line 233: const info = buildCommandInfo(cmd, "sentry do");
Line 248: const info = buildCommandInfo(cmd, "sentry project ...
Found 42 matches
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/sdk.generated.ts:
Line 6: // --- Return types (derived from __jsonSchema) ---
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/introspect.ts:
Line 57: __jsonSchema?: import("valibot").GenericSchema;
Line 62: __primaryUsage?: string;
Line 64: __examples?: readonly CommandExample[];
Line 288: const jsonFields = cmd.__jsonSchema
Line 289: ? extractSchemaFields(cmd.__jsonSchema)
Line 298: cmd.__primaryUsage ?? getPositionalString(cmd.parameters.positional),
Line 301: examples: cmd.__examples?.length
Line 302: ? cmd.__examples.map(
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/test/lib/command.test.ts:
Line 200: (command as unknown as { __primaryUsage?: string }).__primaryUsage
Line 222: expect((command as unknown as { __examples?: unknown ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/introspect.ts</path>
<type>file</type>
<content>
1: /**
2: * Route Tree Introspection
3: *
4: * Shared module for extracting structured metadata from Stricli's route tree.
5: * Used at runtime by `sentry help --json` and at build time by `generate-skill.ts`.
6: *
7: * While @stricli/core exports RouteMap and Command types, they require complex
8: * generic parameters (CommandContext) and don't export internal types like
9: * RouteMapEntry or FlagParameter. These simplified types are purpose-built
10: * for introspection and documentation generation.
11: */
12:
13: import type { CommandExample } from "./command.js";
14: import {
15: extractSchemaFields,
16: type SchemaFieldInfo,
17: } from "./formatters/output.js";
18: import { fuzzyMatch } from "./fuzzy.js";
19:
20: // ---------------------------------------------------------------------------
21: // Stricli Runtime Types (simplified for introspection)
22: ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/help.ts</path>
<type>file</type>
<content>
1: /**
2: * Custom Help Output
3: *
4: * Provides a branded, styled help output for the CLI.
5: * Shows custom formatting when running `sentry` with no arguments.
6: * Commands are auto-generated from Stricli's route structure.
7: */
8:
9: import { routes } from "../app.js";
10: import { formatBanner } from "./banner.js";
11: import { isAuthenticated } from "./db/auth.js";
12: import { TOP_LEVEL_ENV_VARS } from "./env-registry.js";
13: import { cyan, magenta, muted } from "./formatters/colors.js";
14: import {
15: filterFields,
16: formatJson,
17: parseFieldsList,
18: } from "./formatters/json.js";
19: import { GLOBAL_FLAGS } from "./global-flags.js";
20: import {
21: type CommandInfo,
22: extractAllRoutes,
23: getPositionalString,
24: isCommand,
25: isRouteMap,
26: type RouteInfo,
27: type RouteMap,
28: type RouteMapEntry,
29: ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/help.ts</path>
<type>file</type>
<content>
295: /**
296: * Result of introspecting the CLI.
297: * Yielded as CommandOutput — JSON mode serializes directly, human mode
298: * passes through {@link formatHelpHuman}, which renders the branded banner for
299: * the full tree.
300: */
301: export type HelpJsonResult =
302: | {
303: routes: RouteInfo[];
304: envVars: HelpEnvVarInfo[];
305: flags: HelpFlagInfo[];
306: }
307: | CommandInfo
308: | RouteInfo
309: | { error: string; suggestions?: string[] };
310:
311: /**
312: * Build the top-level env-var list for JSON output.
313: *
314: * Exposes exactly the entries marked `topLevel` in the registry so that
315: * consumers (AI agents, docs tooling) can surface them without having to
316: * re-parse the CLI's branded help.
317: */
318: function buildTopLevelEnvVars(): HelpEnvVarInfo[] {
319: return TOP_LEVEL_ENV_VARS.map((v) => ({
320: ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/help.ts</path>
<type>file</type>
<content>
690:
691: /**
692: * Format a CommandInfo as human-readable text.
693: */
694: function formatCommandHuman(cmd: CommandInfo): string {
695: const lines: string[] = [];
696: const signature = cmd.positional ? `${cmd.path} ${cmd.positional}` : cmd.path;
697: lines.push(signature);
698: lines.push("");
699: lines.push(` ${cmd.brief}`);
700:
701: const visibleFlags = cmd.flags.filter((f) => !f.hidden);
702: if (visibleFlags.length > 0) {
703: lines.push("");
704: lines.push(" Flags:");
705: for (const flag of visibleFlags) {
706: lines.push(` ${formatFlagHuman(flag, cmd.aliases)}`);
707: }
708: }
709:
710: if (cmd.jsonFields && cmd.jsonFields.length > 0) {
711: lines.push("");
712: lines.push(" JSON fields (use --json --fields to select):");
713: for (const field of cmd.jsonFields) {
714: const optStr = ...
Found 3 matches
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/test/script/generate-skill-markdown.test.ts:
Line 54: "**Examples:**",
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/test/lib/introspect.test.ts:
Line 201: fullDescription: "List all the things.",
Line 223: expect(info.fullDescription).toBe("List all the things.");
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/agent-conversation.md</path> <type>file</type> <content> 1: --- 2: name: sentry-cli-agent-conversation 3: version: 0.45.0-dev.0 4: description: List and view agent conversations 5: requires: 6: bins: ["sentry"] 7: auth: true 8: --- 9: 10: # Agent-conversation Commands 11: 12: List and view agent conversations 13: 14: ### `sentry agent-conversation list [<org>]` 15: 16: List recent agent conversations 17: 18: **Flags:** 19: - `-n, --limit <value> - Number of conversations (1-1000) - (default: "25")` 20: - `-q, --query <value> - Search query` 21: - `-t, --period <value> - Time range: "7d", "2026-08-01..2026-09-01", ">=2026-08-01" - (default: "7d")` 22: - `-f, --fresh - Bypass cache, re-detect projects, and fetch fresh data` 23: - `-c, --cursor <value> - Navigate pages: "next", "prev", "first" (or raw cursor string)` 24: 25: **JSON Fields** (use `--json --fields` to select ...
No files found
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/script/paths.ts</path> <type>file</type> <content> 1: /** 2: * Shared path constants for build/generate/check scripts. 3: * 4: * These scripts run with the CWD set to this package root (`packages/cli/`). 5: * The documentation site lives in a sibling workspace package 6: * (`apps/cli-docs/`), so cross-package paths are resolved relative to this 7: * package root. Centralizing the docs root here keeps the monorepo layout in 8: * one place instead of scattering `../../apps/cli-docs` literals across scripts. 9: */ 10: 11: /** Docs site package root, relative to this package (`packages/cli/`). */ 12: export const DOCS_ROOT = "../../apps/cli-docs"; 13: 14: /** Docs content/source directories, relative to this package. ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/script/generate-skill.ts</path> <type>file</type> <content> 115: * Kept as a constant to ensure consistency across all generated files. 116: */ 117: const SKILL_DESCRIPTION = 118: "Guide for using the Sentry CLI to interact with Sentry from the command line. Use when the user asks about viewing issues, events, projects, organizations, making API calls, or authenticating with Sentry via CLI."; 119: 120: /** 121: * Preferred display order for routes in the SKILL.md index. 122: * Routes not listed here appear after these in alphabetical order. 123: */ 124: const ROUTE_ORDER = ["help", "auth", "org", "project", "issue", "event", "api"]; 125: 126: /** 127: * Flags that are globally injected and should be omitted from compact index 128: * and only mentioned once in the Global Options section. ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/script/generate-skill-markdown.ts</path>
<type>file</type>
<content>
1: /**
2: * Markdown parsing helpers shared by the skill generator and its tests.
3: */
4:
5: /** Matches a generated command heading and stops before positional usage. */
6: const COMMAND_HEADING_RE =
7: /^`sentry\s+([^<[`\s]+(?:\s+[^<[`\s]+)*)(?:\s*(?:<|\[)[^`]*)?`$/;
8:
9: /** Extract the literal command path from a generated command heading. */
10: export function extractCommandPathFromHeading(
11: heading: string
12: ): string | undefined {
13: const match = COMMAND_HEADING_RE.exec(heading);
14: return match?.[1] ? `sentry ${match[1]}` : undefined;
15: }
16:
17: /** Find the command whose literal path appears in a loose example block. */
18: export function matchExampleToCommand(
19: code: string,
20: commandPaths: readonly string[],
21: groupFallback: string,
22: defaultCommandPath?: string
23: ): string | undefined {
24: // Prefer ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/script/generate-command-docs.ts</path>
<type>file</type>
<content>
90:
91: // ---------------------------------------------------------------------------
92: // Markdown Formatting
93: // ---------------------------------------------------------------------------
94:
95: /**
96: * Get visible, non-global flags for a command.
97: * Excludes hidden flags and globally-injected flags (--json, --fields, etc.).
98: */
99: function getVisibleFlags(cmd: CommandInfo): FlagInfo[] {
100: return cmd.flags.filter((f) => !(f.hidden || GLOBAL_FLAG_NAMES.has(f.name)));
101: }
102:
103: /**
104: * Format a flag as a table row: `| -q, --query <query> | Search query ... |`
105: *
106: * Uses the flag name as the value placeholder for readability
107: * (e.g., `--limit <limit>` instead of `--limit <value>`). ...
No files found
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/index.ts</path>
<type>file</type>
<content>
1: /**
2: * Library entry point for programmatic Sentry CLI usage.
3: *
4: * Provides `createSentrySDK()` as the single public API — a typed SDK client
5: * with named methods for every CLI command, plus a `run()` escape hatch for
6: * arbitrary command strings.
7: *
8: * CLI runner is re-exported as `_cli` for the npm bin wrapper (`dist/bin.cjs`).
9: *
10: * @example
11: * ```typescript
12: * import createSentrySDK from "sentry";
13: *
14: * const sdk = createSentrySDK({ token: "sntrys_..." });
15: * const orgs = await sdk.org.list();
16: * const issues = await sdk.issue.list({ orgProject: "acme/frontend" });
17: *
18: * // Escape hatch for arbitrary commands
19: * const version = await sdk.run("--version");
20: * ```
21: *
22: * @module
23: */
24:
25: import { buildInvoker, buildRunner } from "./lib/sdk-invoke.js";
26: import { createSDKMethods } from ...
diff --git a/packages/cli/test/commands/agent-conversation/list.test.ts b/packages/cli/test/commands/agent-conversation/list.test.ts
index 21a26bd6c..e080697cc 100644
--- a/packages/cli/test/commands/agent-conversation/list.test.ts
+++ b/packages/cli/test/commands/agent-conversation/list.test.ts
@@ -183,200 +183,213 @@ let getAuthConfigSpy: ReturnType<typeof vi.spyOn>;
beforeEach(() => {
getAuthConfigSpy = vi.spyOn(dbAuth, "getAuthConfig").mockReturnValue({
token: "sntrys_test",
source: "oauth" as const,
});
});
afterEach(() => {
getAuthConfigSpy.mockRestore();
});
// ============================================================================
// Tests
// ============================================================================
describe("listCommand.func", () => {
let listConversationsSpy: ReturnType<typeof vi.spyOn>;
let resolveOrgSpy: ReturnType<typeof vi.spyOn>;
let withProgressSpy: ReturnType<typeof vi.spyOn>;
let resolveCursorSpy: ...
No files found
Found 15 matches
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/commands/agent-conversation/list.ts:
Line 100: export const listCommand = buildListCommand("agent-conversation", {
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/commands/trace/list.ts:
Line 198: export const listCommand = buildListCommand("trace", {
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/commands/span/list.ts:
Line 540: export const listCommand = buildListCommand("span", {
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/commands/alert/metrics/list.ts:
Line 511: export const listCommand = buildListCommand("alert metrics", {
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/commands/alert/issues/list.ts:
Line 517: export const listCommand = buildListCommand("alert issues", {
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/commands/issue/list.ts:
Line 1450: export const listCommand = buildListCommand("issue", ...
Found 3 matches /home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/commands/project/create.ts: Line 609: customUsage: ["[<org>/]<name>:<platform>..."], /home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/commands/agent-conversation/view.ts: Line 63: customUsage: [USAGE], /home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/commands/agent-conversation/list.ts: Line 103: customUsage: [USAGE],
Found 9 matches
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/command.ts:
Line 110: type CommandDocumentation = StricliBuilderArgs<CommandContext>["docs"] & {
Line 153: readonly docs: CommandDocumentation;
Line 420: docs: CommandDocumentation,
Line 423: ): CommandDocumentation {
Line 441: docs: CommandDocumentation
Line 460: docs: CommandDocumentation
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/mutate-command.ts:
Line 310: * docs: { brief: "Delete a widget" },
Line 335: readonly docs: {
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/list-command.ts:
Line 548: readonly docs: {
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/mutate-command.ts</path> <type>file</type> <content> 280: /** Skip injecting `--dry-run` flag and `-n` alias. */ 281: noDryRunFlag?: boolean; 282: /** Skip the non-interactive safety guard pre-hook. */ 283: noNonInteractiveGuard?: boolean; 284: }; 285: 286: /** 287: * Build a Stricli command for a destructive operation with automatic safety 288: * flag injection and a non-interactive guard. 289: * 290: * This is a drop-in replacement for `buildCommand` that: 291: * 1. Auto-injects `--yes`, `--force`, and `--dry-run` flags (unless already 292: * defined, controlled by `options`) 293: * 2. Auto-injects `-y`, `-f`, `-n` aliases (skips if key already taken) 294: * 3. ...
Found 1 matches
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/commands/agent-conversation/list.ts:
Line 100: export const listCommand = buildListCommand("agent-conversation", {
Found 3 matches
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/commands/agent-conversation/view.ts:
Line 61: docs: {
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/commands/agent-conversation/list.ts:
Line 101: docs: {
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/commands/agent-conversation/index.ts:
Line 17: docs: {
Found 1 matches /home/byk/Code/getsentry/cli-pr-1558/packages/cli/test/script/generate-skill-markdown.test.ts: Line 54: "**Examples:**",
Found 7 matches
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/test/lib/scanner-flags.integration.test.ts:
Line 11: * from `runApplication`) and exposes a `documentation.renderHelp` hook that the
Line 239: describe("--help --json renders structured help via renderHelp hook", () => {
Line 240: // The patch exposes a `documentation.renderHelp` hook; app.ts uses it to emit
Line 287: // reaches renderHelp. The unknown token must surface as a JSON `error`
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/test/lib/introspect.test.ts:
Line 201: fullDescription: "List all the things.",
Line 223: expect(info.fullDescription).toBe("List all the things.");
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/test/lib/help-json.test.ts:
Line 3: * Stricli's `documentation.renderHelp` hook (see `app.ts`).
Found 23 matches /home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/trials.ts: Line 241: return Object.hasOwn(TRIAL_NAMES, value); /home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/timezone.ts: Line 16: * `Date.prototype.getTimezoneOffset()` returns `0`. A user in US/Pacific then Line 172: * `Date.prototype.getTimezoneOffset()` returns minutes *behind* UTC (positive /home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/telemetry.ts: Line 426: "FunctionToString", // wraps Function.prototype.toString Line 490: * integrations (process listeners, HTTP trace headers, Function.prototype /home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/sourcemap/inject.ts: Line 739: * Byte-wise (code-unit) comparison of two strings for `Array.prototype.sort`. /home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/scan/walker.ts: Line 111: * prototype. The serial walker's default is a plain `stack.push`. ...
ripgrep execution failed
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/script/check-fragments.ts</path>
<type>file</type>
<content>
1: #!/usr/bin/env tsx
2: /**
3: * Validate doc fragment files.
4: *
5: * Ensures fragment files stay consistent with the CLI route tree:
6: * 1. Every route has a corresponding fragment file (+ index.md)
7: * 2. Every fragment file corresponds to an existing route (or is index.md)
8: * 3. Fragment files don't accidentally contain frontmatter or the generated marker
9: * 4. Top-level fragments (e.g., configuration.md) exist
10: * 5. Fragment content covers all subcommands in a route (warnings only)
11: *
12: * Usage:
13: * tsx script/check-fragments.ts # Warnings for missing subcommands
14: * tsx script/check-fragments.ts --strict # Errors for missing subcommands
15: */
16:
17: import { mkdirSync, readdirSync } from "node:fs";
18: import { access, readFile, writeFile } from "node:fs/promises";
19: import type { RouteInfo, RouteMap ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/script/check-fragments.ts</path>
<type>file</type>
<content>
250: const multiCommandRoutes = getMultiCommandRoutes();
251:
252: for (const [routeName, route] of multiCommandRoutes) {
253: const fragmentPath = `${FRAGMENTS_DIR}/${routeName}.md`;
254: let content: string;
255: try {
256: content = await readFile(fragmentPath, "utf-8");
257: } catch {
258: // Fragment doesn't exist — already caught by Check 1
259: continue;
260: }
261:
262: const defaultCmd = getDefaultCommandName(routeName);
263:
264: const missing: string[] = [];
265: for (const cmd of route.commands) {
266: if (cmd.examples.length > 0) {
267: continue;
268: }
269: const sub = cmd.path.slice(`sentry ${routeName} `.length);
270: const leaf = sub.split(" ").at(-1) ?? sub;
271: const isDefault = leaf === defaultCmd;
272: if (!fragmentMentionsSubcommand(content, routeName, cmd, isDefault)) {
273: ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/script/generate-command-docs.ts</path>
<type>file</type>
<content>
350: lines.push("");
351:
352: // Environment Variables section
353: lines.push("## Environment Variables");
354: lines.push("");
355:
356: for (const entry of registry) {
357: lines.push(generateEnvVarSection(entry));
358: lines.push("");
359: }
360:
361: // End marker
362: lines.push(GENERATED_END_MARKER);
363:
364: return lines.join("\n");
365: }
366:
367: // ---------------------------------------------------------------------------
368: // Custom Content (Fragment Files)
369: // ---------------------------------------------------------------------------
370:
371: /**
372: * Read hand-written custom content from a command fragment file.
373: * Fragment files live in docs/src/fragments/commands/ and contain only
374: * the custom sections (examples, guides) — no frontmatter or generated content. ...
DEPRECATED `test.poolOptions` was removed in Vitest 4. All previous `poolOptions` are now top-level options. Please, refer to the migration guide: https://vitest.dev/guide/migration#pool-rework RUN v4.1.10 /home/byk/Code/getsentry/cli-pr-1558/packages/cli [debug] [compat-flags] --org flag → SENTRY_ORG=my-org [debug] [compat-flags] --project flag → SENTRY_PROJECT=my-proj [debug] [compat-flags] --org flag → SENTRY_ORG=my-org [debug] [compat-flags] --project flag → SENTRY_PROJECT=my-proj [debug] [compat-flags] --org flag → SENTRY_ORG=new [debug] [compat-flags] --org flag → SENTRY_ORG=my-org [debug] [compat-flags] --project flag → SENTRY_PROJECT=my-proj [debug] [compat-flags] --org flag → SENTRY_ORG=my-org [debug] [compat-flags] --project flag → SENTRY_PROJECT=my-project [debug] [compat-flags] --org flag → SENTRY_ORG=new-org [debug] [compat-flags] --org flag → SENTRY_ORG=sentry [debug] [compat-flags] --project flag → SENTRY_PROJECT=cli [debug] [compat-flags] --org flag → ...
> sentry@0.45.0-dev.0 check:fragments /home/byk/Code/getsentry/cli-pr-1558/packages/cli
> pnpm tsx script/check-fragments.ts -- --strict
> sentry@0.45.0-dev.0 tsx /home/byk/Code/getsentry/cli-pr-1558/packages/cli
> tsx --env-file-if-exists=.env.local --import ./script/require-shim.mjs script/check-fragments.ts -- --strict
.env.local not found. Continuing without it.
.env.local not found. Continuing without it.
Found 1 fragment validation error(s):
✗ Fragment missing subcommand coverage: ../../apps/cli-docs/src/fragments/commands/proguard.md
Not documented: upload
Hint: add a heading or code example for each (e.g., "sentry proguard upload")
ELIFECYCLE Command failed with exit code 1.
ELIFECYCLE Command failed with exit code 1.
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/test/lib/command.test.ts</path>
<type>file</type>
<content>
1: /**
2: * Command Builder Tests
3: *
4: * Tests for the buildCommand wrapper that adds automatic flag telemetry.
5: * Uses Stricli's run() to invoke commands end-to-end, verifying the wrapper
6: * captures flags/args and calls the original function.
7: */
8:
9: import { setTimeout as sleep } from "node:timers/promises";
10: // biome-ignore lint/performance/noNamespaceImport: needed for spyOn mocking
11: import * as Sentry from "@sentry/node-core/light";
12: import {
13: buildApplication,
14: type CommandContext,
15: run,
16: text_en,
17: } from "@stricli/core";
18: import { afterEach, beforeEach, describe, expect, test, vi } from "vitest";
19: import {
20: applyLoggingFlags,
21: applyOrgProjectFlags,
22: buildCommand,
23: FIELDS_FLAG,
24: JSON_FLAG,
25: LOG_LEVEL_FLAG,
26: numberParser,
27: VERBOSE_FLAG,
28: } from ...
Found 8 matches
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/app.ts:
Line 4: text_en,
Line 306: ...text_en,
Line 323: return `${text_en.exceptionWhileParsingArguments(exc, ansiColor)}${pluralHint}`;
Line 334: return `${text_en.exceptionWhileParsingArguments(exc, ansiColor)}${tip}`;
Line 338: return text_en.exceptionWhileParsingArguments(exc, ansiColor);
Line 342: const base = text_en.noCommandRegisteredForInput({
Line 410: export const app = buildApplication(routes, {
Line 428: documentation: {
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/app.ts</path>
<type>file</type>
<content>
280: }
281: const prefix = ansiColor ? errorColor("Error:") : "Error:";
282: const tip = ansiColor
283: ? warning(`Tip: ${synonymHint}`)
284: : `Tip: ${synonymHint}`;
285: return `${prefix} ${exc.format()}\n${tip}`;
286: }
287:
288: function escapesToOuterMiddleware(exc: unknown): boolean {
289: if (exc instanceof OutputError) {
290: return true;
291: }
292: if (exc instanceof AuthError) {
293: return exc.reason === "not_authenticated" || exc.reason === "expired";
294: }
295: return exc instanceof ApiError && (exc.status === 401 || exc.status === 403);
296: }
297:
298: /**
299: * Custom error formatting for CLI errors.
300: *
301: * - AuthError (not_authenticated): Re-thrown to allow auto-login flow in bin.ts
302: * - Other CliError subclasses: Show clean user-friendly message without stack trace
303: * - Other errors: Show stack trace for ...
> sentry@0.45.0-dev.0 cli /home/byk/Code/getsentry/cli-pr-1558/packages/cli > tsx --env-file-if-exists=.env.local --import ./script/require-shim.mjs src/bin.ts -- agent-conversation list --help .env.local not found. Continuing without it. .env.local not found. Continuing without it. Error: API request failed: 404 Not Found Endpoint: /organizations/--help/agents/conversations/ Not found ELIFECYCLE Command failed with exit code 30.
> sentry@0.45.0-dev.0 cli /home/byk/Code/getsentry/cli-pr-1558/packages/cli > tsx --env-file-if-exists=.env.local --import ./script/require-shim.mjs src/bin.ts agent-conversation list --help .env.local not found. Continuing without it. .env.local not found. Continuing without it. USAGE sentry agent-conversation list [<org>] sentry agent-conversation list --help List recent agent conversations from a Sentry organization. The organization is auto-detected when omitted. Examples: sentry agent-conversation list # List recent agent conversations sentry agent-conversation list my-org # Explicit organization sentry agent-conversation list --limit 50 --period 24h # Show more, last 24 hours sentry agent-conversation list -q "has:errors" # Filter conversations sentry agent-conversation list my-org -c next # Paginate through results JSON fields (use --json --fields to select): conversationId (string) title (string | null, optional) flow (array) errors (number) ...
> sentry@0.45.0-dev.0 cli /home/byk/Code/getsentry/cli-pr-1558/packages/cli > tsx --env-file-if-exists=.env.local --import ./script/require-shim.mjs src/bin.ts agent-conversation view --help .env.local not found. Continuing without it. .env.local not found. Continuing without it. USAGE sentry agent-conversation view [<org>/]<conversation-id> sentry agent-conversation view --help View the full transcript of an agent conversation. The org is optional and auto-detected from your project context when omitted. Prefix the ID with an org slug to target a specific org. ...
Found 1 matches
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/commands/auth/default.ts:
Line 12: import type { Command } from "@stricli/core";
## fix/agent-conversation-reference-root-cause...origin/pr-1558 [gone] M apps/cli-docs/src/fragments/commands/agent-conversation.md M packages/cli/script/check-fragments.ts M packages/cli/script/generate-command-docs.ts M packages/cli/script/generate-skill-markdown.ts M packages/cli/script/generate-skill.ts M packages/cli/src/commands/agent-conversation/list.ts M packages/cli/src/commands/agent-conversation/view.ts M packages/cli/src/lib/command.ts M packages/cli/src/lib/introspect.ts M packages/cli/src/lib/list-command.ts M packages/cli/src/lib/mutate-command.ts M packages/cli/test/commands/agent-conversation/list.test.ts M packages/cli/test/lib/command.test.ts M packages/cli/test/lib/introspect.test.ts M packages/cli/test/script/generate-skill-markdown.test.ts
diff --git a/packages/cli/src/lib/mutate-command.ts b/packages/cli/src/lib/mutate-command.ts
index 976f2890f..68419f0ce 100644
--- a/packages/cli/src/lib/mutate-command.ts
+++ b/packages/cli/src/lib/mutate-command.ts
@@ -1,122 +1,122 @@
/**
* Shared building blocks for mutation (create/delete) commands.
*
* Provides reusable Stricli parameter definitions, safety utilities, and a
* `buildDeleteCommand` wrapper — paralleling `list-command.ts` for list commands.
*
* Level A — shared constants (used by create and delete commands):
* DRY_RUN_FLAG, YES_FLAG, FORCE_FLAG,
* DESTRUCTIVE_FLAGS, DESTRUCTIVE_ALIASES, DRY_RUN_ALIASES
*
* Level B — shared utilities:
* isConfirmationBypassed, guardNonInteractive, confirmByTyping,
* requireExplicitTarget
*
* Level C — delete command builder:
* buildDeleteCommand
*/
import { isatty } from "node:tty";
import type { Command, CommandContext } from "@stricli/core";
import type { ParsedOrgProject } from ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/command.ts</path>
<type>file</type>
<content>
90: * Rather than silencing with `as any`, we cast through `unknown` to
91: * this type that matches Stricli's structural expectations while
92: * erasing the generic constraints we can no longer satisfy.
93: */
94: type StricliBuilderArgs<CONTEXT extends CommandContext> =
95: import("@stricli/core").CommandBuilderArguments<BaseFlags, BaseArgs, CONTEXT>;
96:
97: /** A runnable example stored with a command definition for generated docs. */
98: export type CommandExample = {
99: /** Short explanation rendered before the command. */
100: readonly description: string;
101: /** Complete command line, including the `sentry` executable. */
102: readonly command: string;
103: };
104:
105: /**
106: * Native Stricli documentation plus metadata for generated docs. ...
(no output)
No files found
No files found
No files found
No files found
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/patches/@stricli%2Fcore@1.2.8.patch
No files found
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/patches/@stricli%2Fcore@1.2.8.patch</path>
<type>file</type>
<content>
1: diff --git a/dist/index.cjs b/dist/index.cjs
2: index a9afbc1ab78cad7ba97d53882a80236af62854df..141532779be923b8f3b421b0afc031b5ea209e29 100644
3: --- a/dist/index.cjs
4: +++ b/dist/index.cjs
5: @@ -1277,6 +1277,35 @@ var RouteMapSymbol = Symbol("RouteMap");
6: var CommandSymbol = Symbol("Command");
7:
8: // src/routing/scanner.ts
9: +// PATCH(getsentry/cli): pluggable top-level (global) flags allow-list.
10: +// Stricli only parses flags at the leaf command, so a flag placed before the
11: +// subcommand (e.g. `mycli --verbose sub cmd`) is treated as an unknown route
12: +// segment and fails route resolution. When the host application declares a
13: +// `scanner.topLevelFlags` allow-list, `buildRouteScanner` recognizes those
14: +// flags at any route depth and forwards them (and, for value-taking flags,
15: +// their value) to the leaf command via ...
...output truncated...
Full output saved to: /home/byk/.local/share/opencode/tool-output/tool_0830c7e19001u3H0kvDyyHqfWr
conversations,
hasMore,
hasPrev,
nextCursor,
org,
});
const parts: string[] = [];
if (flags.query) {
parts.push(`-q "${flags.query}"`);
}
appendPeriodHint(parts, flags.period, DEFAULT_PERIOD);
const flagSuffix = parts.length > 0 ? ` ${parts.join(" ")}` : "";
return {
hint: paginationHint({
hasMore,
hasPrev: !!hasPrev,
nextHint: `sentry agent-conversation list ${org} -c next${flagSuffix}`,
prevHint: `sentry agent-conversation list ${org} -c prev${flagSuffix}`,
}),
};
},
});
diff --git a/packages/cli/src/commands/agent-conversation/view.ts b/packages/cli/src/commands/agent-conversation/view.ts
index 9bb2a04f1..111159312 100644
--- a/packages/cli/src/commands/agent-conversation/view.ts
+++ ...
<path>/home/byk/Code/getsentry/cli-pr-1558/apps/cli-docs/src/fragments/commands/agent-conversation.md</path> <type>file</type> <content> (End of file - total 0 lines) </content>
0 36 apps/cli-docs/src/fragments/commands/agent-conversation.md 690
No files found
diff --git a/packages/cli/script/check-fragments.ts b/packages/cli/script/check-fragments.ts
index 36db22e1d..6384a649d 100644
--- a/packages/cli/script/check-fragments.ts
+++ b/packages/cli/script/check-fragments.ts
@@ -146,168 +146,171 @@ function stripCodeBlocks(md: string): string {
*
* Looks for either:
* 1. A full CLI reference: `sentry <route> <subcommand>` anywhere in the text
* 2. A markdown heading containing the leaf subcommand name (outside code blocks)
*
* For default commands (e.g., `sentry local serve` where `serve` is the
* default), also accepts `sentry <route>` without the subcommand — since
* users invoke the default command that way.
*/
function fragmentMentionsSubcommand(
content: string,
routeName: string,
command: { path: string },
isDefaultCommand: boolean
): boolean {
// Extract the subcommand portion after "sentry <route>"
const subPath = command.path.slice(`sentry ${routeName} `.length);
const leaf = ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/commands/agent-conversation/list.ts</path>
<type>file</type>
<content>
1: /**
2: * sentry agent-conversation list
3: *
4: * List recent agent conversations from Sentry projects.
5: */
6:
7: import type { SentryContext } from "../../context.js";
8: import { listConversations } from "../../lib/api-client.js";
9: import { validateLimit } from "../../lib/arg-parsing.js";
10: import {
11: advancePaginationState,
12: buildPaginationContextKey,
13: hasPreviousPage,
14: resolveCursor,
15: } from "../../lib/db/pagination.js";
16: import { ContextError } from "../../lib/errors.js";
17: import { formatConversationTable } from "../../lib/formatters/conversation.js";
18: import { filterFields } from "../../lib/formatters/json.js";
19: import { CommandOutput } from "../../lib/formatters/output.js";
20: import {
21: buildListCommand,
22: LIST_DEFAULT_LIMIT,
23: LIST_MAX_LIMIT,
24: LIST_MIN_LIMIT,
25: ...
Found 12 matches
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/command.ts:
Line 110: export type CommandDocumentation =
Line 154: readonly docs: CommandDocumentation;
Line 421: docs: CommandDocumentation,
Line 424: ): CommandDocumentation {
Line 442: docs: CommandDocumentation
Line 461: docs: CommandDocumentation
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/mutate-command.ts:
Line 22: import { buildCommand, type CommandDocumentation } from "./command.js";
Line 335: readonly docs: CommandDocumentation;
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/list-command.ts:
Line 25: type CommandDocumentation,
Line 552: readonly docs: CommandDocumentation;
Line 631: export type OrgListCommandDocs = CommandDocumentation;
Line 688: docs: OrgListCommandDocs,
Found 3 matches /home/byk/Code/getsentry/cli-pr-1558/package.json: Line 38: "check:fragments": "pnpm --filter sentry run check:fragments", /home/byk/Code/getsentry/cli-pr-1558/packages/cli/package.json: Line 80: "check:fragments": "pnpm tsx script/check-fragments.ts", /home/byk/Code/getsentry/cli-pr-1558/.github/workflows/ci.yml: Line 188: run: pnpm run check:fragments
> sentry@0.45.0-dev.0 check:fragments /home/byk/Code/getsentry/cli-pr-1558/packages/cli
> pnpm tsx script/check-fragments.ts
> sentry@0.45.0-dev.0 tsx /home/byk/Code/getsentry/cli-pr-1558/packages/cli
> tsx --env-file-if-exists=.env.local --import ./script/require-shim.mjs script/check-fragments.ts
.env.local not found. Continuing without it.
.env.local not found. Continuing without it.
1 subcommand coverage warning(s):
⚠ Fragment missing subcommand coverage: ../../apps/cli-docs/src/fragments/commands/proguard.md
Not documented: upload
Hint: add a heading or code example for each (e.g., "sentry proguard upload")
All 37 command fragment files valid (36 routes + index)
All 1 top-level fragment(s) valid
> sentry@0.45.0-dev.0 generate:command-docs /home/byk/Code/getsentry/cli-pr-1558/packages/cli > pnpm tsx script/generate-command-docs.ts > sentry@0.45.0-dev.0 tsx /home/byk/Code/getsentry/cli-pr-1558/packages/cli > tsx --env-file-if-exists=.env.local --import ./script/require-shim.mjs script/generate-command-docs.ts .env.local not found. Continuing without it. .env.local not found. Continuing without it. Generated 36 command doc pages + ../../apps/cli-docs/src/content/docs/commands/index.md + ../../apps/cli-docs/src/content/docs/configuration.md
## fix/agent-conversation-reference-root-cause...origin/pr-1558 [gone] M apps/cli-docs/src/fragments/commands/agent-conversation.md M packages/cli/script/check-fragments.ts M packages/cli/script/generate-command-docs.ts M packages/cli/script/generate-skill-markdown.ts M packages/cli/script/generate-skill.ts M packages/cli/src/commands/agent-conversation/list.ts M packages/cli/src/commands/agent-conversation/view.ts M packages/cli/src/lib/command.ts M packages/cli/src/lib/introspect.ts M packages/cli/src/lib/list-command.ts M packages/cli/src/lib/mutate-command.ts M packages/cli/test/commands/agent-conversation/list.test.ts M packages/cli/test/lib/command.test.ts M packages/cli/test/lib/introspect.property.test.ts M packages/cli/test/lib/introspect.test.ts M packages/cli/test/script/generate-skill-markdown.test.ts
No files found
No files found
No files found
File not found: /home/byk/Code/getsentry/cli-pr-1558/.agents
diff --git a/packages/cli/test/lib/introspect.property.test.ts b/packages/cli/test/lib/introspect.property.test.ts
index 9c46a8bb2..79aac6243 100644
--- a/packages/cli/test/lib/introspect.property.test.ts
+++ b/packages/cli/test/lib/introspect.property.test.ts
@@ -64,170 +64,180 @@ const commandArb = record({
brief: string(),
flags: flagsMapArb,
}).map(
({ brief, flags }): Command => ({
brief,
parameters: { flags, aliases: {} },
})
);
/** Generate a RouteMapEntry with a command */
const commandEntryArb = tuple(nameArb, commandArb, boolean()).map(
([name, cmd, hidden]): RouteMapEntry => ({
name: { original: name },
target: cmd,
hidden,
})
);
/** Generate a simple RouteMap (one level) */
const routeMapArb = tuple(
string(),
array(commandEntryArb, { minLength: 0, maxLength: 5 })
).map(
([brief, entries]): RouteMap => ({
brief,
getAllEntries: () => entries,
})
);
// ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/introspect.ts</path>
<type>file</type>
<content>
185: // ---------------------------------------------------------------------------
186: // Extraction Functions
187: // ---------------------------------------------------------------------------
188:
189: /**
190: * Build a positional parameter placeholder string from Stricli positional params.
191: *
192: * @param params - Stricli positional parameter definition
193: * @returns Human-readable placeholder like `<target>` or `<command...>`
194: */
195: export function getPositionalString(params?: PositionalParams): string {
196: if (!params) {
197: return "";
198: }
199:
200: if (params.kind === "tuple") {
201: return params.parameters
202: .map((p, i) => {
203: const placeholder = `<${p.placeholder ?? `arg${i}`}>`;
204: return p.optional ? `[${placeholder}]` : placeholder;
205: })
206: .join(" ");
207: }
208:
209: ...
diff --git a/packages/cli/src/lib/introspect.ts b/packages/cli/src/lib/introspect.ts
index bf8c94f25..670b490d9 100644
--- a/packages/cli/src/lib/introspect.ts
+++ b/packages/cli/src/lib/introspect.ts
@@ -1,121 +1,124 @@
/**
* Route Tree Introspection
*
* Shared module for extracting structured metadata from Stricli's route tree.
* Used at runtime by `sentry help --json` and at build time by `generate-skill.ts`.
*
* While @stricli/core exports RouteMap and Command types, they require complex
* generic parameters (CommandContext) and don't export internal types like
* RouteMapEntry or FlagParameter. These simplified types are purpose-built
* for introspection and documentation generation.
*/
+import type { CommandExample } from "./command.js";
import {
extractSchemaFields,
type SchemaFieldInfo,
} from "./formatters/output.js";
import { fuzzyMatch } from "./fuzzy.js";
// ---------------------------------------------------------------------------
// ...
Found 100 matches (more matches available) /home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/commands/trial/start.ts: Line 106: optional: true as const, /home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/commands/trial/list.ts: Line 224: optional: true as const, /home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/commands/local/server.ts: Line 752: optional: true, /home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/commands/local/run.ts: Line 385: optional: true, /home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/commands/debug-files/upload.ts: Line 581: optional: true, Line 588: optional: true, Line 594: optional: true, Line 600: optional: true, Line 606: optional: true, Line 612: optional: true, Line 618: optional: true, Line 625: optional: true, Line 631: optional: true, Line 637: optional: true, Line 643: ...
DEPRECATED `test.poolOptions` was removed in Vitest 4. All previous `poolOptions` are now top-level options. Please, refer to the migration guide: https://vitest.dev/guide/migration#pool-rework RUN v4.1.10 /home/byk/Code/getsentry/cli-pr-1558/packages/cli [debug] [compat-flags] --org flag → SENTRY_ORG=my-org [debug] [compat-flags] --project flag → SENTRY_PROJECT=my-proj [debug] [compat-flags] --org flag → SENTRY_ORG=my-org [debug] [compat-flags] --project flag → SENTRY_PROJECT=my-proj [debug] [compat-flags] --org flag → SENTRY_ORG=new [debug] [compat-flags] --org flag → SENTRY_ORG=my-org [debug] [compat-flags] --project flag → SENTRY_PROJECT=my-proj [debug] [compat-flags] --org flag → SENTRY_ORG=my-org [debug] [compat-flags] --project flag → SENTRY_PROJECT=my-project [debug] [compat-flags] --org flag → SENTRY_ORG=new-org [debug] [compat-flags] --org flag → SENTRY_ORG=sentry [debug] [compat-flags] --project flag → SENTRY_PROJECT=cli [debug] [compat-flags] --org flag → ...
## fix/agent-conversation-reference-root-cause...origin/pr-1558 [gone] M apps/cli-docs/src/fragments/commands/agent-conversation.md M packages/cli/plugins/sentry-cli/skills/sentry-cli/SKILL.md M packages/cli/plugins/sentry-cli/skills/sentry-cli/references/alert.md M packages/cli/plugins/sentry-cli/skills/sentry-cli/references/cli.md M packages/cli/plugins/sentry-cli/skills/sentry-cli/references/explore.md M packages/cli/plugins/sentry-cli/skills/sentry-cli/references/feedback.md M packages/cli/plugins/sentry-cli/skills/sentry-cli/references/init.md M packages/cli/plugins/sentry-cli/skills/sentry-cli/references/issue.md M packages/cli/plugins/sentry-cli/skills/sentry-cli/references/monitor.md M packages/cli/plugins/sentry-cli/skills/sentry-cli/references/org.md M packages/cli/plugins/sentry-cli/skills/sentry-cli/references/project.md M packages/cli/plugins/sentry-cli/skills/sentry-cli/references/release.md M ...
No files found
21 21 packages/cli/plugins/sentry-cli/skills/sentry-cli/SKILL.md 3 3 packages/cli/plugins/sentry-cli/skills/sentry-cli/references/alert.md 2 2 packages/cli/plugins/sentry-cli/skills/sentry-cli/references/cli.md 1 1 packages/cli/plugins/sentry-cli/skills/sentry-cli/references/explore.md 1 1 packages/cli/plugins/sentry-cli/skills/sentry-cli/references/feedback.md 1 1 packages/cli/plugins/sentry-cli/skills/sentry-cli/references/init.md 1 1 packages/cli/plugins/sentry-cli/skills/sentry-cli/references/issue.md 1 1 packages/cli/plugins/sentry-cli/skills/sentry-cli/references/monitor.md 1 1 packages/cli/plugins/sentry-cli/skills/sentry-cli/references/org.md 2 2 packages/cli/plugins/sentry-cli/skills/sentry-cli/references/project.md 2 2 packages/cli/plugins/sentry-cli/skills/sentry-cli/references/release.md 1 1 packages/cli/plugins/sentry-cli/skills/sentry-cli/references/replay.md 1 1 packages/cli/plugins/sentry-cli/skills/sentry-cli/references/repo.md 1 1 packages/cli/plugins/sentry-cli/skill...
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/agent-conversation.md
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/agent-conversation.md</path> <type>file</type> <content> 1: --- 2: name: sentry-cli-agent-conversation 3: version: 0.45.0-dev.0 4: description: List and view agent conversations 5: requires: 6: bins: ["sentry"] 7: auth: true 8: --- 9: 10: # Agent-conversation Commands 11: 12: List and view agent conversations 13: 14: ### `sentry agent-conversation list [<org>]` 15: 16: List recent agent conversations 17: 18: **Flags:** 19: - `-n, --limit <value> - Number of conversations (1-1000) - (default: "25")` 20: - `-q, --query <value> - Search query` 21: - `-t, --period <value> - Time range: "7d", "2026-08-01..2026-09-01", ">=2026-08-01" - (default: "7d")` 22: - `-f, --fresh - Bypass cache, re-detect projects, and fetch fresh data` 23: - `-c, --cursor <value> - Navigate pages: "next", "prev", "first" (or raw cursor string)` 24: 25: **JSON Fields** (use `--json --fields` to select ...
exit=0
86 860e42d46efb247822e4f9570e776b551c813b0751b12a0c067fd38bd7d4ba22 - 860e42d46efb247822e4f9570e776b551c813b0751b12a0c067fd38bd7d4ba22 packages/cli/plugins/sentry-cli/skills/sentry-cli/references/agent-conversation.md
bbaa7b3b7 (HEAD -> fix/agent-conversation-reference-root-cause) fix(docs): correct agent conversation argument syntax .../src/fragments/commands/agent-conversation.md | 9 +++++--- .../plugins/sentry-cli/skills/sentry-cli/SKILL.md | 4 ++-- .../sentry-cli/references/agent-conversation.md | 13 +++++++---- .../cli/src/commands/agent-conversation/list.ts | 1 + .../cli/src/commands/agent-conversation/view.ts | 1 + .../test/script/generate-skill-markdown.test.ts | 27 ++++++++++++++++++++++ 6 files changed, 45 insertions(+), 10 deletions(-) bbaa7b3b7 fix(docs): correct agent conversation argument syntax 9d0901b10 feat(local): Add agent debugging stream (#1538) 72c307f47 fix(cli): log UID resolution failures in sentry cli fix (#1541) e710ce905 fix(telemetry): log process-tree walk failures in agent detection (#1542) 6e3e7e13a feat(config): follow XDG Base Directory spec for config location (#1503)
diff --git a/packages/cli/plugins/sentry-cli/skills/sentry-cli/SKILL.md b/packages/cli/plugins/sentry-cli/skills/sentry-cli/SKILL.md index 8422018c2..66569f927 100644 --- a/packages/cli/plugins/sentry-cli/skills/sentry-cli/SKILL.md +++ b/packages/cli/plugins/sentry-cli/skills/sentry-cli/SKILL.md @@ -337,127 +337,127 @@ sentry auth logout ## Command Reference ### Auth Authenticate with Sentry - `sentry auth login` — Authenticate with Sentry - `sentry auth logout` — Log out of Sentry - `sentry auth refresh` — Refresh your OAuth access token - `sentry auth status` — View authentication status - `sentry auth token` — Print the stored authentication token - `sentry auth whoami` — Show the currently authenticated identity → Full flags and examples: `references/auth.md` ### Org Work with Sentry organizations - `sentry org list` — List organizations -- `sentry org view <org>` — View details of an organization +- `sentry org view [<org>]` — View details of an ...
Found 36 matches
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/test/script/generate-skill-markdown.test.ts:
Line 33: const list = buildCommandInfo(
Line 37: const view = buildCommandInfo(
Line 43: (listCommand as unknown as { __primaryUsage?: string }).__primaryUsage
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/introspect.ts:
Line 62: __primaryUsage?: string;
Line 64: __examples?: readonly CommandExample[];
Line 286: export function buildCommandInfo(
Line 301: cmd.__primaryUsage ?? getPositionalString(cmd.parameters.positional),
Line 304: examples: cmd.__examples?.length
Line 305: ? cmd.__examples.map(
Line 336: commands.push(buildCommandInfo(subTarget, path, examples));
Line 356: export function extractAllRoutes(routeMap: RouteMap): RouteInfo[] {
Line 378: commands: [buildCommandInfo(target, path)],
Line 453: info: buildCommandInfo(target, `sentry ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/test/lib/command.test.ts</path>
<type>file</type>
<content>
175: // no-op
176: },
177: });
178: expect(command).toBeDefined();
179: });
180:
181: test("retains the primary custom usage line for introspection", () => {
182: const command = buildCommand<Record<string, never>, string[]>({
183: auth: false,
184: docs: {
185: brief: "Create things",
186: customUsage: ["<name>:<kind>..."],
187: },
188: parameters: {
189: positional: {
190: kind: "array",
191: parameter: { brief: "Name and kind pairs", parse: String },
192: },
193: },
194: async *func() {
195: yield null;
196: },
197: });
198:
199: expect(
200: (command as unknown as { __primaryUsage?: string }).__primaryUsage
201: ).toBe("<name>:<kind>...");
202: });
203:
204: test("retains structured examples for introspection", ...
diff --git a/packages/cli/test/commands/agent-conversation/list.test.ts b/packages/cli/test/commands/agent-conversation/list.test.ts
index 21a26bd6c..e080697cc 100644
--- a/packages/cli/test/commands/agent-conversation/list.test.ts
+++ b/packages/cli/test/commands/agent-conversation/list.test.ts
@@ -233,100 +233,113 @@ describe("listCommand.func", () => {
test("resolves org from positional arg", async () => {
listConversationsSpy.mockResolvedValue({
data: sampleConversations,
nextCursor: undefined,
});
const { context } = createMockContext();
const func = await listCommand.loader();
await func.call(context, JSON_FLAGS, ORG);
// resolveOrg receives the positional org directly
expect(resolveOrgSpy).toHaveBeenCalledWith(
expect.objectContaining({ org: ORG })
);
// listConversations called with the resolved org
expect(listConversationsSpy).toHaveBeenCalledWith(ORG, expect.any(Object));
});
...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/script/check-fragments.ts</path>
<type>file</type>
<content>
220: function findDefaultInRouteMap(target: RouteMap): string | undefined {
221: if (!target.getDefaultCommand) {
222: return;
223: }
224: const defaultCmd = target.getDefaultCommand();
225: if (!defaultCmd) {
226: return;
227: }
228: for (const sub of target.getAllEntries()) {
229: if (sub.target === defaultCmd) {
230: return sub.name.original;
231: }
232: }
233: return;
234: }
235:
236: /**
237: * Extract the default command name for a route by inspecting the Stricli route map.
238: * Returns the default command name (e.g., "serve" for `local`) or undefined.
239: */
240: function getDefaultCommandName(routeName: string): string | undefined {
241: for (const entry of routeMap.getAllEntries()) {
242: if (entry.name.original !== routeName) {
243: continue;
244: }
245: return findDefaultInRouteMap(entry.target ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/script/generate-command-docs.ts</path>
<type>file</type>
<content>
380: return await readFile(`${FRAGMENTS_DIR}/${fragmentName}.md`, "utf-8");
381: } catch {
382: return "";
383: }
384: }
385:
386: /**
387: * Read hand-written custom content from a top-level fragment file.
388: * Top-level fragments live in docs/src/fragments/ (not the commands/ subdirectory).
389: * Returns empty string if the fragment file doesn't exist.
390: */
391: async function readTopLevelFragment(fragmentName: string): Promise<string> {
392: try {
393: return await readFile(`${FRAGMENTS_ROOT}/${fragmentName}.md`, "utf-8");
394: } catch {
395: return "";
396: }
397: }
398:
399: // ---------------------------------------------------------------------------
400: // Main
401: // ---------------------------------------------------------------------------
402:
403: const routeMap = routes as unknown as RouteMap;
404: const ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/test/script/generate-skill-markdown.test.ts</path>
<type>file</type>
<content>
1: /** Tests for generated command-heading and example association parsing. */
2:
3: import { readFile } from "node:fs/promises";
4: import { describe, expect, test } from "vitest";
5: import {
6: extractCommandPathFromHeading,
7: formatCommandExamples,
8: matchExampleToCommand,
9: } from "../../script/generate-skill-markdown.js";
10: import { listCommand } from "../../src/commands/agent-conversation/list.js";
11: import { viewCommand } from "../../src/commands/agent-conversation/view.js";
12: import { buildCommandInfo } from "../../src/lib/introspect.js";
13:
14: describe("extractCommandPathFromHeading", () => {
15: test.each([
16: ["`sentry issue view <issue-id>`", "sentry issue view"],
17: [
18: "`sentry project create [<org>/]<name>:<platform>...`",
19: "sentry project create",
20: ],
21: ["`sentry auth ...
> sentry@0.45.0-dev.0 tsx /home/byk/Code/getsentry/cli-pr-1558/packages/cli
> tsx --env-file-if-exists=.env.local --import ./script/require-shim.mjs -e 'import {listCommand} from "./src/commands/agent-conversation/list.ts"; import {viewCommand} from "./src/commands/agent-conversation/view.ts"; console.log(JSON.stringify({list:(listCommand as any).__primaryUsage,view:(viewCommand as any).__primaryUsage,listExamples:(listCommand as any).__examples?.length}))'
.env.local not found. Continuing without it.
.env.local not found. Continuing without it.
{"view":"[<org>/]<conversation-id>","listExamples":5}
Found 6 matches
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/script/generate-skill.ts:
Line 28: formatCommandExamples,
Line 598: const examples = formatCommandExamples(cmd.examples);
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/script/generate-skill-markdown.ts:
Line 40: export function formatCommandExamples(examples: readonly string[]): string {
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/script/generate-command-docs.ts:
Line 28: import { formatCommandExamples } from "./generate-skill-markdown.js";
Line 212: const examples = formatCommandExamples(cmd.examples);
Line 234: function generatePage(route: RouteInfo): string {
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/script/generate-command-docs.ts</path>
<type>file</type>
<content>
165: /** Format flags as a markdown options table */
166: function formatFlagsTable(
167: flags: FlagInfo[],
168: aliases: Record<string, string>
169: ): string {
170: if (flags.length === 0) {
171: return "";
172: }
173:
174: const lines: string[] = [];
175: lines.push("**Options:**");
176: lines.push("");
177: lines.push("| Option | Description |");
178: lines.push("|--------|-------------|");
179: for (const flag of flags) {
180: lines.push(formatFlagRow(flag, aliases));
181: }
182: return lines.join("\n");
183: }
184:
185: // ---------------------------------------------------------------------------
186: // Page Generation
187: // ---------------------------------------------------------------------------
188:
189: /** Generate the auto-generated reference section for a single command */
190: function ...
DEPRECATED `test.poolOptions` was removed in Vitest 4. All previous `poolOptions` are now top-level options. Please, refer to the migration guide: https://vitest.dev/guide/migration#pool-rework RUN v4.1.10 /home/byk/Code/getsentry/cli-pr-1558/packages/cli [debug] [compat-flags] --org flag → SENTRY_ORG=my-org [debug] [compat-flags] --project flag → SENTRY_PROJECT=my-proj [debug] [compat-flags] --org flag → SENTRY_ORG=my-org [debug] [compat-flags] --project flag → SENTRY_PROJECT=my-proj [debug] [compat-flags] --org flag → SENTRY_ORG=new [debug] [compat-flags] --org flag → SENTRY_ORG=my-org [debug] [compat-flags] --project flag → SENTRY_PROJECT=my-proj [debug] [compat-flags] --org flag → SENTRY_ORG=my-org [debug] [compat-flags] --project flag → SENTRY_PROJECT=my-project [debug] [compat-flags] --org flag → SENTRY_ORG=new-org [debug] [compat-flags] --org flag → SENTRY_ORG=sentry [debug] [compat-flags] --project flag → SENTRY_PROJECT=cli [debug] [compat-flags] --org flag → ...
(no output)
diff --git a/packages/cli/script/check-fragments.ts b/packages/cli/script/check-fragments.ts
index 36db22e1d..6384a649d 100644
--- a/packages/cli/script/check-fragments.ts
+++ b/packages/cli/script/check-fragments.ts
@@ -186,128 +186,131 @@ function fragmentMentionsSubcommand(
const proseOnly = stripCodeBlocks(content);
const escapedLeaf = leaf.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
const headingRe = new RegExp(`^#{1,4}\\s+.*\\b${escapedLeaf}\\b`, "im");
if (headingRe.test(proseOnly)) {
return true;
}
return false;
}
/**
* Build a map of route name → RouteInfo for routes with multiple subcommands.
* Standalone commands (single command matching `sentry <name>`) are skipped
* since there's nothing to check — the fragment covers the whole command. ...
.../src/fragments/commands/agent-conversation.md | 36 ----------- .../plugins/sentry-cli/skills/sentry-cli/SKILL.md | 42 ++++++------- .../skills/sentry-cli/references/alert.md | 6 +- .../sentry-cli/skills/sentry-cli/references/cli.md | 4 +- .../skills/sentry-cli/references/explore.md | 2 +- .../skills/sentry-cli/references/feedback.md | 2 +- .../skills/sentry-cli/references/init.md | 2 +- .../skills/sentry-cli/references/issue.md | 2 +- .../skills/sentry-cli/references/monitor.md | 2 +- .../sentry-cli/skills/sentry-cli/references/org.md | 2 +- .../skills/sentry-cli/references/project.md | 4 +- .../skills/sentry-cli/references/release.md | 4 +- .../skills/sentry-cli/references/replay.md | 2 +- .../skills/sentry-cli/references/repo.md | 2 +- .../skills/sentry-cli/references/team.md | 2 +- .../skills/sentry-cli/references/trace.md | 2 +- ...
...output truncated...
Full output saved to: /home/byk/.local/share/opencode/tool-output/tool_083229402001qjQ2th5pxoipVb
) => AsyncGenerator<unknown, CommandReturn | void, undefined>;
/**
* Arguments for building a command with a local function.
* This is the subset of Stricli's CommandBuilderArguments that we support.
*/
type LocalCommandBuilderArguments<
FLAGS extends BaseFlags,
ARGS extends BaseArgs,
CONTEXT extends CommandContext,
> = {
readonly parameters?: Record<string, unknown>;
readonly docs: CommandDocumentation;
readonly func: SentryCommandFunction<FLAGS, ARGS, CONTEXT>;
/**
* Output configuration — controls flag injection and auto-rendering.
*
* When provided, `--json` and `--fields` flags are injected automatically.
* The command yields `new CommandOutput(data)` and the wrapper handles
* JSON/human branching. Void yields are ignored. ...
Skill "repo-setup" not found. Available skills: ast-grep, customize-opencode, jj-create-pr, jj-guide, jj-update-pr, jj-workflow, sentry-cli
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/command.ts</path> <type>file</type> <content> 1: /** 2: * Command builder with telemetry, global flag injection, and output modes. 3: * 4: * Provides `buildCommand` — the standard command builder for all Sentry CLI 5: * commands. It wraps Stricli's `buildCommand` with: 6: * 7: * 1. **Automatic flag/arg telemetry** — captures flag values and positional 8: * arguments as Sentry span context for observability. 9: * 10: * 2. **Hidden global logging flags** — injects `--log-level` and `--verbose` 11: * into every command's parameters. These are intercepted before the original 12: * `func` runs: the logger level is set, and the injected flags are stripped 13: * so the original function never sees them. If a command already defines its 14: * own `--verbose` flag (e.g. `api` uses it for HTTP output), the injected 15: * one is skipped and the command's own value is used for both purposes. ...
Found 8 matches
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/command.ts:
Line 417: * Appends available field names and types to `fullDescription` so they appear
Line 433: const baseFull = docs.fullDescription ?? docs.brief;
Line 436: fullDescription: `${baseFull}\n\n${jsonFieldsDoc}`,
Line 454: fullDescription: `${nativeDocs.fullDescription ?? nativeDocs.brief}\n\nExamples:\n${renderedExamples}`,
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/introspect.ts:
Line 37: fullDescription?: string;
Line 46: fullDescription?: string;
Line 105: fullDescription?: string;
Line 298: fullDescription: cmd.fullDescription,
Found 5 matches
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/commands/agent-conversation/view.ts:
Line 61: docs: {
Line 68: examples: [
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/commands/agent-conversation/list.ts:
Line 112: docs: {
Line 117: examples: [
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/commands/agent-conversation/index.ts:
Line 17: docs: {
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/commands/agent-conversation/list.ts</path>
<type>file</type>
<content>
95: const items =
96: fields && fields.length > 0
97: ? result.conversations.map((c) => filterFields(c, fields))
98: : result.conversations;
99:
100: const envelope: Record<string, unknown> = {
101: data: items,
102: hasMore: result.hasMore,
103: hasPrev: !!result.hasPrev,
104: };
105: if (result.nextCursor) {
106: envelope.nextCursor = result.nextCursor;
107: }
108: return envelope;
109: }
110:
111: export const listCommand = buildListCommand("agent-conversation", {
112: docs: {
113: brief: "List recent agent conversations",
114: fullDescription:
115: "List recent agent conversations from a Sentry organization.\n\n" +
116: "The organization is auto-detected when omitted.",
117: examples: [
118: {
119: description: "List recent agent conversations",
120: command: ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/commands/agent-conversation/view.ts</path>
<type>file</type>
<content>
45: conversationId: string;
46: } {
47: const trimmed = target.trim();
48: const slashIdx = trimmed.indexOf("/");
49: if (slashIdx === -1) {
50: return { conversationId: trimmed };
51: }
52: const org = trimmed.slice(0, slashIdx);
53: const conversationId = trimmed.slice(slashIdx + 1);
54: if (!(org && conversationId)) {
55: throw new ContextError("Conversation ID", USAGE_HINT, []);
56: }
57: return { org, conversationId };
58: }
59:
60: export const viewCommand = buildCommand({
61: docs: {
62: brief: "View an agent conversation transcript",
63: customUsage: [USAGE],
64: fullDescription:
65: "View the full transcript of an agent conversation.\n\n" +
66: "The org is optional and auto-detected from your project context when\n" +
67: "omitted. Prefix the ID with an org slug to target a specific ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/commands/agent-conversation/list.ts</path>
<type>file</type>
<content>
1: /**
2: * sentry agent-conversation list
3: *
4: * List recent agent conversations from Sentry projects.
5: */
6:
7: import type { SentryContext } from "../../context.js";
8: import { listConversations } from "../../lib/api-client.js";
9: import { validateLimit } from "../../lib/arg-parsing.js";
10: import {
11: advancePaginationState,
12: buildPaginationContextKey,
13: hasPreviousPage,
14: resolveCursor,
15: } from "../../lib/db/pagination.js";
16: import { ContextError } from "../../lib/errors.js";
17: import { formatConversationTable } from "../../lib/formatters/conversation.js";
18: import { filterFields } from "../../lib/formatters/json.js";
19: import { CommandOutput } from "../../lib/formatters/output.js";
20: import { getPositionalString } from "../../lib/introspect.js";
21: import {
22: buildListCommand,
23: ...
No files found
<path>/home/byk/Code/getsentry/cli-pr-1558/apps/cli-docs/src/fragments/commands/agent-conversation.md</path> <type>file</type> <content> (End of file - total 0 lines) </content>
diff --git a/packages/cli/src/commands/agent-conversation/list.ts b/packages/cli/src/commands/agent-conversation/list.ts
index 555b1f677..806842e71 100644
--- a/packages/cli/src/commands/agent-conversation/list.ts
+++ b/packages/cli/src/commands/agent-conversation/list.ts
@@ -1,39 +1,40 @@
/**
* sentry agent-conversation list
*
* List recent agent conversations from Sentry projects.
*/
import type { SentryContext } from "../../context.js";
import { listConversations } from "../../lib/api-client.js";
import { validateLimit } from "../../lib/arg-parsing.js";
import {
advancePaginationState,
buildPaginationContextKey,
hasPreviousPage,
resolveCursor,
} from "../../lib/db/pagination.js";
import { ContextError } from "../../lib/errors.js";
import { formatConversationTable } from "../../lib/formatters/conversation.js";
import { filterFields } from "../../lib/formatters/json.js";
import { CommandOutput } from "../../lib/formatters/output.js";
+import { ...
Found 100 matches (more matches available)
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/test/lib/introspect.test.ts:
Line 212: fullDescription: "List all the things.",
Line 234: expect(info.fullDescription).toBe("List all the things.");
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/introspect.ts:
Line 37: fullDescription?: string;
Line 46: fullDescription?: string;
Line 105: fullDescription?: string;
Line 298: fullDescription: cmd.fullDescription,
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/commands/trial/start.ts:
Line 81: fullDescription:
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/commands/trial/list.ts:
Line 202: fullDescription:
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/commands/trial/index.ts:
Line 12: fullDescription:
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/commands/trace/view.ts:
Line 470: ...
Found 14 matches
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/help.ts:
Line 103: const brief = entry.target.brief;
Line 115: description: brief,
Line 119: // Direct command - use any public syntax override before raw parameters
Line 123: getPositionalString(entry.target.parameters.positional);
Line 127: description: brief,
Line 133: description: brief,
Line 197: const desc = v.briefDescription ?? v.description.split("\n")[0] ?? "";
Line 274: brief: string;
Line 321: brief: v.briefDescription ?? v.description.split("\n")[0] ?? "",
Line 682: if (flag.brief) {
Line 683: parts.push(flag.brief);
Line 699: lines.push(` ${cmd.brief}`);
Line 730: lines.push(` ${group.brief}`);
Line 749: lines.push(` ${subName(cmd).padEnd(maxName + 2)}${cmd.brief}`);
Found 52 matches /home/byk/Code/getsentry/cli-pr-1558/packages/cli/test/lib/command.test.ts: Line 5: * Uses Stricli's run() to invoke commands end-to-end, verifying the wrapper Line 17: } from "@stricli/core"; Line 52: * Then pass to `run(app, args, ctx as TestContext)`. Line 144: await run(app, testCase.args, ctx as TestContext); Line 289: await run(app, ["test", "--verbose", "--limit", "50"], ctx as TestContext); Line 329: await run(app, ["test"], ctx as TestContext); Line 358: await run(app, ["test"], ctx as TestContext); Line 396: await run(app, ["test", "PROJECT-123"], ctx as TestContext); Line 426: await run(app, ["test"], ctx as TestContext); Line 432: let executed = false; Line 450: executed = true; Line 461: await run(app, ["test", "--delay", "1"], ctx as TestContext); Line 463: expect(executed).toBe(true); Line 595: await run(app, ["test", "--verbose", "--json"], ctx as ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/test/lib/command.test.ts</path>
<type>file</type>
<content>
1: /**
2: * Command Builder Tests
3: *
4: * Tests for the buildCommand wrapper that adds automatic flag telemetry.
5: * Uses Stricli's run() to invoke commands end-to-end, verifying the wrapper
6: * captures flags/args and calls the original function.
7: */
8:
9: import { setTimeout as sleep } from "node:timers/promises";
10: // biome-ignore lint/performance/noNamespaceImport: needed for spyOn mocking
11: import * as Sentry from "@sentry/node-core/light";
12: import {
13: buildApplication,
14: type CommandContext,
15: run,
16: text_en,
17: } from "@stricli/core";
18: import { afterEach, beforeEach, describe, expect, test, vi } from "vitest";
19: import {
20: applyLoggingFlags,
21: applyOrgProjectFlags,
22: buildCommand,
23: FIELDS_FLAG,
24: JSON_FLAG,
25: LOG_LEVEL_FLAG,
26: numberParser,
27: VERBOSE_FLAG,
28: } from ...
No files found
> sentry@0.45.0-dev.0 tsx /home/byk/Code/getsentry/cli-pr-1558/packages/cli
> tsx --env-file-if-exists=.env.local --import ./script/require-shim.mjs -e 'import { buildApplication, run, text_en } from "@stricli/core"; import { buildRouteMap } from "./src/lib/route-map.ts"; import { listCommand } from "./src/commands/agent-conversation/list.ts"; const out:string[]=[]; const err:string[]=[]; const w={write:(s:string)=>{out.push(s);return true}}; const ew={write:(s:string)=>{err.push(s);return true}}; const app=buildApplication(buildRouteMap({routes:{list:listCommand},docs:{brief:"test"}}),{name:"test"}); await run(app,["list","--help"],{process:{stdout:w,stderr:ew},stdout:w,stderr:ew,locale:text_en,commandPrefix:[],cwd:process.cwd()} as any); console.log("OUT\\n"+out.join("")); console.log("ERR\\n"+err.join(""));'
.env.local not found. Continuing without it.
.env.local not found. Continuing without ...
> sentry@0.45.0-dev.0 tsx /home/byk/Code/getsentry/cli-pr-1558/packages/cli
> tsx --env-file-if-exists=.env.local --import ./script/require-shim.mjs -e 'import { buildApplication, run } from "@stricli/core"; import { buildRouteMap } from "./src/lib/route-map.ts"; import { listCommand } from "./src/commands/agent-conversation/list.ts"; const out:string[]=[]; const err:string[]=[]; const w={write:(s:string)=>{out.push(s);return true}}; const ew={write:(s:string)=>{err.push(s);return true}}; const app=buildApplication(buildRouteMap({routes:{list:listCommand},docs:{brief:"test"}}),{name:"test"}); await run(app,["list","--help"],{process:{stdout:w,stderr:ew},stdout:w,stderr:ew,locale:"en",commandPrefix:[],cwd:process.cwd()} as any); console.log("OUT\\n"+out.join("")); console.log("ERR\\n"+err.join(""));'
.env.local not found. Continuing without it.
.env.local not found. Continuing without it. ...
diff --git a/packages/cli/plugins/sentry-cli/skills/sentry-cli/SKILL.md b/packages/cli/plugins/sentry-cli/skills/sentry-cli/SKILL.md index 8422018c2..66569f927 100644 --- a/packages/cli/plugins/sentry-cli/skills/sentry-cli/SKILL.md +++ b/packages/cli/plugins/sentry-cli/skills/sentry-cli/SKILL.md @@ -357 +357 @@ Work with Sentry organizations -- `sentry org view <org>` — View details of an organization +- `sentry org view [<org>]` — View details of an organization @@ -367,2 +367,2 @@ Work with Sentry projects -- `sentry project list <org/project>` — List projects -- `sentry project view <org/project>` — View details of a project +- `sentry project list [<org/project>]` — List projects +- `sentry project view [<org/project>]` — View details of a project @@ -376 +376 @@ Manage Sentry issues -- `sentry issue list <org/project>` — List issues in a project +- `sentry issue list [<org/project>]` — List issues in a project @@ -410 +410 @@ Manage Sentry alert rules -- `sentry alert issues list ...
diff --git a/packages/cli/src/lib/introspect.ts b/packages/cli/src/lib/introspect.ts
index bf8c94f25..670b490d9 100644
--- a/packages/cli/src/lib/introspect.ts
+++ b/packages/cli/src/lib/introspect.ts
@@ -1,378 +1,388 @@
/**
* Route Tree Introspection
*
* Shared module for extracting structured metadata from Stricli's route tree.
* Used at runtime by `sentry help --json` and at build time by `generate-skill.ts`.
*
* While @stricli/core exports RouteMap and Command types, they require complex
* generic parameters (CommandContext) and don't export internal types like
* RouteMapEntry or FlagParameter. These simplified types are purpose-built
* for introspection and documentation generation.
*/
+import type { CommandExample } from "./command.js";
import {
extractSchemaFields,
type SchemaFieldInfo,
} from "./formatters/output.js";
import { fuzzyMatch } from "./fuzzy.js";
// ---------------------------------------------------------------------------
// ...
Found 2 matches /home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/commands/project/create.ts: Line 609: customUsage: ["[<org>/]<name>:<platform>..."], /home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/commands/agent-conversation/view.ts: Line 63: customUsage: [USAGE],
Found 13 matches
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/test/script/generate-skill-markdown.test.ts:
Line 43: (listCommand as unknown as { __primaryUsage?: string }).__primaryUsage
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/test/lib/introspect.test.ts:
Line 250: __primaryUsage: "<name>:<kind>...",
Line 274: const cmd = makeCommand({ __examples: examples });
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/test/lib/command.test.ts:
Line 200: (command as unknown as { __primaryUsage?: string }).__primaryUsage
Line 222: expect((command as unknown as { __examples?: unknown }).__examples).toEqual(
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/help.ts:
Line 122: entry.target.__primaryUsage ??
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/command.ts:
Line 466: metadata.__primaryUsage =
Line 470: metadata.__examples = ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/help.ts</path>
<type>file</type>
<content>
85: long: "--version",
86: description: "Show version",
87: },
88: ];
89:
90: /**
91: * Generate the commands list dynamically from Stricli's route structure.
92: * This ensures help text stays in sync with actual registered commands.
93: */
94: function generateCommands(): HelpCommand[] {
95: // Cast to our introspection types — Stricli's generic types are compatible
96: const routeMap = routes as unknown as RouteMap;
97: const entries = routeMap.getAllEntries();
98:
99: return entries
100: .filter((entry: RouteMapEntry) => !entry.hidden)
101: .map((entry: RouteMapEntry) => {
102: const routeName = entry.name.original;
103: const brief = entry.target.brief;
104:
105: if (isRouteMap(entry.target)) {
106: // Get visible subcommand names and join with pipes
107: const subEntries = entry.target
108: ...
> sentry@0.45.0-dev.0 check:fragments /home/byk/Code/getsentry/cli-pr-1558/packages/cli
> pnpm tsx script/check-fragments.ts
> sentry@0.45.0-dev.0 tsx /home/byk/Code/getsentry/cli-pr-1558/packages/cli
> tsx --env-file-if-exists=.env.local --import ./script/require-shim.mjs script/check-fragments.ts
.env.local not found. Continuing without it.
.env.local not found. Continuing without it.
1 subcommand coverage warning(s):
⚠ Fragment missing subcommand coverage: ../../apps/cli-docs/src/fragments/commands/proguard.md
Not documented: upload
Hint: add a heading or code example for each (e.g., "sentry proguard upload")
All 37 command fragment files valid (36 routes + index)
All 1 top-level fragment(s) valid
> sentry@0.45.0-dev.0 lint /home/byk/Code/getsentry/cli-pr-1558/packages/cli > biome check --no-errors-on-unmatched --error-on-warnings --max-diagnostics=none ./ Checked 1028 files in 61s. No fixes applied.
* 🔴 [syntax-invariant] (22:25) User reaffirmed that the project platform must always be attached to the project name with `":"`; space-separated forms are forbidden. `packages/cli/test/script/generate-skill-markdown.test.ts` rejects `sentry project create my-new-app javascript-nextjs` and `sentry project create my-org/my-new-app javascript-nextjs`, while requiring `sentry project create web:java…
* 🔴 [repository-state] (22:15) Branch `fix/agent-conversation-reference-root-cause` was checked out; its upstream `origin/pr-1558` was marked `[gone]`. The working tree had 32 modified tracked files: `apps/cli-docs/src/fragments/commands/agent-conversation.md`; `packages/cli/plugins/sentry-cli/skills/sentry-cli/SKILL.md`; references `alert.md`, `cli.md`, `explore.md`, `feedback.md`, `init.md`, `…
Date: September 8, 2026 * 🔴 [test-invariant] (22:12) Property test `extractFlags` in `packages/cli/test/lib/introspect.property.test.ts` asserts it “always returns one FlagInfo per input entry”; it also verifies preservation of every flag name and that boolean flags with undefined `optional` default to `optional=true`. * 🔴 [test-invariant] (22:12) Property test `getPositionalString` asserts tup…
* 🔴 [test-invariant] (22:10) Property test `extractFlags` in `packages/cli/test/lib/introspect.property.test.ts` asserts it “always returns one FlagInfo per input entry”; it also preserves every flag name and defaults boolean flags to `optional=true` when `optional` is undefined. * 🔴 [test-invariant] (22:10) Property test `getPositionalString` asserts tuple parameters “always produces angle-bra…
* 🔴 [code-change] (22:06) `packages/cli/script/check-fragments.ts` now skips fragment subcommand-coverage validation for any command where `cmd.examples.length > 0`; commands with canonical examples in metadata no longer need a matching heading or CLI reference in the hand-written route fragment. * 🔴 [documentation-decision] (22:06) Generated command pages now treat auto-generated reference and…
* 🔴 [technical-directive] (22:04) `--fields` is always injected when `output: { human: ... }` is configured, even when a command already owns its `json` flag. * 🔴 [technical-directive] (22:04) Flags in `ALWAYS_STRIP` are always stripped so the command function never sees them; `ALWAYS_STRIP` currently contains `LOG_LEVEL_KEY`. * 🔴 [technical-directive] (22:04) `buildListCommand()` must always …
* 🔴 [validation-result] (21:59) `pnpm tsx script/check-fragments.ts -- --strict` in `/home/byk/Code/getsentry/cli-pr-1558/packages/cli` failed with exit code 1 because `../../apps/cli-docs/src/fragments/commands/proguard.md` lacked subcommand coverage for `upload`; validator hint was to add a heading or code example such as `sentry proguard upload`. * 🔴 [environment-warning] (21:59) The fragmen…
* 🔴 [code-investigation] (21:57) `packages/cli/script/generate-command-docs.ts` reads command fragments from `${FRAGMENTS_DIR}/${fragmentName}.md` via `readCustomContent()` and top-level fragments from `${FRAGMENTS_ROOT}/${fragmentName}.md` via `readTopLevelFragment()`; both use UTF-8 and return an empty string when reading fails. * 🔴 [code-investigation] (21:57) `packages/cli/script/generate-c…
* 🔴 [code-investigation] (21:49) `packages/cli/src/index.ts` is the library entry point and exposes `createSentrySDK()` as the public API: it calls `createSDKMethods(buildInvoker(options))`, creates `run` via `buildRunner(options)`, and returns `Object.assign(methods, { run })`; it defaults-exports `createSentrySDK`, exports `SentryError`, `SentryOptions`, `SentrySDK`, and `AsyncChannel`, and re…
* 🔴 [code-investigation] (21:48) `packages/cli/script/generate-skill.ts` defines `SKILL_DESCRIPTION` as `"Guide for using the Sentry CLI to interact with Sentry from the command line. Use when the user asks about viewing issues, events, projects, organizations, making API calls, or authenticating with Sentry via CLI."`; preferred `ROUTE_ORDER` is `["help", "auth", "org", "project", "issue", "eve…
* 🔴 [code-investigation] (21:45) `packages/cli/src/lib/introspect.ts` defines non-standard command metadata `__jsonSchema?: import("valibot").GenericSchema`, `__primaryUsage?: string`, and `__examples?: readonly CommandExample[]`; `CommandInfo` includes `examples: string[]`, `fullDescription?: string`, `positionals: PositionalInfo[]`, and optional `jsonFields?: SchemaFieldInfo[]`. * 🔴 [code-inv…
* 🔴 [code-investigation] (21:44) Search for `examples` found 9 matches: `packages/cli/src/lib/introspect.ts` lines 111 (`examples: string[];`), 286 (`examples: string[] = []`), and 301 (`examples: cmd.__examples?.length`); `packages/cli/src/lib/formatters/local.ts` line 270 (`* Output examples:`); `packages/cli/src/lib/errors.ts` lines 520 and 542 (`examples: string[]`); `packages/cli/src/comman…
* 🔴 [code-change] (21:42) Added exported `formatCommandExamples(examples: readonly string[]): string` to `packages/cli/script/generate-skill-markdown.ts`; it returns `""` for an empty list, otherwise renders `**Examples:**` followed by one fenced `bash` block with commands separated by blank lines via `examples.join("\n\n")`. * 🔴 [code-change] (21:42) `packages/cli/script/generate-skill.ts` now…
* 🔴 [enforced-flag-stripping] (21:42) Global flags in `ALWAYS_STRIP` are always stripped before command execution, so the command never sees them; `ALWAYS_STRIP` currently contains `LOG_LEVEL_KEY`. * 🔴 [enforced-fresh-flag] (21:42) Always inject `--fresh` unless the command already defines it; implementation checks `if (!("fresh" in mergedFlags))` and assigns `mergedFlags.fresh = FRESH_FLAG`. *…
Date: Sep 8, 2026 * 🔴 [enforced-async-handling] (21:41) Repository rule: “Always `await` promises in async functions - don't forget to use the return value”; use `async/await` rather than promise chains, handle async errors appropriately, and never use async functions as Promise executors. * 🔴 [enforced-workflow] (21:41) Repository rule reaffirmed: always check `package.json` for the latest scr…
* 🔴 [enforced-workflow] (21:41) Repository instruction: always check `package.json` for the latest scripts. * 🔴 [enforced-dependency-policy] (21:41) All packages must be added to `devDependencies`, never `dependencies`, because everything is bundled at build time via esbuild; CI enforces this with `pnpm run check:deps`. Always add packages with `pnpm add -D <package>` using the `-D` flag. * 🔴 …
Date: Sep 8, 2026 * 🔴 [enforced-workflow] (21:40) Repository instruction in `/home/byk/Code/getsentry/cli-pr-1558/AGENTS.md`: always load the `repo-setup` skill before situation skills. Skills live under `.agents/skills/`, generated from canonical `skills/` by `scripts/sync-skills.mjs`. * 🔴 (21:40) Repository agent pipeline is ordered `triage → explore → plan → implement → review → ship`; `work…
Date: Sep 8, 2026 * 🔴 [requested-review] (21:38) User requested a read-only security and robustness review of uncommitted changes in `/home/byk/Code/getsentry/cli-pr-1558` for PR `#1558`, inspecting the exact working-tree diff against `HEAD` and relevant source/tests. * 🔴 [enforced-workflow] (21:38) User instructed not to edit files or mutate git state during the review. * 🟡 (21:38) Review sco…