Dashboard › cli › Session 0LqkXkB0Snij
0LqkXkB0SnijwlaQBPerform a separate read-only security and abuse-resistance review of the exact current working-tree patch in /home/byk/Code/getsentry/cli-pr-1558. Do not modify any file, branch, commit, index, or VCS state. Context: based on PR #1558 head bbaa7b3b722b87f1bccfe84063269cbbcabe2741. Review ALL changes in git diff, including command-owned example metadata, native Stricli help rendering, introspection, generated website/skill Markdown, fragment validation, and generated skill artifacts. Focus on Markdown/code-fence injection, terminal/control-sequence injection, untrusted metadata boundaries, command execution implications, structured JSON compatibility, information disclosure, and whether widened shared documentation types create dangerous runtime behavior. Verify against actual code. You may run read-only checks but never edit. Report findings first with severity and exact file:line evidence. Classify each as PASS, CONCERN, or MUST-FIX. If no security defects, state PASS explicitly and note residual risks. End exactly MERGE or DO-NOT-MERGE. Return a substantive report even if no findings.
I’ll verify the immutable base and working-tree state, inspect every changed file and its consumers, then run read-only focused checks. I will not alter files or VCS state.
<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/CONTRIBUTING.md
/home/byk/Code/getsentry/cli-pr-1558/AGENTS.md /home/byk/Code/getsentry/cli-pr-1558/packages/cli/AGENTS.md
No files found
<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/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/CONTRIBUTING.md</path> <type>file</type> <content> 1: # Contributing to Sentry CLI 2: 3: This guide documents the patterns and conventions used in this CLI for consistency. 4: 5: ## Command Patterns 6: 7: We follow [gh CLI](https://cli.github.com/) conventions for best-in-class developer experience. 8: 9: ### List Commands 10: 11: List commands use **optional positional arguments** for context with smart auto-detection. 12: 13: ```bash 14: sentry org list [--limit N] [--json] 15: sentry project list [org] [--limit N] [--json] 16: sentry issue list [<org>/<project>] [--json] 17: ``` 18: 19: **Target syntax**: 20: - `<org>/<project>` - Explicit organization and project (e.g., `my-org/frontend`) 21: - `<org>/` - All projects in the specified organization 22: - `<project>` - Search for project by name across all accessible organizations 23: - *(omit)* - Auto-detect from DSN or config 24: 25: **Rationale**: Positional ...
<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: ...
Found 6 matches /home/byk/Code/getsentry/cli-pr-1558/.lore.md: Line 26: * **check-fragments.ts: validates fragment files against actual route names**: \`script/check-fragments.ts\`: validates fragment files against actual route names (Check 1-4) AND validates subcommand coverage within fragments (Check 5). Check 5: for each route with >1 command, verifies fragment mentions each subcommand via a heading (outside fenced code blocks) or \`sentry \<route> \<subcommand>\` code reference. Default commands handled: if fragment contains bare \`sentry \<route>\`, the default command is covered. Default commands detected from route map (\`defaultCommand\` field in route index files). Fenced code block content stripped before heading scan to avoid false positives from bash comments. Warnings by default; \`--strict\` makes them errors. Run via \`pnpm run check:fragments\`. CI \`check-generated\` job triggers when \`changes.outputs.skill == 'true'\`. ...
<path>/home/byk/Code/getsentry/cli-pr-1558/.lore.md</path> <type>file</type> <content> 300: * **WASM SQLite bind spread**: Trap: passing a bind-parameter array directly to the WASM SQLite driver looks equivalent to native SQLite APIs, but this driver expects positional parameters as spread arguments. Fix: always call the bind/execute API with spread syntax, because otherwise parameters are interpreted as one value or fail to bind correctly. 301: 302: <!-- lore:019ef451-ed70-7f31-8c53-25977aa838b8 --> 303: * **wasm-pack test never tests the published package — builds its own glue instead**: Trap: \`wasm-pack test --node\` looks like a complete test of the WASM package — it runs Rust tests compiled to WASM. But it builds its own JS glue and never loads the \`--target web\` artifact. So \`export class Object\` shadowing the JS global \`Object\` passes all wasm-pack tests. ...
<path>/home/byk/Code/getsentry/cli-pr-1558/.git</path> <type>file</type> <content> 1: gitdir: /home/byk/Code/getsentry/cli/.git/worktrees/cli-pr-1558 (End of file - total 1 lines) </content>
## 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 ...
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 ...
<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: ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/command.ts</path> <type>file</type> <content> 70: /** 71: * Parse a string input as a number. 72: * Re-exported from Stricli for convenience. 73: */ 74: export const numberParser = stricliNumberParser; 75: 76: /** Base flags type from Stricli */ 77: type BaseFlags = Readonly<Partial<Record<string, unknown>>>; 78: 79: /** Base args type from Stricli */ 80: type BaseArgs = readonly unknown[]; 81: 82: /** 83: * Type-erased Stricli builder arguments. 84: * 85: * At the `stricliCommand()` call site we've modified both `parameters` 86: * (injected hidden flags) and `func` (wrapped with telemetry/output 87: * logic), which breaks the original `FLAGS`/`ARGS` generic alignment 88: * that Stricli's `CommandBuilderArguments` enforces via `NoInfer`. ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/command.ts</path>
<type>file</type>
<content>
458: /** Retain extended documentation fields that Stricli does not expose. */
459: function attachDocumentationMetadata(
460: command: unknown,
461: docs: CommandDocumentation
462: ): void {
463: const metadata = command as Record<string, unknown>;
464: const primaryUsage = docs.customUsage?.[0];
465: if (primaryUsage) {
466: metadata.__primaryUsage =
467: typeof primaryUsage === "string" ? primaryUsage : primaryUsage.input;
468: }
469: if (docs.examples?.length) {
470: metadata.__examples = docs.examples;
471: }
472: }
473:
474: /**
475: * Global flag defaults keyed by flag name.
476: * Used by {@link mergeGlobalFlags} to inject flags when the command
477: * doesn't define its own. ...
<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/introspect.ts</path>
<type>file</type>
<content>
381: }
382:
383: return result;
384: }
385:
386: /** Matches the "sentry " prefix at the start of a command path. */
387: const SENTRY_PREFIX_RE = /^sentry /;
388:
389: /** Maximum number of fuzzy suggestions to include in an UnresolvedPath. */
390: const MAX_SUGGESTIONS = 3;
391:
392: /**
393: * Resolve a command path through the route tree.
394: *
395: * Navigates the tree using the provided path segments:
396: * - Single segment (e.g. ["issue"]) → returns the route group if it's a RouteMap,
397: * or the command if it's a standalone command
398: * - Two segments (e.g. ["issue", "list"]) → returns the specific subcommand
399: *
400: * When a segment doesn't match, returns an {@link UnresolvedPath} with
401: * fuzzy-matched suggestions from the available routes at that level. ...
Found 28 matches
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/command.ts:
Line 469: if (docs.examples?.length) {
Line 470: metadata.__examples = docs.examples;
Line 709: const { introspectCommand, formatHelpHuman } = await import("./help.js");
Line 710: const result = introspectCommand(pathSegments);
Line 719: stdout.write(`${formatHelpHuman(result)}\n`);
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/introspect.ts:
Line 111: examples: string[];
Line 289: examples: string[] = []
Line 304: examples: cmd.__examples?.length
Line 356: export function extractAllRoutes(routeMap: RouteMap): RouteInfo[] {
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/commands/help.ts:
Line 16: formatHelpHuman,
Line 18: introspectCommand,
Line 31: human: formatHelpHuman,
Line 49: // formatHelpHuman (human output only), so `--json` never triggers the
Line 56: const result = ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/commands/help.ts</path>
<type>file</type>
<content>
1: /**
2: * Help Command
3: *
4: * Provides help information for the CLI.
5: * - `sentry help` or `sentry` (no args): Shows branded help with banner
6: * - `sentry help <command>`: Shows detailed help for that command
7: * - `sentry help --json`: Emits full command tree as structured JSON
8: * - `sentry help --json <command>`: Emits specific command/group metadata as JSON
9: */
10:
11: import type { SentryContext } from "../context.js";
12: import { buildCommand } from "../lib/command.js";
13: import { OutputError } from "../lib/errors.js";
14: import { CommandOutput } from "../lib/formatters/output.js";
15: import {
16: formatHelpHuman,
17: introspectAllCommands,
18: introspectCommand,
19: } from "../lib/help.js";
20:
21: export const helpCommand = buildCommand({
22: auth: false,
23: docs: {
24: brief: "Display help for a command",
25: ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/help.ts</path>
<type>file</type>
<content>
330: *
331: * Exposes the same entries shown in the branded help so that consumers
332: * (AI agents, docs tooling) can discover them programmatically.
333: */
334: function buildCommonFlags(): HelpFlagInfo[] {
335: return COMMON_FLAGS.map((f) => ({
336: long: f.long,
337: short: f.short,
338: description: f.description,
339: }));
340: }
341:
342: /**
343: * Introspect the full command tree.
344: * Returns all visible routes with all flags included, plus the top-level
345: * environment variables and common flags recognized by the CLI. ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/help.ts</path>
<type>file</type>
<content>
620: ): number {
621: const token = inputs[index] ?? "";
622: if (token.startsWith("--fields=")) {
623: assign(parseFieldsList(token.slice("--fields=".length)));
624: return index;
625: }
626: const next = inputs[index + 1];
627: if (next !== undefined && !next.startsWith("-")) {
628: assign(parseFieldsList(next));
629: return index + 1;
630: }
631: return index;
632: }
633:
634: // ---------------------------------------------------------------------------
635: // Suggestion Formatting
636: // ---------------------------------------------------------------------------
637:
638: /**
639: * Join suggestion strings with Oxford-comma grammar. ...
Found 7 matches
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/app.ts:
Line 3: buildApplication,
Line 22: import { docsRoute } from "./commands/docs/index.js";
Line 123: docs: docsRoute,
Line 174: docs: {
Line 410: export const app = buildApplication(routes, {
Line 428: documentation: {
Line 434: renderHelp: ({ prefix, unprocessedInputs }) =>
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/app.ts</path>
<type>file</type>
<content>
400: const prefix = ansiColor ? errorColor("Error:") : "Error:";
401: return `${prefix} ${exc.format()}`;
402: }
403: if (exc instanceof Error) {
404: return `Unexpected error: ${exc.stack ?? exc.message}`;
405: }
406: return `Unexpected error: ${stringifyUnknown(exc)}`;
407: },
408: };
409:
410: export const app = buildApplication(routes, {
411: name: "sentry",
412: versionInfo: {
413: currentVersion: CLI_VERSION,
414: },
415: scanner: {
416: caseStyle: "allow-kebab-for-camel",
417: // Allow `--` to stop flag parsing so wrapper commands (e.g.
418: // `sentry monitor run <slug> -- <command>`) can pass through flags
419: // like `-e` or `--verbose` to the wrapped command unambiguously. ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/script/generate-command-docs.ts</path>
<type>file</type>
<content>
1: #!/usr/bin/env tsx
2: /**
3: * Generate Command Reference & Configuration Documentation
4: *
5: * Introspects the CLI's route tree and env var registry to generate
6: * accurate reference pages for the documentation website. Flags, arguments,
7: * aliases, and environment variables are extracted directly from source code,
8: * preventing documentation drift.
9: *
10: * Each generated page combines:
11: * 1. Auto-generated reference and examples from CLI metadata or env registry
12: * 2. Hand-written guides and tips from docs/src/fragments/
13: *
14: * The generated output is gitignored. Fragment files are the committed
15: * source of truth for content that cannot live in command definitions.
16: *
17: * Usage:
18: * tsx script/generate-command-docs.ts
19: *
20: * Output:
21: * docs/src/content/docs/commands/{route}.md (one per ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/script/generate-command-docs.ts</path>
<type>file</type>
<content>
285: // ---------------------------------------------------------------------------
286: // Index Table Generation
287: // ---------------------------------------------------------------------------
288:
289: /**
290: * Generate the commands table for index.md.
291: * Uses the route order from extractAllRoutes() (which preserves the
292: * insertion order from app.ts's buildRouteMap) — no manual constant needed.
293: */
294: function generateCommandsTable(allRoutes: RouteInfo[]): string {
295: const lines: string[] = [];
296: lines.push("| Command | Description |");
297: lines.push("|---------|-------------|");
298: for (const route of allRoutes) {
299: lines.push(`| [\`${route.name}\`](./${route.name}/) | ${route.brief} |`);
300: }
301: return lines.join("\n");
302: }
303:
304: // ...
<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-skill.ts</path>
<type>file</type>
<content>
1: #!/usr/bin/env tsx
2: /**
3: * Generate Skill Files from Stricli Command Metadata and Docs
4: *
5: * Introspects the CLI's route tree and merges with documentation
6: * to generate structured documentation for AI agents.
7: *
8: * Produces:
9: * - SKILL.md: compact index with agent guidance + command summaries
10: * - references/*.md: full per-route command documentation
11: * - index.json: skill discovery manifest for .well-known
12: *
13: * Usage:
14: * tsx script/generate-skill.ts
15: *
16: * Output:
17: * plugins/sentry-cli/skills/sentry-cli/SKILL.md
18: * plugins/sentry-cli/skills/sentry-cli/references/*.md
19: * docs/public/.well-known/skills/index.json
20: */
21:
22: import { existsSync, mkdirSync, rmSync, writeFileSync } from "node:fs";
23: import { access, readFile, writeFile } from "node:fs/promises";
24: import type { Token ...
Found 18 matches
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/script/generate-skill.ts:
Line 22: import { existsSync, mkdirSync, rmSync, writeFileSync } from "node:fs";
Line 23: import { access, readFile, writeFile } from "node:fs/promises";
Line 43: writeFileSync(
Line 45: "export const SKILL_FILES: ReadonlyMap<string, string> = new Map();\n"
Line 108: const CODE_BLOCK_REGEX = /```(\w*)\n([\s\S]*?)```/g;
Line 188: const pattern = new RegExp(CODE_BLOCK_REGEX.source, CODE_BLOCK_REGEX.flags);
Line 417: async function loadCommandExamples(
Line 442: async function loadCommandsOverview(): Promise<{
Line 488: const docExamples = await loadCommandExamples(
Line 496: commands: extractRouteGroupCommands(target, routeName, docExamples),
Line 500: const examples = docExamples.get(path) ?? [];
Line 566: function generateFullCommandDoc(cmd: CommandInfo): string {
Line 657: lines.push(generateFullCommandDoc(cmd));
Line 726: ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/script/generate-skill.ts</path>
<type>file</type>
<content>
360: examples.set(cmdPath, []);
361: }
362: }
363: }
364: return paths;
365: }
366:
367: /**
368: * Walk tokens sequentially and associate each bash code block with
369: * the appropriate command path — either by heading context or content matching.
370: */
371: function associateCodeBlocks(
372: tokens: Token[],
373: context: {
374: commandPaths: string[];
375: commandGroup: string;
376: examples: Map<string, string[]>;
377: defaultCommandPath?: string;
378: }
379: ): void {
380: const { commandPaths, commandGroup, examples, defaultCommandPath } = context;
381: const groupFallback = `sentry ${commandGroup}`;
382: let currentCmd: string | null = null;
383:
384: for (const token of tokens) {
385: if (token.type === "heading" && token.depth === 3) {
386: currentCmd = ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/script/generate-skill.ts</path>
<type>file</type>
<content>
240: if (codeBlocks.length > 0 || npmCommand) {
241: lines.push("```bash");
242: for (const block of codeBlocks) {
243: lines.push(block.code);
244: }
245: if (npmCommand) {
246: if (codeBlocks.length > 0) {
247: lines.push("");
248: lines.push("# Or install via npm/pnpm/bun");
249: }
250: lines.push(npmCommand);
251: }
252: lines.push("```");
253: }
254: return lines;
255: }
256:
257: /** Generate authentication section from docs content */
258: function generateAuthSection(authSection: string): string[] {
259: const lines: string[] = [];
260: lines.push("### Authentication");
261: lines.push("");
262: const codeBlocks = extractCodeBlocks(authSection, "bash");
263: if (codeBlocks.length > 0) {
264: lines.push("```bash");
265: for (const block of codeBlocks) {
266: ...
<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 ...
Found 27 matches
/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/team/list.ts:
Line 79: export const listCommand = buildOrgListCommand(teamListConfig, docs, "team");
/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/repo/list.ts:
Line 78: export const listCommand = buildOrgListCommand(repoListConfig, docs, "repo");
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/commands/replay/list.ts:
Line 250: export const listCommand = buildListCommand("replay", {
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/commands/release/list.ts:
Line 631: export const listCommand = buildListCommand("release", ...
Found 100 matches (more matches available)
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/commands/explore.ts:
Line 622: docs: {
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/commands/trial/start.ts:
Line 79: docs: {
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/commands/log/view.ts:
Line 489: docs: {
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/commands/trial/list.ts:
Line 200: docs: {
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/commands/trial/index.ts:
Line 10: docs: {
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/commands/log/list.ts:
Line 702: docs: {
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/commands/log/index.ts:
Line 17: docs: {
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/commands/event/view.ts:
Line 1056: docs: {
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/commands/trace/view.ts:
Line 468: docs: ...
<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: ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/commands/agent-conversation/view.ts</path>
<type>file</type>
<content>
1: /**
2: * sentry agent-conversation view
3: *
4: * View the transcript of a specific agent conversation.
5: */
6:
7: import type { SentryContext } from "../../context.js";
8: import { getConversationSpans } from "../../lib/api-client.js";
9: import { buildCommand } from "../../lib/command.js";
10: import { ContextError } from "../../lib/errors.js";
11: import {
12: buildTranscriptResult,
13: formatTranscriptResult,
14: type TranscriptResult,
15: } from "../../lib/formatters/conversation.js";
16: import { CommandOutput } from "../../lib/formatters/output.js";
17: import {
18: applyFreshFlag,
19: FRESH_ALIASES,
20: FRESH_FLAG,
21: } from "../../lib/list-command.js";
22: import { withProgress } from "../../lib/polling.js";
23: import { resolveOrg } from "../../lib/resolve-target.js";
24:
25: type ViewFlags = {
26: readonly json: ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/list-command.ts</path>
<type>file</type>
<content>
500: * are async generators — non-streaming commands yield once and return.
501: */
502: type ListCommandFunction<
503: FLAGS extends BaseFlags,
504: ARGS extends BaseArgs,
505: CONTEXT extends CommandContext,
506: > = (
507: this: CONTEXT,
508: flags: FLAGS,
509: ...args: ARGS
510: // biome-ignore lint/suspicious/noConfusingVoidType: void is required here — generators that don't return a value have implicit void return, which is distinct from undefined in TypeScript's type system
511: ) => AsyncGenerator<unknown, CommandReturn | void, undefined>;
512:
513: /**
514: * Options for controlling which flags {@link buildListCommand} auto-injects.
515: *
516: * By default, `buildListCommand` adds `--fresh`, `--cursor`, and their aliases
517: * (`-f`, `-c`). Use these options to opt out when a command has conflicts. ...
<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. ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/mutate-command.ts</path>
<type>file</type>
<content>
389: // biome-ignore lint/suspicious/noExplicitAny: Stricli's CommandFunction type is complex
390: const wrappedFunc = function (this: CONTEXT, flags: FLAGS, ...args: any[]) {
391: // Pre-hook: non-interactive safety guard
392: if (!options?.noNonInteractiveGuard) {
393: guardNonInteractive(
394: flags as unknown as {
395: yes?: boolean;
396: force?: boolean;
397: "dry-run"?: boolean;
398: }
399: );
400: }
401:
402: return originalFunc.call(this, flags, ...(args as unknown as ARGS));
403: } as typeof originalFunc;
404:
405: return buildCommand({
406: ...builderArgs,
407: parameters: mergedParams,
408: func: wrappedFunc,
409: output: builderArgs.output,
410: });
411: }
(End of file - total 411 lines)
</content>
<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 100 matches (more matches available)
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/test/script/generate-skill-markdown.test.ts:
Line 57: "**Examples:**",
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/test/lib/word-boundary.property.test.ts:
Line 196: describe("property: special regex characters are escaped", () => {
Line 197: test("dots in pattern are escaped", () => {
Line 203: test("asterisks in pattern are escaped", () => {
Line 208: test("question marks in pattern are escaped", () => {
Line 213: test("parentheses in pattern are escaped", () => {
Line 214: // Parentheses are escaped (doesn't create regex group)
Line 222: test("brackets in pattern are escaped", () => {
Line 223: // Brackets are escaped (doesn't create character class)
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/test/lib/upgrade.test.ts:
Line 1579: const controller = new AbortController();
Line 1580: controller.abort();
Line ...
No files found
Found 2 matches
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/formatters/local.ts:
Line 772: function formatJsonObservation(
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/formatters/json.ts:
Line 169: export function formatJson<T>(data: T): string {
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/formatters/json.ts</path>
<type>file</type>
<content>
140: return result as Partial<T>;
141: }
142:
143: /**
144: * Parse a comma-separated fields string into a trimmed, deduplicated array.
145: *
146: * Handles whitespace around commas and filters out empty segments:
147: * ```ts
148: * parseFieldsList("id, title , status") // → ["id", "title", "status"]
149: * parseFieldsList("id,,title") // → ["id", "title"]
150: * ```
151: *
152: * @param input - Raw `--fields` flag value
153: * @returns Parsed field path list (may be empty if input is all whitespace/commas)
154: */
155: export function parseFieldsList(input: string): string[] {
156: return [
157: ...new Set(
158: input
159: .split(",")
160: .map((f) => f.trim())
161: .filter(Boolean)
162: ),
163: ];
164: }
165:
166: /**
167: * Format data as pretty-printed JSON
168: */
169: export function ...
Found 9 matches /home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/introspect.ts: Line 111: examples: string[]; Line 289: examples: string[] = [] Line 304: 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/dashboard/widget/index.ts: Line 47: "Row-filling examples:\n" + /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 117: examples: [
<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 ...
<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. ...
/home/byk/Code/getsentry/cli-pr-1558/apps/cli-docs/src/content/docs/commands/agent-conversation.md
<path>/home/byk/Code/getsentry/cli-pr-1558/apps/cli-docs/src/content/docs/commands/agent-conversation.md</path> <type>file</type> <content> 1: --- 2: title: agent-conversation 3: description: Agent-conversation commands for the Sentry CLI 4: --- 5: 6: List and view agent conversations 7: 8: ## Commands 9: 10: ### `sentry agent-conversation list [<org>]` 11: 12: List recent agent conversations 13: 14: **Arguments:** 15: 16: | Argument | Description | 17: |----------|-------------| 18: | `[<org>]` | Organization slug | 19: 20: **Options:** 21: 22: | Option | Description | 23: |--------|-------------| 24: | `-n, --limit <limit>` | Number of conversations (1-1000) (default: "25") | 25: | `-q, --query <query>` | Search query | 26: | `-t, --period <period>` | Time range: "7d", "2026-08-01..2026-09-01", ">=2026-08-01" (default: "7d") | 27: | `-f, --fresh` | Bypass cache, re-detect projects, and fetch fresh data | 28: | `-c, --cursor <cursor>` | Navigate pages: "next", "prev", "first" ...
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/patches/@stricli%2Fcore@1.2.8.patch
<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 ...
checked 17 changed Markdown files; no C0/DEL controls or unbalanced fence counts
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/test/lib/introspect.property.test.ts</path>
<type>file</type>
<content>
1: /**
2: * Property-Based Tests for Route Tree Introspection
3: *
4: * Uses fast-check to verify invariants that should hold for any valid
5: * route tree structure.
6: */
7:
8: import {
9: array,
10: boolean,
11: constantFrom,
12: assert as fcAssert,
13: oneof,
14: property,
15: record,
16: string,
17: tuple,
18: } from "fast-check";
19: import { describe, expect, test } from "vitest";
20: import type {
21: Command,
22: FlagDef,
23: RouteMap,
24: RouteMapEntry,
25: } from "../../src/lib/introspect.js";
26: import {
27: extractAllRoutes,
28: extractFlags,
29: getPositionalString,
30: resolveCommandPath,
31: } from "../../src/lib/introspect.js";
32: import { DEFAULT_NUM_RUNS } from "../model-based/helpers.js";
33:
34: // ---------------------------------------------------------------------------
35: // Arbitraries
36: ...
Found 93 matches /home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/commands/trial/start.ts: Line 98: placeholder: "name", Line 103: placeholder: "org", /home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/commands/trial/list.ts: Line 221: placeholder: "org", /home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/commands/log/view.ts: Line 514: placeholder: "org/project/log-id", /home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/commands/log/list.ts: Line 732: placeholder: "org/project-or-trace-id", /home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/commands/trace/view.ts: Line 486: placeholder: "org/project/trace-id", /home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/commands/trace/logs.ts: Line 132: placeholder: "org/project/trace-id", /home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/commands/trace/list.ts: Line 226: placeholder: ...
Found 11 matches
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/script/generate-skill.ts:
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 212: const examples = formatCommandExamples(cmd.examples);
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/script/check-fragments.ts:
Line 266: if (cmd.examples.length > 0) {
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/command.ts:
Line 470: metadata.__examples = docs.examples;
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/introspect.ts:
Line 64: __examples?: readonly CommandExample[];
Line 304: examples: cmd.__examples?.length
Line 305: ? ...
Found 11 matches
/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;
/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/index.ts
<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 ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/commands/alert/issues/create.ts</path>
<type>file</type>
<content>
60: export const createCommand = buildCommand({
61: docs: {
62: brief: "Create an issue alert rule",
63: fullDescription:
64: "Create a project-scoped issue alert rule. The target may be an explicit " +
65: "<org>/<project>, an auto-detected project, or a bare project search when " +
66: "it resolves to exactly one project.\n\n" +
67: "Required fields:\n" +
68: " --name, --condition (>=1), --action (>=1)\n\n" +
69: "Optional fields:\n" +
70: " --frequency, --environment, --filter, --filter-match, --owner\n\n" +
71: "Conditions and actions are workflow-native JSON (this targets the\n" +
72: "org-scoped workflows endpoint):\n" +
73: " --condition a trigger data-condition: {type, comparison, conditionResult}\n" +
74: " --action an action: {type, data, config}\n" +
75: " ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/commands/trial/start.ts</path>
<type>file</type>
<content>
55: * Also accepted: `<org> <name>` (detected and auto-corrected)
56: *
57: * @returns Parsed name and optional org, plus any warning message
58: */
59: function parseTrialStartArgs(
60: first: string,
61: second?: string
62: ): { name: string; org?: string; warning?: string } {
63: if (!second) {
64: // Single arg — must be a trial name
65: return { name: first };
66: }
67:
68: // Two args — check for swapped order (includes "plan" pseudo-trial)
69: const swapped = detectSwappedTrialArgs(first, second, isValidTrialArg);
70: if (swapped) {
71: return { name: swapped.name, org: swapped.org, warning: swapped.warning };
72: }
73:
74: // Normal order: first=name, second=org
75: return { name: first, org: second };
76: }
77:
78: export const startCommand = buildCommand({
79: docs: {
80: brief: "Start a product trial",
81: ...
checked 32 changed files; no C0/DEL control bytes
/\\x1b/i: 0 /\\u001b/i: 0 /\\033/i: 0 /\]\d+;/: 0 /\$\(/: 0 /`[^`]*`/: 60
checked 37 generated command pages; no C0/DEL controls or unclosed fences
checked 37 skill Markdown files; no C0/DEL controls or unclosed fences
dfcceb584e52de2d477015a74dfe42ac1e26e5f44ede4bf5da2afc9e343179d8 -
website/skill example parity: 2 blocks identical
Found 3 matches /home/byk/Code/getsentry/cli-pr-1558/packages/cli/plugins/sentry-cli/skills/sentry-cli/SKILL.md: Line 459: - `sentry agent-conversation list [<org>]` — List recent agent conversations Line 460: - `sentry agent-conversation view [<org>/]<conversation-id>` — View an agent conversation transcript Line 462: → Full flags and examples: `references/agent-conversation.md`
No files found
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/app.ts</path>
<type>file</type>
<content>
90: const PLURAL_TO_SINGULAR: Record<string, string> = {
91: "agent-conversations": "agent-conversation",
92: dashboards: "dashboard",
93: events: "event",
94: issues: "issue",
95: orgs: "org",
96: platforms: "platform",
97: projects: "project",
98: releases: "release",
99: repos: "repo",
100: teams: "team",
101: logs: "log",
102: monitors: "monitor",
103: replays: "replay",
104:
105: spans: "span",
106: traces: "trace",
107: trials: "trial",
108: };
109:
110: /** Top-level route map containing all CLI commands */
111: export const routes = buildRouteMap({
112: routes: {
113: help: helpCommand,
114: alert: alertRoute,
115: auth: authRoute,
116: build: buildRoute,
117: cli: cliRoute,
118: "code-mappings": codeMappingsRoute,
119: "agent-conversation": conversationRoute,
120: "dart-symbol-map": dartSymbolMapRoute,
121: ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/script/generate-skill.ts</path>
<type>file</type>
<content>
880: return 1;
881: }
882: return a.localeCompare(b);
883: });
884:
885: const index = {
886: skills: [
887: {
888: name: "sentry-cli",
889: description: SKILL_DESCRIPTION,
890: files: fileList,
891: },
892: ],
893: };
894:
895: return `${JSON.stringify(index, null, 2)}\n`;
896: }
897:
898: // ---------------------------------------------------------------------------
899: // Main
900: // ---------------------------------------------------------------------------
901:
902: const files = await generateAllSkillFiles(routes as unknown as RouteMap);
903:
904: // Clean references directory to remove stale files
905: try {
906: rmSync(REFERENCES_DIR, { recursive: true, force: true });
907: } catch {
908: // Directory may not exist yet
909: }
910:
911: // Write all generated files
912: for (const ...
Found 12 matches /home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/generated/skill-content.ts: Line 21: ### \`sentry agent-conversation list [<org>]\` Line 58: sentry agent-conversation list Line 61: sentry agent-conversation list my-org Line 64: sentry agent-conversation list --limit 50 --period 24h Line 67: sentry agent-conversation list -q "has:errors" Line 70: sentry agent-conversation list my-org -c next Line 2308: ### \`sentry org view [<org>]\` Line 2323: sentry org view my-org Line 2326: sentry org view my-org -w Line 3524: - **\`gh\` (GitHub CLI) conventions**: The \`sentry\` CLI uses the same \`<noun> <verb>\` command pattern (e.g., \`sentry issue list\`, \`sentry org view\`). Flags follow \`gh\` conventions: \`--json\` for machine-readable output, \`--fields\` to select specific fields, \`-w\`/\`--web\` to open in browser, \`-q\`/\`--query\` for filtering, \`-n\`/\`--limit\` for result count. ...
embedded skill: bytes=140678, controls=0, escapedTemplateOpeners=0
Found 11 matches /home/byk/Code/getsentry/cli-pr-1558/.gitignore: Line 64: packages/cli/src/generated/ Line 65: packages/cli/src/sdk.generated.ts Line 66: packages/cli/src/sdk.generated.d.cts Line 70: !packages/cli/src/generated/banner-sixel.ts Line 73: apps/cli-docs/src/content/docs/commands/ Line 83: # Throwaway documentation audit reports (bot-generated, not real docs) /home/byk/Code/getsentry/cli-pr-1558/packages/cli/.gitignore: Line 37: # generated files (rebuilt at build time) Line 38: src/generated/ Line 39: src/sdk.generated.ts Line 40: src/sdk.generated.d.cts Line 41: !src/generated/banner-sixel.ts
checked 32 changed files; no bidi controls
checked 32 changed files; no C1 or selected invisible controls
Found 1 matches /home/byk/Code/getsentry/cli-pr-1558/packages/cli/test/script/generate-skill-markdown.test.ts: Line 111: const reference = await readFile(
<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 ...
(no output)
added Markdown lines=42; risky-token lines=0
added TypeScript lines=289; execution/file/network-token lines=0
checked 59 headings across 15 changed references; website/skill signatures match
Found 6 matches
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/agent-skills.ts:
Line 13: import { rename, rm, writeFile } from "node:fs/promises";
Line 16: import { SKILL_FILES } from "../generated/skill-content.js";
Line 62: * frontmatter. A plain in-place `writeFile` truncates the file before
Line 86: await writeFile(tempPath, content, "utf-8");
Line 113: for (const [relativePath, content] of SKILL_FILES) {
Line 152: export async function installAgentSkills(
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/agent-skills.ts</path>
<type>file</type>
<content>
1: /**
2: * Agent skill installation for AI coding assistants.
3: *
4: * Detects supported AI coding agents (currently Claude Code and agents that
5: * use the shared `~/.agents` root) and installs the Sentry CLI skill files
6: * so the agent can use CLI commands effectively.
7: *
8: * Skill file contents are embedded at build time (via a generated module
9: * produced by script/generate-skill.ts), so no network fetch is needed.
10: */
11:
12: import { accessSync, constants, existsSync, mkdirSync } from "node:fs";
13: import { rename, rm, writeFile } from "node:fs/promises";
14: import { basename, dirname, join } from "node:path";
15: import { captureException } from "@sentry/node-core/light";
16: import { SKILL_FILES } from "../generated/skill-content.js";
17:
18: /** Where skills are installed */
19: export type AgentSkillLocation = {
20: /** Path where the ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/commands/init.ts</path>
<type>file</type>
<content>
285: throw new ContextError("Target", String(_exhaustive), []);
286: }
287: }
288: }
289:
290: export const initCommand = buildCommand<
291: InitFlags,
292: [string?, string?],
293: SentryContext
294: >({
295: docs: {
296: brief: "Initialize Sentry in your project (experimental)",
297: fullDescription:
298: "EXPERIMENTAL: This command may modify your source files.\n\n" +
299: "Runs the Sentry setup wizard to detect your project's framework, " +
300: "install the SDK, and configure Sentry.\n\n" +
301: "Supports org/project syntax and a directory positional. Path-like\n" +
302: "arguments (starting with . / ~) are treated as the directory;\n" +
303: "everything else is treated as the target.\n\n" +
304: "Examples:\n" +
305: " sentry init\n" +
306: " sentry init acme/\n" +
307: " sentry ...
checked 8 structured command examples; single-line, fence-free, ESC-free, sentry-prefixed
<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>
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/test/lib/introspect.test.ts</path>
<type>file</type>
<content>
1: /**
2: * Unit Tests for Route Tree Introspection
3: *
4: * Tests the shared introspection module used by `sentry help --json`
5: * and `script/generate-skill.ts`.
6: */
7:
8: import { describe, expect, test } from "vitest";
9: import type {
10: Command,
11: FlagDef,
12: RouteMap,
13: RouteMapEntry,
14: } from "../../src/lib/introspect.js";
15: import {
16: buildCommandInfo,
17: extractAllRoutes,
18: extractFlags,
19: extractRouteGroupCommands,
20: getPositionalString,
21: isCommand,
22: isRouteMap,
23: resolveCommandPath,
24: } from "../../src/lib/introspect.js";
25:
26: // ---------------------------------------------------------------------------
27: // Test fixtures
28: // ---------------------------------------------------------------------------
29:
30: function makeCommand(overrides: Partial<Command> = {}): Command {
31: ...
checked 37 embedded skill entries; byte-identical to Markdown artifacts
Found 1 matches /home/byk/Code/getsentry/cli-pr-1558/packages/cli/test/lib/help.test.ts: Line 5: * command generation from routes, and contextual examples.
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/test/lib/help.test.ts /home/byk/Code/getsentry/cli-pr-1558/packages/cli/test/lib/help-positional.test.ts /home/byk/Code/getsentry/cli-pr-1558/packages/cli/test/lib/help-json.test.ts /home/byk/Code/getsentry/cli-pr-1558/packages/cli/test/commands/help.test.ts /home/byk/Code/getsentry/cli-pr-1558/packages/cli/test/lib/bench/helpers.test.ts
Found 25 matches
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/test/lib/help-json.test.ts:
Line 2: * Unit tests for {@link renderJsonHelp}, the pluggable help renderer wired into
Line 15: renderJsonHelp,
Line 21: describe("renderJsonHelp", () => {
Line 23: expect(renderJsonHelp([APP], [])).toBeUndefined();
Line 24: expect(renderJsonHelp([APP, "issue", "list"], [])).toBeUndefined();
Line 28: const out = renderJsonHelp([APP], ["--json"]);
Line 30: const parsed = JSON.parse(out as string);
Line 37: const out = renderJsonHelp([APP, "issue", "list"], ["--json"]);
Line 38: const parsed = JSON.parse(out as string);
Line 44: const out = renderJsonHelp([APP, "issue", "list"], ["--json"]) as string;
Line 51: const out = renderJsonHelp(
Line 55: const parsed = JSON.parse(out as string);
Line 60: const out = renderJsonHelp(
Line 64: const parsed = JSON.parse(out as string);
Line 69: const out = ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/test/lib/help-json.test.ts</path>
<type>file</type>
<content>
1: /**
2: * Unit tests for {@link renderJsonHelp}, the pluggable help renderer wired into
3: * Stricli's `documentation.renderHelp` hook (see `app.ts`).
4: *
5: * End-to-end behavior through the real `app` (routing + the patch) lives in
6: * `scanner-flags.integration.test.ts`. These tests pin the pure input→output
7: * contract of the renderer: which top-level-flag combinations produce JSON,
8: * how the route prefix maps to introspection, and `--fields` narrowing.
9: */
10:
11: import { describe, expect, test } from "vitest";
12: import {
13: isRecoverableUnknownCommand,
14: isVersionRequest,
15: renderJsonHelp,
16: rewriteHelpJsonToHelpCommand,
17: } from "../../src/lib/help.js";
18:
19: const APP = "sentry";
20:
21: describe("renderJsonHelp", () => {
22: test("returns undefined without --json so text help is used", () => {
23: ...
commands=8; shell-control/destructive-token hits=0
bbaa7b3b722b87f1bccfe84063269cbbcabe2741 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 packages/cli/plugins/sentry-cli/skills/sentry-cli/references/replay.md M ...
PASS — Markdown and code fences: formatCommandExamples() emits raw fenced Bash blocks (packages/cli/script/generate-skill-markdown.ts:39-47), but its inputs come only from repository-owned command metadata (packages/cli/src/commands/agent-conversation/list.ts:117-138, view.ts:68-81). All eight examples are single-line, fence-free, control-free, and non-destructive. Generated website and skill blocks are balanced and identical.
PASS — Terminal safety: Native help receives only static metadata through prepareNativeDocs() (packages/cli/src/lib/command.ts:440-455). The fixed route tree supplies command definitions (packages/cli/src/app.ts:111-150); no user, API, environment, or plugin data reaches this path. The patch adds no escape sequences or control characters.
PASS — Structured JSON: Introspection converts structured examples back to the existing string[] contract (packages/cli/src/lib/introspect.ts:101-113,304-308). JSON help still uses JSON.stringify through formatJson() (packages/cli/src/lib/help.ts:421-428, packages/cli/src/lib/formatters/json.ts:169-170), so embedded newlines remain valid JSON strings.
PASS — No execution or disclosure: Example metadata is only rendered, introspected, generated, embedded, and written as Markdown. No added code invokes a shell, process, network request, or filesystem mutation. Embedded skill content escapes backslashes, backticks, and template substitutions (packages/cli/script/generate-skill.ts:929-954). Installed skills are written as files, never executed (packages/cli/src/lib/agent-skills.ts:105-123). Examples contain no credentials or local data.
PASS — Shared type widening: CommandDocumentation adds documentation-only fields (packages/cli/src/lib/command.ts:97-114). The list and delete wrappers merely pass this object to buildCommand() (packages/cli/src/lib/list-command.ts:544-623, packages/cli/src/lib/mutate-command.ts:328-410). ...
* 🔴 (22:44) Validation checked exactly 37 skill Markdown files and found no C0/DEL control bytes or unclosed code fences. * 🔴 (22:45) Patch SHA-256 was `dfcceb584e52de2d477015a74dfe42ac1e26e5f44ede4bf5da2afc9e343179d8`. * 🔴 (22:45) Website/skill example-parity validation compared 2 blocks and found them identical. * 🔴 (22:45) `packages/cli/plugins/sentry-cli/skills/sentry-cli/SKILL.md` contai…
* 🔴 (22:40) Search found exactly 11 `CommandDocumentation` matches: `packages/cli/src/lib/mutate-command.ts` lines 22 and 335; `packages/cli/src/lib/list-command.ts` lines 25, 552, and 631; `packages/cli/src/lib/command.ts` lines 110, 154, 421, 424, 442, and 461. * 🔴 (22:40) `packages/cli/src/index.ts` is the programmatic library entry point. It exposes `createSentrySDK()` as the single public …
* 🔴 (22:28) User requires: “Always preserve strict output-mode and binary-safety contracts.” For `sentry api`, preserve `rawApiRequest()` status text; empty textual non-2xx bodies use an HTTP status/request fallback; JSON mode exposes `{status, statusText, body}`; binary `Uint8Array` successes bypass formatters and remain raw; binary errors emit only status/content-type/byte-count summaries, nev…
* 🔴 (22:38) The pnpm patch `packages/cli/patches/@stricli%2Fcore@1.2.8.patch` modifies Stricli’s `dist/index.cjs`, `dist/index.js`, `dist/index.d.cts`, and `dist/index.d.ts`. * 🔴 (22:38) The Stricli patch adds `matchTopLevelFlag(input, topLevelFlags)` and optional `ScannerConfiguration.topLevelFlags` with `booleanFlags: ReadonlySet<string>` and `valueFlags: ReadonlySet<string>`. Allowed global …
* 🔴 (22:35) `packages/cli/test/lib/command.test.ts` defines `createTestContext()` with shared `stdoutWriter`, separate `stdoutCollected`/`stderrCollected` arrays, and exposes `process.stdout`, `process.stderr`, top-level `stdout`, `output`, and `errors` for Stricli and return-based output-handler tests. * 🔴 (22:35) `packages/cli/test/lib/command.test.ts` tests that interactive prompt availabili…
* 🔴 (22:33) In `packages/cli/script/generate-skill.ts`, `loadPrerequisites()` reads `${DOCS_PATH}/getting-started.mdx`; if absent it returns `getDefaultPrerequisites()`, otherwise it strips frontmatter/MDX components, emits `## Prerequisites`, states the CLI must be installed and authenticated, and extracts the `Install Script` and `Authentication` sections. * 🔴 (22:33) `generateInstallSection(…
Date: Sep 8, 2026 * 🔴 (22:31) In `packages/cli/src/lib/help.ts`, `introspectAllCommands()` returns `{ routes: extractAllRoutes(routeMap), envVars: buildTopLevelEnvVars(), flags: buildCommonFlags() }`; `buildCommonFlags()` exposes each common flag’s `long`, `short`, and `description`. * 🔴 (22:31) In `packages/cli/src/lib/help.ts`, `introspectCommand(commandPath)` resolves against the route map a…
* 🔴 (22:30) `packages/cli/src/lib/command.ts` defines all command functions as async generators: non-streaming commands yield one `CommandOutput<T>` and may return `{ hint }`; streaming yields render immediately, but `--json` commands must yield one aggregate value when callers require a single parseable JSON document because individual chunks are pretty-printed rather than JSONL; void commands …
* 🔴 (22:29) Patch introduces structured command examples in `packages/cli/src/lib/command.ts`: exported `CommandExample` has readonly `description` and `command`; exported `CommandDocumentation` extends Stricli docs with optional `readonly examples?: readonly CommandExample[]`. * 🔴 (22:29) `prepareNativeDocs()` in `packages/cli/src/lib/command.ts` strips extended `examples` before passing docs …
* 🔴 (22:28) User requires WASM SQLite bind/execute calls to always pass bind parameters with spread syntax; passing an array directly causes the driver to interpret it as one value or bind incorrectly. * 🔴 (22:28) User stated `wasm-pack test --node` compiles its own JavaScript glue and does not test the published `--target web` artifact. Required two-layer testing is: 1. `wasm_bindgen_test` plu…
Date: Sep 8, 2026 * 🔴 (22:27) User stated Sentry CLI follows `gh` CLI conventions and prioritizes a zero-config, agent-friendly developer experience: DSN/source auto-detection, Seer AI debugging, JSON output, predictable behavior, Node SEA native binaries via fossilize, and SQLite API-response caching. * 🔴 (22:27) User requires reading `.cursor/rules/ultracite.mdc` before working in the Sentry …
Date: Sep 8, 2026 * 🔴 (22:27) User stated the repository root is `/home/byk/Code/getsentry/cli-pr-1558`; it contains 18 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`, and `README.md`. * 🔴 (22:27) User…
🟡 (22:23) [requested-security-review] User requested a separate read-only security and abuse-resistance review of the exact current working-tree patch in `/home/byk/Code/getsentry/cli-pr-1558`, covering ALL changes in `git diff`. 🔴 (22:23) User stated the patch is based on PR `#1558` head `bbaa7b3b722b87f1bccfe84063269cbbcabe2741`. 🟡 (22:23) User required review coverage of command-owned examp…