From 29c72f931963c837c1c90e70e86b9fb7c7e4f1b7 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Mon, 18 May 2026 12:12:58 +0000 Subject: [PATCH 1/4] fix(issue-list): stop collapsing lifetime stats so count/userCount/firstSeen are returned (#969) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The buildIssueListCollapse function always included 'lifetime' in the collapse array, which tells the Sentry API to skip computing aggregate counts (count, userCount, firstSeen). This caused these fields to be missing from both human table output (showing '?' for EVENTS) and JSON output (omitting the fields entirely). Remove 'lifetime' from the collapse array since the CLI uses these fields in table rendering (EVENTS, USERS, AGE columns) and documents them as available JSON fields. Co-authored-by: Miguel Betegón --- plugins/sentry-cli/skills/sentry-cli/SKILL.md | 25 +--- .../skills/sentry-cli/references/api.md | 40 ------ .../skills/sentry-cli/references/auth.md | 42 ------ .../skills/sentry-cli/references/cli.md | 50 ------- .../skills/sentry-cli/references/dashboard.md | 83 ----------- .../skills/sentry-cli/references/event.md | 35 ----- .../skills/sentry-cli/references/explore.md | 57 -------- .../skills/sentry-cli/references/init.md | 28 ---- .../skills/sentry-cli/references/issue.md | 135 ------------------ .../skills/sentry-cli/references/log.md | 39 ----- .../skills/sentry-cli/references/org.md | 16 --- .../skills/sentry-cli/references/project.md | 39 ----- .../skills/sentry-cli/references/release.md | 51 ------- .../skills/sentry-cli/references/replay.md | 36 ----- .../skills/sentry-cli/references/repo.md | 13 -- .../skills/sentry-cli/references/schema.md | 19 --- .../skills/sentry-cli/references/sourcemap.md | 28 ---- .../skills/sentry-cli/references/span.md | 41 ------ .../skills/sentry-cli/references/team.md | 13 -- .../skills/sentry-cli/references/trace.md | 54 ------- .../skills/sentry-cli/references/trial.md | 19 --- src/lib/api/issues.ts | 14 +- test/commands/issue/list.test.ts | 4 +- test/lib/issue-collapse.property.test.ts | 19 ++- 24 files changed, 26 insertions(+), 874 deletions(-) diff --git a/plugins/sentry-cli/skills/sentry-cli/SKILL.md b/plugins/sentry-cli/skills/sentry-cli/SKILL.md index df00799cf..b6bf48dc1 100644 --- a/plugins/sentry-cli/skills/sentry-cli/SKILL.md +++ b/plugins/sentry-cli/skills/sentry-cli/SKILL.md @@ -476,29 +476,8 @@ Browse the Sentry API schema → Full flags and examples: `references/schema.md` -## Global Options - -All commands support the following global options: - -- `--help` - Show help for the command -- `--version` - Show CLI version -- `--log-level ` - Set log verbosity (`error`, `warn`, `log`, `info`, `debug`, `trace`). Overrides `SENTRY_LOG_LEVEL` -- `--verbose` - Shorthand for `--log-level debug` - ## Output Formats -### JSON Output +Most commands support `--json` flag for JSON output, making it easy to integrate with other tools. -Most list and view commands support `--json` flag for JSON output, making it easy to integrate with other tools: - -```bash -sentry org list --json | jq '.[] | .slug' -``` - -### Opening in Browser - -View commands support `-w` or `--web` flag to open the resource in your browser: - -```bash -sentry issue view PROJ-123 -w -``` +View commands support `-w` or `--web` flag to open the resource in your browser. diff --git a/plugins/sentry-cli/skills/sentry-cli/references/api.md b/plugins/sentry-cli/skills/sentry-cli/references/api.md index e0fe92d50..c4023cbdb 100644 --- a/plugins/sentry-cli/skills/sentry-cli/references/api.md +++ b/plugins/sentry-cli/skills/sentry-cli/references/api.md @@ -26,44 +26,4 @@ Make an authenticated API request - `--verbose - Include full HTTP request and response in the output` - `-n, --dry-run - Show the resolved request without sending it` -**Examples:** - -```bash -# List organizations -sentry api organizations/ - -# Get a specific issue -sentry api issues/123456789/ - -# Create a release -sentry api organizations/my-org/releases/ \ - -X POST -F version=1.0.0 - -# With inline JSON body -sentry api issues/123456789/ \ - -X POST -d '{"status": "resolved"}' - -# Update an issue status -sentry api issues/123456789/ \ - -X PUT -F status=resolved - -# Assign an issue -sentry api issues/123456789/ \ - -X PUT --field assignedTo="user@example.com" - -sentry api projects/my-org/my-project/ -X DELETE - -# Add custom headers -sentry api organizations/ -H "X-Custom: value" - -# Read body from a file -sentry api projects/my-org/my-project/releases/ -X POST --input release.json - -# Verbose mode (shows full HTTP request/response) -sentry api organizations/ --verbose - -# Preview the request without sending -sentry api organizations/ --dry-run -``` - All commands also support `--json`, `--fields`, `--help`, `--log-level`, and `--verbose` flags. diff --git a/plugins/sentry-cli/skills/sentry-cli/references/auth.md b/plugins/sentry-cli/skills/sentry-cli/references/auth.md index 1b06207f7..5b12e6302 100644 --- a/plugins/sentry-cli/skills/sentry-cli/references/auth.md +++ b/plugins/sentry-cli/skills/sentry-cli/references/auth.md @@ -21,28 +21,10 @@ Authenticate with Sentry - `--force - Re-authenticate without prompting` - `--url - Sentry instance URL to authenticate against (e.g. https://sentry.example.com). Required for self-hosted; defaults to SaaS (https://sentry.io).` -**Examples:** - -```bash -sentry auth login - -sentry auth login --token YOUR_SENTRY_API_TOKEN - -SENTRY_URL=https://sentry.example.com sentry auth login - -SENTRY_URL=https://sentry.example.com sentry auth login --token YOUR_TOKEN -``` - ### `sentry auth logout` Log out of Sentry -**Examples:** - -```bash -sentry auth logout -``` - ### `sentry auth refresh` Refresh your authentication token @@ -50,12 +32,6 @@ Refresh your authentication token **Flags:** - `--force - Force refresh even if token is still valid` -**Examples:** - -```bash -sentry auth refresh -``` - ### `sentry auth status` View authentication status @@ -64,28 +40,10 @@ View authentication status - `--show-token - Show the stored token (masked by default)` - `-f, --fresh - Bypass cache, re-detect projects, and fetch fresh data` -**Examples:** - -```bash -sentry auth status - -# Show the raw token -sentry auth status --show-token - -# View current user -sentry auth whoami -``` - ### `sentry auth token` Print the stored authentication token -**Examples:** - -```bash -sentry auth token -``` - ### `sentry auth whoami` Show the currently authenticated identity diff --git a/plugins/sentry-cli/skills/sentry-cli/references/cli.md b/plugins/sentry-cli/skills/sentry-cli/references/cli.md index a029e08c0..5300c7df1 100644 --- a/plugins/sentry-cli/skills/sentry-cli/references/cli.md +++ b/plugins/sentry-cli/skills/sentry-cli/references/cli.md @@ -24,16 +24,6 @@ View and manage default settings Send feedback about the CLI -**Examples:** - -```bash -# Send positive feedback -sentry cli feedback i love this tool - -# Report an issue -sentry cli feedback the issue view is confusing -``` - ### `sentry cli fix` Diagnose and repair CLI database issues @@ -41,12 +31,6 @@ Diagnose and repair CLI database issues **Flags:** - `--dry-run - Show what would be fixed without making changes` -**Examples:** - -```bash -sentry cli fix -``` - ### `sentry cli setup` Configure shell integration @@ -60,19 +44,6 @@ Configure shell integration - `--no-agent-skills - Skip agent skill installation for AI coding assistants` - `--quiet - Suppress output (for scripted usage)` -**Examples:** - -```bash -# Run full setup (PATH, completions, agent skills) -sentry cli setup - -# Skip agent skill installation -sentry cli setup --no-agent-skills - -# Skip PATH and completion modifications -sentry cli setup --no-modify-path --no-completions -``` - ### `sentry cli upgrade ` Update the Sentry CLI to the latest version @@ -83,25 +54,4 @@ Update the Sentry CLI to the latest version - `--offline - Upgrade using only cached version info and patches (no network)` - `--method - Installation method to use (curl, brew, npm, pnpm, bun, yarn)` -**Examples:** - -```bash -sentry cli upgrade --check - -# Upgrade to latest stable -sentry cli upgrade - -# Upgrade to a specific version -sentry cli upgrade 0.5.0 - -# Force re-download -sentry cli upgrade --force - -# Switch to nightly builds -sentry cli upgrade nightly - -# Switch back to stable -sentry cli upgrade stable -``` - All commands also support `--json`, `--fields`, `--help`, `--log-level`, and `--verbose` flags. diff --git a/plugins/sentry-cli/skills/sentry-cli/references/dashboard.md b/plugins/sentry-cli/skills/sentry-cli/references/dashboard.md index 4a8df0d38..5ddb38ed6 100644 --- a/plugins/sentry-cli/skills/sentry-cli/references/dashboard.md +++ b/plugins/sentry-cli/skills/sentry-cli/references/dashboard.md @@ -21,19 +21,6 @@ List dashboards - `-f, --fresh - Bypass cache, re-detect projects, and fetch fresh data` - `-c, --cursor - Navigate pages: "next", "prev", "first" (or raw cursor string)` -**Examples:** - -```bash -# List all dashboards -sentry dashboard list - -# Filter by name pattern -sentry dashboard list "Backend*" - -# Open dashboard list in browser -sentry dashboard list -w -``` - ### `sentry dashboard view ` View a dashboard @@ -44,32 +31,10 @@ View a dashboard - `-r, --refresh - Auto-refresh interval in seconds (default: 60, min: 10)` - `-t, --period - Time range: "7d", "2026-04-01..2026-05-01", ">=2026-04-01"` -**Examples:** - -```bash -# View by title -sentry dashboard view 'Frontend Performance' - -# View by ID -sentry dashboard view 12345 - -# Auto-refresh every 30 seconds -sentry dashboard view "Backend Performance" --refresh 30 - -# Open in browser -sentry dashboard view 12345 -w -``` - ### `sentry dashboard create ` Create a dashboard -**Examples:** - -```bash -sentry dashboard create 'Frontend Performance' -``` - ### `sentry dashboard widget add ` Add a widget to a dashboard @@ -88,31 +53,6 @@ Add a widget to a dashboard - `--height - Widget height in grid rows (min 1)` - `-l, --layout - Layout mode: sequential (append in order) or dense (fill gaps) - (default: "sequential")` -**Examples:** - -```bash -# Simple counter widget -sentry dashboard widget add 'My Dashboard' "Error Count" \ - --display big_number --query count - -# Line chart with group-by -sentry dashboard widget add 'My Dashboard' "Errors by Browser" \ - --display line --query count --group-by browser.name - -# Table with multiple aggregates, sorted descending -sentry dashboard widget add 'My Dashboard' "Top Endpoints" \ - --display table \ - --query count --query p95:span.duration \ - --group-by transaction \ - --sort -count --limit 10 - -# With search filter -sentry dashboard widget add 'My Dashboard' "Slow Requests" \ - --display bar --query p95:span.duration \ - --where "span.op:http.client" \ - --group-by span.description -``` - ### `sentry dashboard widget edit ` Edit a widget in a dashboard @@ -133,19 +73,6 @@ Edit a widget in a dashboard - `--width - Widget width in grid columns (1–6)` - `--height - Widget height in grid rows (min 1)` -**Examples:** - -```bash -# Change display type -sentry dashboard widget edit 12345 --title 'Error Count' --display bar - -# Rename a widget -sentry dashboard widget edit 'My Dashboard' --index 0 --new-title 'Total Errors' - -# Change the query -sentry dashboard widget edit 12345 --title 'Error Rate' --query p95:span.duration -``` - ### `sentry dashboard widget delete ` Delete a widget from a dashboard @@ -157,16 +84,6 @@ Delete a widget from a dashboard - `-f, --force - Force the operation without confirmation` - `-n, --dry-run - Show what would happen without making changes` -**Examples:** - -```bash -# Delete by title -sentry dashboard widget delete 'My Dashboard' --title 'Error Count' - -# Delete by index -sentry dashboard widget delete 12345 --index 2 -``` - ### `sentry dashboard revisions ` List dashboard revisions diff --git a/plugins/sentry-cli/skills/sentry-cli/references/event.md b/plugins/sentry-cli/skills/sentry-cli/references/event.md index e17fb3f64..025f45f59 100644 --- a/plugins/sentry-cli/skills/sentry-cli/references/event.md +++ b/plugins/sentry-cli/skills/sentry-cli/references/event.md @@ -20,15 +20,6 @@ View details of one or more events - `--spans - Span tree depth limit (number, "all" for unlimited, "no" to disable) - (default: "3")` - `-f, --fresh - Bypass cache, re-detect projects, and fetch fresh data` -**Examples:** - -```bash -sentry event view abc123def456abc123def456abc12345 - -# Open in browser -sentry event view abc123def456abc123def456abc12345 -w -``` - ### `sentry event list ` List events for an issue @@ -61,30 +52,4 @@ List events for an issue | `crashFile` | string \| null | Crash file URL | | `metadata` | object \| null | Event metadata | -**Examples:** - -```bash -# List events for an issue (using short ID) -sentry event list PROJ-ABC - -# List events for an issue (using numeric ID) -sentry event list 123456789 - -# Filter by search query -sentry event list PROJ-ABC --query "browser:Chrome" - -# Include full event bodies (stacktraces) -sentry event list PROJ-ABC --full - -# Limit results and time range -sentry event list PROJ-ABC --limit 50 --period 24h - -# Paginate through results -sentry event list PROJ-ABC -c next -sentry event list PROJ-ABC -c prev - -# Output as JSON -sentry event list PROJ-ABC --json -``` - All commands also support `--json`, `--fields`, `--help`, `--log-level`, and `--verbose` flags. diff --git a/plugins/sentry-cli/skills/sentry-cli/references/explore.md b/plugins/sentry-cli/skills/sentry-cli/references/explore.md index aa0dc82fd..b70b3b254 100644 --- a/plugins/sentry-cli/skills/sentry-cli/references/explore.md +++ b/plugins/sentry-cli/skills/sentry-cli/references/explore.md @@ -28,61 +28,4 @@ Query aggregate event data (Explore) - `-f, --fresh - Bypass cache, re-detect projects, and fetch fresh data` - `-c, --cursor - Navigate pages: "next", "prev", "first" (or raw cursor string)` -**Examples:** - -```bash -# Top errors in the last 24 hours, scoped to a project -sentry explore my-org/cli - -# All projects in an org -sentry explore my-org/ - -# Bare project slug (searches across orgs) -sentry explore cli - -# Auto-detect from DSN/config -sentry explore - -# Errors with user impact for a specific UTC window -sentry explore my-org/cli -F title -F "count()" -F "count_unique(user)" \ - --period "2024-01-15T00:00:00Z/2024-01-16T00:00:00Z" - -# Filter by specific error type (combines with auto-injected project filter) -sentry explore my-org/cli -F title -F "count()" \ - -q "error.type:TypeError" --period 1h - -# Span operation latency by route -sentry explore my-org/cli -F span.op -F "p50(span.duration)" \ - -F "p95(span.duration)" --dataset spans --period 1h - -# Top spans by count -sentry explore my-org/cli -F span.op -F "count()" \ - --dataset spans --sort "-count()" - -# Sum a custom metric (e.g., LLM token usage) across an org -sentry explore my-org/ -m llm.token_usage --dataset metrics --period 7d - -# Break down by a tag column (e.g., model name) -sentry explore my-org/seer -F gen_ai.request.model \ - -m llm.token_usage --dataset metrics --period 7d - -# Use a different aggregation (default is sum) -sentry explore my-org/ -m cache.hit_rate --agg avg --dataset metrics - -sentry explore my-org/ \ - -F "sum(value,llm.token_usage,distribution,none)" \ - --dataset metrics --period 7d - -# Log severity counts in the last hour -sentry explore my-org/cli -F severity -F "count()" \ - --dataset logs --period 1h - -# Pipe to jq for filtering -sentry explore my-org/cli -F title -F "count()" --json | jq '.data[:5]' - -# Get raw data for analysis -sentry explore my-org/cli -F title -F "count()" -F "count_unique(user)" \ - --json --limit 100 -``` - All commands also support `--json`, `--fields`, `--help`, `--log-level`, and `--verbose` flags. diff --git a/plugins/sentry-cli/skills/sentry-cli/references/init.md b/plugins/sentry-cli/skills/sentry-cli/references/init.md index 802a23900..09bbd26e6 100644 --- a/plugins/sentry-cli/skills/sentry-cli/references/init.md +++ b/plugins/sentry-cli/skills/sentry-cli/references/init.md @@ -22,32 +22,4 @@ Initialize Sentry in your project (experimental) - `-t, --team - Team slug to create the project under` - `--tui - Use the Ink-based interactive UI (default). Pass --no-tui to fall back to plain log output.` -**Examples:** - -```bash -# Interactive setup -sentry init - -# Non-interactive agent/CI setup -sentry init --yes --features errors,tracing,replay - -# Dry run to preview changes -sentry init --dry-run - -# Target a subdirectory -sentry init ./my-app - -# Use a specific org (auto-detect project) -sentry init acme/ - -# Use a specific org and project -sentry init acme/my-app - -# Assign a team when creating a new project -sentry init acme/ --team backend - -# Enable specific features -sentry init --features profiling,replay -``` - All commands also support `--json`, `--fields`, `--help`, `--log-level`, and `--verbose` flags. diff --git a/plugins/sentry-cli/skills/sentry-cli/references/issue.md b/plugins/sentry-cli/skills/sentry-cli/references/issue.md index 448b6546b..cc66e6608 100644 --- a/plugins/sentry-cli/skills/sentry-cli/references/issue.md +++ b/plugins/sentry-cli/skills/sentry-cli/references/issue.md @@ -48,37 +48,6 @@ List issues in a project | `isUnhandled` | boolean | Whether the issue is unhandled | | `seerFixabilityScore` | number \| null | Seer AI fixability score (0-1) | -**Examples:** - -```bash -# List issues in a specific project -sentry issue list my-org/frontend - -# All projects in an org -sentry issue list my-org/ - -# Search for a project across organizations -sentry issue list frontend - -# Show only unresolved issues -sentry issue list my-org/frontend --query "is:unresolved" - -# Show resolved issues -sentry issue list my-org/frontend --query "is:resolved" - -# Sort by frequency -sentry issue list my-org/frontend --sort freq --limit 20 - -# Multiple filters (space-separated = implicit AND) -sentry issue list --query "is:unresolved level:error assigned:me" - -# Negation and wildcards -sentry issue list --query "!browser:Chrome message:*timeout*" - -# Match multiple values for one key (in-list syntax) -sentry issue list --query "browser:[Chrome,Firefox]" -``` - ### `sentry issue events ` List events for a specific issue @@ -119,25 +88,6 @@ Analyze an issue's root cause using Seer AI - `--force - Force new analysis even if one exists` - `-f, --fresh - Bypass cache, re-detect projects, and fetch fresh data` -**Examples:** - -```bash -# Analyze root cause (may take a few minutes for new issues) -sentry issue explain 123456789 - -# By short ID with org prefix -sentry issue explain my-org/MYPROJECT-ABC - -# Force a fresh analysis -sentry issue explain 123456789 --force - -# Generate a fix plan (requires explain to be run first) -sentry issue plan 123456789 - -# Specify which root cause to plan for -sentry issue plan 123456789 --cause 0 -``` - ### `sentry issue plan ` Generate a solution plan using Seer AI @@ -155,15 +105,6 @@ View details of a specific issue - `--spans - Span tree depth limit (number, "all" for unlimited, "no" to disable) - (default: "3")` - `-f, --fresh - Bypass cache, re-detect projects, and fetch fresh data` -**Examples:** - -```bash -sentry issue view FRONT-ABC - -# Open in browser -sentry issue view FRONT-ABC -w -``` - ### `sentry issue resolve ` Mark an issue as resolved @@ -171,35 +112,6 @@ Mark an issue as resolved **Flags:** - `-i, --in - Resolve in a release, next release, or commit ('' | '@next' | '@commit' | '@commit:@')` -**Examples:** - -```bash -# Resolve immediately (no regression tracking) -sentry issue resolve CLI-G5 - -# Resolve in a specific release — future events on newer releases are -# regression-flagged -sentry issue resolve CLI-G5 --in 0.26.1 - -# Monorepo-style releases work too (no special parsing) -sentry issue resolve CLI-G5 --in spotlight@1.2.3 - -# Resolve in the next release (tied to current HEAD) -sentry issue resolve CLI-G5 --in @next -sentry issue resolve CLI-G5 -i @next - -# Resolve in the current git HEAD — auto-detects the Sentry repo from -# your git origin remote (hard-errors if it can't) -sentry issue resolve CLI-G5 --in @commit - -# Explicit commit + repo (no git inspection; repo must be registered in Sentry) -sentry issue resolve CLI-G5 --in @commit:getsentry/cli@abc123def - -# Reopen a resolved issue -sentry issue unresolve CLI-G5 -sentry issue reopen CLI-G5 # alias -``` - ### `sentry issue unresolve ` Reopen a resolved issue @@ -211,37 +123,6 @@ Archive (ignore) an issue **Flags:** - `-u, --until - Condition for unarchival: forever, auto, 30m, 10x, 10u, 10x/5m, etc.` -**Examples:** - -```bash -# Archive forever (fully silenced) -sentry issue archive CLI-G5 - -# Smart detection — unarchives when Sentry detects a spike in event frequency -sentry issue archive CLI-G5 --until auto - -# Duration-based -sentry issue archive CLI-G5 --until 1h # 1 hour -sentry issue archive CLI-G5 --until 7d # 7 days -sentry issue archive CLI-G5 --until 2026-12-31 # specific date - -# Count-based — unarchive after N more events -sentry issue archive CLI-G5 --until 100x - -# User-based — unarchive after N more users affected -sentry issue archive CLI-G5 --until 10u - -# Compound — count within a time window -sentry issue archive CLI-G5 --until 100x/1h # 100 events within 1 hour -sentry issue archive CLI-G5 --until 10u/1d # 10 users within 1 day - -# Verbose forms also work -sentry issue archive CLI-G5 --until 10events/2hours - -# 'ignore' is an alias for 'archive' -sentry issue ignore CLI-G5 --until auto -``` - ### `sentry issue merge ` Merge 2+ issues into a single canonical group @@ -249,20 +130,4 @@ Merge 2+ issues into a single canonical group **Flags:** - `-i, --into - Prefer this issue as the canonical parent (must match one of the provided IDs)` -**Examples:** - -```bash -# Let Sentry auto-pick the parent (typically the largest by event count) -sentry issue merge CLI-K9 CLI-15H CLI-15N - -# Pin the canonical parent explicitly — accepts the same formats as -# positional args, including org-qualified and project-alias forms -sentry issue merge CLI-K9 CLI-15H CLI-15N --into CLI-K9 -sentry issue merge my-org/CLI-K9 my-org/CLI-15H --into my-org/CLI-K9 -sentry issue merge cli-k9 cli-15h --into cli-k9 # alias form - -# Cross-org merges are rejected — all issues must share an organization -# Non-error issue types (performance, info, etc.) cannot be merged -``` - All commands also support `--json`, `--fields`, `--help`, `--log-level`, and `--verbose` flags. diff --git a/plugins/sentry-cli/skills/sentry-cli/references/log.md b/plugins/sentry-cli/skills/sentry-cli/references/log.md index 54355ca2e..749f29e6f 100644 --- a/plugins/sentry-cli/skills/sentry-cli/references/log.md +++ b/plugins/sentry-cli/skills/sentry-cli/references/log.md @@ -34,33 +34,6 @@ List logs from a project | `severity` | string \| null | Severity level (error, warning, info, debug) | | `trace` | string \| null | Trace ID for correlation | -**Examples:** - -```bash -# List last 100 logs (default) -sentry log list - -# Show only error logs -sentry log list -q 'level:error' - -# Filter by message content -sentry log list -q 'database' - -# Limit results -sentry log list --limit 50 - -# Stream with default 2-second poll interval -sentry log list -f - -# Stream with custom 5-second poll interval -sentry log list -f 5 - -# Stream error logs from a specific project -sentry log list my-org/backend -f -q 'level:error' - -sentry log list --json | jq '.data[] | select(.severity == "error")' -``` - ### `sentry log view ` View details of one or more log entries @@ -69,16 +42,4 @@ View details of one or more log entries - `-w, --web - Open in browser` - `-f, --fresh - Bypass cache, re-detect projects, and fetch fresh data` -**Examples:** - -```bash -sentry log view 968c763c740cfda8b6728f27fb9e9b01 - -# With explicit project -sentry log view my-org/backend 968c763c740cfda8b6728f27fb9e9b01 - -# Open in browser -sentry log view 968c763c740cfda8b6728f27fb9e9b01 -w -``` - All commands also support `--json`, `--fields`, `--help`, `--log-level`, and `--verbose` flags. diff --git a/plugins/sentry-cli/skills/sentry-cli/references/org.md b/plugins/sentry-cli/skills/sentry-cli/references/org.md index cdda42ff7..0b9284aca 100644 --- a/plugins/sentry-cli/skills/sentry-cli/references/org.md +++ b/plugins/sentry-cli/skills/sentry-cli/references/org.md @@ -27,20 +27,4 @@ View details of an organization - `-w, --web - Open in browser` - `-f, --fresh - Bypass cache, re-detect projects, and fetch fresh data` -**Examples:** - -```bash -# List organizations -sentry org list - -# View organization details -sentry org view my-org - -# Open in browser -sentry org view my-org -w - -# JSON output -sentry org list --json -``` - All commands also support `--json`, `--fields`, `--help`, `--log-level`, and `--verbose` flags. diff --git a/plugins/sentry-cli/skills/sentry-cli/references/project.md b/plugins/sentry-cli/skills/sentry-cli/references/project.md index 70ecb1ab3..6a042a74c 100644 --- a/plugins/sentry-cli/skills/sentry-cli/references/project.md +++ b/plugins/sentry-cli/skills/sentry-cli/references/project.md @@ -19,19 +19,6 @@ Create a new project - `-t, --team - Team to create the project under` - `-n, --dry-run - Show what would happen without making changes` -**Examples:** - -```bash -# Create a new project -sentry project create my-new-app javascript-nextjs - -# Create under a specific org and team -sentry project create my-org/my-new-app python --team backend-team - -# Preview without creating -sentry project create my-new-app node --dry-run -``` - ### `sentry project delete ` Delete a project @@ -41,16 +28,6 @@ Delete a project - `-f, --force - Force the operation without confirmation` - `-n, --dry-run - Show what would happen without making changes` -**Examples:** - -```bash -# Delete a project (will prompt for confirmation) -sentry project delete my-org/old-project - -# Delete without confirmation -sentry project delete my-org/old-project --yes -``` - ### `sentry project list ` List projects @@ -69,20 +46,4 @@ View details of a project - `-w, --web - Open in browser` - `-f, --fresh - Bypass cache, re-detect projects, and fetch fresh data` -**Examples:** - -```bash -# List all projects in an org -sentry project list my-org/ - -# Filter by platform -sentry project list my-org/ --platform javascript - -# View project details -sentry project view my-org/frontend - -# Open project in browser -sentry project view my-org/frontend -w -``` - All commands also support `--json`, `--fields`, `--help`, `--log-level`, and `--verbose` flags. diff --git a/plugins/sentry-cli/skills/sentry-cli/references/release.md b/plugins/sentry-cli/skills/sentry-cli/references/release.md index d928d3d7e..4112254a6 100644 --- a/plugins/sentry-cli/skills/sentry-cli/references/release.md +++ b/plugins/sentry-cli/skills/sentry-cli/references/release.md @@ -90,55 +90,4 @@ Set commits for a release Propose a release version -**Examples:** - -```bash -# List releases (auto-detect org) -sentry release list - -# List releases in a specific org -sentry release list my-org/ - -# View release details -sentry release view 1.0.0 -sentry release view my-org/1.0.0 - -# Create and finalize a release -sentry release create 1.0.0 --finalize - -# Create a release, then finalize separately -sentry release create 1.0.0 -sentry release set-commits 1.0.0 --auto -sentry release finalize 1.0.0 - -# Set commits from local git history -sentry release set-commits 1.0.0 --local - -# Create a deploy -sentry release deploy 1.0.0 production -sentry release deploy 1.0.0 staging "Deploy #42" - -# Propose a version from git HEAD -sentry release create $(sentry release propose-version) - -# List deploys for a release -sentry release deploys 1.0.0 -sentry release deploys my-org/1.0.0 - -# Delete a release -sentry release delete my-org/1.0.0 -sentry release delete my-org/1.0.0 --yes # Skip confirmation -sentry release delete my-org/1.0.0 --dry-run # Preview without deleting - -# Output as JSON -sentry release list --json -sentry release view 1.0.0 --json - -# Full release workflow with explicit org -sentry release create my-org/1.0.0 --project my-project -sentry release set-commits my-org/1.0.0 --auto -sentry release finalize my-org/1.0.0 -sentry release deploy my-org/1.0.0 production -``` - All commands also support `--json`, `--fields`, `--help`, `--log-level`, and `--verbose` flags. diff --git a/plugins/sentry-cli/skills/sentry-cli/references/replay.md b/plugins/sentry-cli/skills/sentry-cli/references/replay.md index 224b9902b..2a49cb726 100644 --- a/plugins/sentry-cli/skills/sentry-cli/references/replay.md +++ b/plugins/sentry-cli/skills/sentry-cli/references/replay.md @@ -60,26 +60,6 @@ List recent Session Replays | `user` | object \| null | User metadata | | `warning_ids` | array | Linked warning event IDs | -**Examples:** - -```bash -# List recent replays for a project -sentry replay list my-org/frontend - -# Search across all projects in an org -sentry replay list my-org/ --query "environment:production" - -# Change the time window and sort -sentry replay list my-org/frontend --period 24h --sort errors - -# Paginate through results -sentry replay list my-org/frontend -c next -sentry replay list my-org/frontend -c prev - -# Output machine-readable data -sentry replay list my-org/frontend --json -``` - ### `sentry replay view ` View a Session Replay @@ -129,20 +109,4 @@ View a Session Replay | `relatedIssues` | array | Replay-related issues | | `relatedTraces` | array | Replay-related traces | -**Examples:** - -```bash -# View a replay by ID using auto-detected org/project context -sentry replay view 346789a703f6454384f1de473b8b9fcc - -# View a replay with an explicit org -sentry replay view my-org/346789a703f6454384f1de473b8b9fcc - -# View a replay with explicit org/project context -sentry replay view my-org/frontend/346789a703f6454384f1de473b8b9fcc - -# Open a replay in the browser -sentry replay view my-org/346789a703f6454384f1de473b8b9fcc --web -``` - All commands also support `--json`, `--fields`, `--help`, `--log-level`, and `--verbose` flags. diff --git a/plugins/sentry-cli/skills/sentry-cli/references/repo.md b/plugins/sentry-cli/skills/sentry-cli/references/repo.md index 57a8bb3ea..c8bd952a9 100644 --- a/plugins/sentry-cli/skills/sentry-cli/references/repo.md +++ b/plugins/sentry-cli/skills/sentry-cli/references/repo.md @@ -34,17 +34,4 @@ List repositories | `externalSlug` | string \| null | External slug (e.g. org/repo) | | `externalId` | string \| null | External ID | -**Examples:** - -```bash -# List repositories (auto-detect org) -sentry repo list - -# List repos in a specific org with pagination -sentry repo list my-org/ -c next - -# Output as JSON -sentry repo list --json -``` - All commands also support `--json`, `--fields`, `--help`, `--log-level`, and `--verbose` flags. diff --git a/plugins/sentry-cli/skills/sentry-cli/references/schema.md b/plugins/sentry-cli/skills/sentry-cli/references/schema.md index 32a4603f9..3523d3e34 100644 --- a/plugins/sentry-cli/skills/sentry-cli/references/schema.md +++ b/plugins/sentry-cli/skills/sentry-cli/references/schema.md @@ -19,23 +19,4 @@ Browse the Sentry API schema - `--all - Show all endpoints in a flat list` - `-q, --search - Search endpoints by keyword` -**Examples:** - -```bash -# List all API resources -sentry schema - -# Browse issue endpoints -sentry schema issues - -# View details for a specific operation -sentry schema issues list - -# Search for monitoring-related endpoints -sentry schema --search monitor - -# Flat list of every endpoint -sentry schema --all -``` - All commands also support `--json`, `--fields`, `--help`, `--log-level`, and `--verbose` flags. diff --git a/plugins/sentry-cli/skills/sentry-cli/references/sourcemap.md b/plugins/sentry-cli/skills/sentry-cli/references/sourcemap.md index 0a2338629..fde59832d 100644 --- a/plugins/sentry-cli/skills/sentry-cli/references/sourcemap.md +++ b/plugins/sentry-cli/skills/sentry-cli/references/sourcemap.md @@ -22,19 +22,6 @@ Inject debug IDs into JavaScript files and sourcemaps - `--dry-run - Show what would be modified without writing` - `--allow-empty - Exit successfully when no JS + sourcemap pairs are found (default: error out to catch silent build misconfigurations)` -**Examples:** - -```bash -# Inject debug IDs into all JS files in dist/ -sentry sourcemap inject ./dist - -# Preview changes without writing -sentry sourcemap inject ./dist --dry-run - -# Only process specific extensions -sentry sourcemap inject ./build --ext .js,.mjs -``` - ### `sentry sourcemap upload ` Upload sourcemaps to Sentry @@ -51,19 +38,4 @@ Upload sourcemaps to Sentry - `--no-rewrite - Upload files as-is without injecting debug IDs` - `--allow-empty - Exit successfully when no JS + sourcemap pairs are found (default: error out to catch silent build misconfigurations)` -**Examples:** - -```bash -# Upload sourcemaps from dist/ -sentry sourcemap upload ./dist - -# Associate with a release -sentry sourcemap upload ./dist --release 1.0.0 - -# Set a custom URL prefix -sentry sourcemap upload ./dist --url-prefix '~/static/js/' - -sentry sourcemap upload ./dist --allow-empty -``` - All commands also support `--json`, `--fields`, `--help`, `--log-level`, and `--verbose` flags. diff --git a/plugins/sentry-cli/skills/sentry-cli/references/span.md b/plugins/sentry-cli/skills/sentry-cli/references/span.md index fe03b4aa0..92e678498 100644 --- a/plugins/sentry-cli/skills/sentry-cli/references/span.md +++ b/plugins/sentry-cli/skills/sentry-cli/references/span.md @@ -37,34 +37,6 @@ List spans in a project or trace | `transaction` | string \| null | Transaction name | | `trace` | string | Trace ID | -**Examples:** - -```bash -# List recent spans in the current project -sentry span list - -# Find all DB spans -sentry span list -q "op:db" - -# Slow spans in the last 24 hours -sentry span list -q "duration:>100ms" --period 24h - -# List spans within a specific trace -sentry span list abc123def456abc123def456abc12345 - -# Paginate through results -sentry span list -c next - -# Show only spans from one project within a trace -sentry span list my-org/cli-server/abc123def456abc123def456abc12345 - -# Or use --query to filter by project -sentry span list abc123def456abc123def456abc12345 -q "project:cli-server" - -# Multiple projects at once -sentry span list abc123def456abc123def456abc12345 -q "project:[cli-server,api]" -``` - ### `sentry span view ` View details of specific spans @@ -73,17 +45,4 @@ View details of specific spans - `--spans - Span tree depth limit (number, "all" for unlimited, "no" to disable) - (default: "3")` - `-f, --fresh - Bypass cache, re-detect projects, and fetch fresh data` -**Examples:** - -```bash -# View a single span -sentry span view abc123def456abc123def456abc12345 a1b2c3d4e5f67890 - -# View multiple spans at once -sentry span view abc123def456abc123def456abc12345 a1b2c3d4e5f67890 b2c3d4e5f6789012 - -# With explicit org/project -sentry span view my-org/backend/abc123def456abc123def456abc12345 a1b2c3d4e5f67890 -``` - All commands also support `--json`, `--fields`, `--help`, `--log-level`, and `--verbose` flags. diff --git a/plugins/sentry-cli/skills/sentry-cli/references/team.md b/plugins/sentry-cli/skills/sentry-cli/references/team.md index c841fb99d..736f5abf0 100644 --- a/plugins/sentry-cli/skills/sentry-cli/references/team.md +++ b/plugins/sentry-cli/skills/sentry-cli/references/team.md @@ -32,17 +32,4 @@ List teams | `teamRole` | string \| null | Your role in the team | | `memberCount` | number | Number of members | -**Examples:** - -```bash -# List teams -sentry team list my-org/ - -# Paginate through teams -sentry team list my-org/ -c next - -# Output as JSON -sentry team list --json -``` - All commands also support `--json`, `--fields`, `--help`, `--log-level`, and `--verbose` flags. diff --git a/plugins/sentry-cli/skills/sentry-cli/references/trace.md b/plugins/sentry-cli/skills/sentry-cli/references/trace.md index 1baaf028a..1c081b93e 100644 --- a/plugins/sentry-cli/skills/sentry-cli/references/trace.md +++ b/plugins/sentry-cli/skills/sentry-cli/references/trace.md @@ -34,22 +34,6 @@ List recent traces in a project | `transaction.duration` | number | Duration (ms) | | `project` | string | Project slug | -**Examples:** - -```bash -# List last 20 traces (default) -sentry trace list - -# Sort by slowest first -sentry trace list --sort duration - -# Filter by transaction name, last 24 hours -sentry trace list -q "transaction:GET /api/users" --period 24h - -# Paginate through results -sentry trace list my-org/backend -c next -``` - ### `sentry trace view ` View details of a specific trace @@ -60,31 +44,6 @@ View details of a specific trace - `--spans - Span tree depth limit (number, "all" for unlimited, "no" to disable) - (default: "3")` - `-f, --fresh - Bypass cache, re-detect projects, and fetch fresh data` -**Examples:** - -```bash -# View trace details with span tree -sentry trace view abc123def456abc123def456abc12345 - -# Open trace in browser -sentry trace view abc123def456abc123def456abc12345 -w - -# Auto-recover from an issue short ID -sentry trace view PROJ-123 - -# Filter trace view to one project's spans -sentry trace view my-org/cli-server/abc123def456abc123def456abc12345 - -# Full trace across all projects (default) -sentry trace view my-org/abc123def456abc123def456abc12345 - -# Filter trace logs by project -sentry trace logs my-org/cli-server/abc123def456abc123def456abc12345 - -# Multiple projects via --query -sentry trace logs abc123def456abc123def456abc12345 -q "project:[cli-server,api]" -``` - ### `sentry trace logs ` View logs associated with a trace @@ -97,17 +56,4 @@ View logs associated with a trace - `-s, --sort - Sort order: "newest" (default) or "oldest" - (default: "newest")` - `-f, --fresh - Bypass cache, re-detect projects, and fetch fresh data` -**Examples:** - -```bash -# View logs for a trace -sentry trace logs abc123def456abc123def456abc12345 - -# Search with a longer time window -sentry trace logs --period 30d abc123def456abc123def456abc12345 - -# Filter logs within a trace -sentry trace logs -q 'level:error' abc123def456abc123def456abc12345 -``` - All commands also support `--json`, `--fields`, `--help`, `--log-level`, and `--verbose` flags. diff --git a/plugins/sentry-cli/skills/sentry-cli/references/trial.md b/plugins/sentry-cli/skills/sentry-cli/references/trial.md index c25143ccd..2eec1d111 100644 --- a/plugins/sentry-cli/skills/sentry-cli/references/trial.md +++ b/plugins/sentry-cli/skills/sentry-cli/references/trial.md @@ -30,23 +30,4 @@ List product trials Start a product trial -**Examples:** - -```bash -# List all trials for the current org -sentry trial list - -# List trials for a specific org -sentry trial list my-org - -# Start a Seer trial -sentry trial start seer - -# Start a trial for a specific org -sentry trial start replays my-org - -# Start a Business plan trial (opens browser) -sentry trial start plan -``` - All commands also support `--json`, `--fields`, `--help`, `--log-level`, and `--verbose` flags. diff --git a/src/lib/api/issues.ts b/src/lib/api/issues.ts index 66155a917..d38d76df2 100644 --- a/src/lib/api/issues.ts +++ b/src/lib/api/issues.ts @@ -59,13 +59,13 @@ export type IssueCollapseField = NonNullable< /** * Build the `collapse` parameter for issue list API calls. * - * Always collapses fields the CLI never consumes in issue list: - * `filtered`, `lifetime`, `unhandled`. Conditionally collapses `stats` - * when sparklines won't be rendered (narrow terminal, non-TTY, or JSON). + * Collapses `filtered` and `unhandled` which the CLI never uses in list views. + * Does NOT collapse `lifetime` — that suppresses `count`, `userCount`, and + * `firstSeen` on the list endpoint, which the CLI needs for table columns + * (EVENTS, USERS, AGE) and JSON output. * - * Matches the Sentry web UI's optimization: the initial page load sends - * `collapse=stats,unhandled` to skip expensive Snuba queries, fetching - * stats in a follow-up request only when needed. + * Conditionally collapses `stats` when sparklines won't be rendered + * (narrow terminal, non-TTY, or JSON mode). * * @param options - Context for determining what to collapse * @param options.shouldCollapseStats - Whether stats data can be skipped @@ -75,7 +75,7 @@ export type IssueCollapseField = NonNullable< export function buildIssueListCollapse(options: { shouldCollapseStats: boolean; }): IssueCollapseField[] { - const collapse: IssueCollapseField[] = ["filtered", "lifetime", "unhandled"]; + const collapse: IssueCollapseField[] = ["filtered", "unhandled"]; if (options.shouldCollapseStats) { collapse.push("stats"); } diff --git a/test/commands/issue/list.test.ts b/test/commands/issue/list.test.ts index bc26aee05..e6a4155e5 100644 --- a/test/commands/issue/list.test.ts +++ b/test/commands/issue/list.test.ts @@ -1110,7 +1110,7 @@ describe("issue list: collapse parameter optimization", () => { advancePaginationStateSpy.mockRestore(); }); - test("always collapses filtered, lifetime, unhandled in org-all mode", async () => { + test("always collapses filtered and unhandled (not lifetime) in org-all mode", async () => { listIssuesPaginatedSpy.mockResolvedValue({ data: [sampleIssue], nextCursor: undefined, @@ -1134,7 +1134,7 @@ describe("issue list: collapse parameter optimization", () => { const options = callArgs?.[2] as Record | undefined; const collapse = options?.collapse as string[]; expect(collapse).toContain("filtered"); - expect(collapse).toContain("lifetime"); + expect(collapse).not.toContain("lifetime"); expect(collapse).toContain("unhandled"); }); diff --git a/test/lib/issue-collapse.property.test.ts b/test/lib/issue-collapse.property.test.ts index 4938d29ae..73bc8eedd 100644 --- a/test/lib/issue-collapse.property.test.ts +++ b/test/lib/issue-collapse.property.test.ts @@ -15,20 +15,31 @@ import { import { DEFAULT_NUM_RUNS } from "../model-based/helpers.js"; describe("property: buildIssueListCollapse", () => { - test("always collapses filtered, lifetime, unhandled regardless of stats flag", () => { + test("always collapses filtered and unhandled regardless of stats flag", () => { fcAssert( property(boolean(), (collapseStats) => { const result = buildIssueListCollapse({ shouldCollapseStats: collapseStats, }); expect(result).toContain("filtered"); - expect(result).toContain("lifetime"); expect(result).toContain("unhandled"); }), { numRuns: DEFAULT_NUM_RUNS } ); }); + test("never collapses lifetime (CLI needs count, userCount, firstSeen)", () => { + fcAssert( + property(boolean(), (collapseStats) => { + const result = buildIssueListCollapse({ + shouldCollapseStats: collapseStats, + }); + expect(result).not.toContain("lifetime"); + }), + { numRuns: DEFAULT_NUM_RUNS } + ); + }); + test("stats presence is exactly controlled by shouldCollapseStats", () => { fcAssert( property(boolean(), (collapseStats) => { @@ -65,13 +76,13 @@ describe("property: buildIssueListCollapse", () => { ); }); - test("length is 3 without stats, 4 with stats", () => { + test("length is 2 without stats, 3 with stats", () => { fcAssert( property(boolean(), (collapseStats) => { const result = buildIssueListCollapse({ shouldCollapseStats: collapseStats, }); - expect(result.length).toBe(collapseStats ? 4 : 3); + expect(result.length).toBe(collapseStats ? 3 : 2); }), { numRuns: DEFAULT_NUM_RUNS } ); From 47e89dfa30afc101423cef2f9a03a5efb120bfa4 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Mon, 18 May 2026 12:14:55 +0000 Subject: [PATCH 2/4] fix(seer): normalize 'canceled' status to 'CANCELLED' to prevent infinite polling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The normalizeAgentStatus function uses a fallback of status.toUpperCase() for unmapped statuses. When the Seer API returns 'canceled' (US spelling), it becomes 'CANCELED' which doesn't match TERMINAL_STATUSES ('CANCELLED' with British spelling). This causes shouldStopPolling to never return true, making the poll loop spin until the 6-minute timeout. Add explicit mappings for 'canceled'/'cancelled' → 'CANCELLED' and 'need_more_information' → 'NEED_MORE_INFORMATION' to ensure all known status values are correctly normalized. Co-authored-by: Miguel Betegón --- src/lib/api/seer.ts | 13 ++++++++-- test/lib/api-client.seer.test.ts | 42 ++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+), 2 deletions(-) diff --git a/src/lib/api/seer.ts b/src/lib/api/seer.ts index c96127410..9fe113b78 100644 --- a/src/lib/api/seer.ts +++ b/src/lib/api/seer.ts @@ -19,8 +19,12 @@ const EXPLORER_MODE_PARAMS = { mode: "explorer" }; * Normalize agent status values to the uppercase format used throughout the CLI. * * The agent endpoint returns lowercase statuses (`processing`, `completed`, - * `error`, `awaiting_user_input`) while the CLI expects uppercase - * (`PROCESSING`, `COMPLETED`, `ERROR`, `WAITING_FOR_USER_RESPONSE`). + * `error`, `awaiting_user_input`, `canceled`) while the CLI expects uppercase + * (`PROCESSING`, `COMPLETED`, `ERROR`, `WAITING_FOR_USER_RESPONSE`, `CANCELLED`). + * + * Explicit mappings are needed for statuses whose CLI name differs from a naive + * toUpperCase() — e.g. `canceled` (US) → `CANCELLED` (British, used in + * TERMINAL_STATUSES), and `awaiting_user_input` → `WAITING_FOR_USER_RESPONSE`. */ function normalizeAgentStatus(status: string): string { switch (status) { @@ -30,8 +34,13 @@ function normalizeAgentStatus(status: string): string { return "COMPLETED"; case "error": return "ERROR"; + case "canceled": + case "cancelled": + return "CANCELLED"; case "awaiting_user_input": return "WAITING_FOR_USER_RESPONSE"; + case "need_more_information": + return "NEED_MORE_INFORMATION"; default: return status.toUpperCase(); } diff --git a/test/lib/api-client.seer.test.ts b/test/lib/api-client.seer.test.ts index 2ffc1bf4a..dd79b6bab 100644 --- a/test/lib/api-client.seer.test.ts +++ b/test/lib/api-client.seer.test.ts @@ -155,6 +155,48 @@ describe("getAutofixState", () => { expect(result?.status).toBe("WAITING_FOR_USER_RESPONSE"); }); + test("normalizes US spelling 'canceled' to CANCELLED for terminal status match", async () => { + globalThis.fetch = async () => + new Response( + JSON.stringify({ + autofix: { + run_id: 1, + status: "canceled", + blocks: [], + updated_at: "2025-01-01T00:00:00Z", + }, + }), + { + status: 200, + headers: { "Content-Type": "application/json" }, + } + ); + + const result = await getAutofixState("test-org", "123456789"); + expect(result?.status).toBe("CANCELLED"); + }); + + test("normalizes need_more_information to NEED_MORE_INFORMATION", async () => { + globalThis.fetch = async () => + new Response( + JSON.stringify({ + autofix: { + run_id: 1, + status: "need_more_information", + blocks: [], + updated_at: "2025-01-01T00:00:00Z", + }, + }), + { + status: 200, + headers: { "Content-Type": "application/json" }, + } + ); + + const result = await getAutofixState("test-org", "123456789"); + expect(result?.status).toBe("NEED_MORE_INFORMATION"); + }); + test("returns null when autofix is null", async () => { globalThis.fetch = async () => new Response(JSON.stringify({ autofix: null }), { From ceae8d700a6c009423b73bd88c658f62fec36807 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Mon, 18 May 2026 12:16:13 +0000 Subject: [PATCH 3/4] fix(seer): extract no-solution reason from step-level description (#958) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Seer API returns solution data directly on steps with key='solution' rather than inside the artifacts array (which is always empty on the new API). extractNoSolutionReason only searched artifacts, so when Seer couldn't produce a solution, the description explaining why was missed and users got a generic 'No solution found' message. Add searchContainersForStepLevelNoSolutionReason that checks for steps where key='solution' with an empty/missing solution array and returns the description field. Step-level reasons are preferred over artifact- level (legacy fallback). Co-authored-by: Miguel Betegón --- src/types/seer.ts | 68 +++++++++++++++++++++++++++++++++-------- test/types/seer.test.ts | 57 ++++++++++++++++++++++++++++++++++ 2 files changed, 112 insertions(+), 13 deletions(-) diff --git a/src/types/seer.ts b/src/types/seer.ts index 74fb3193b..b06910483 100644 --- a/src/types/seer.ts +++ b/src/types/seer.ts @@ -380,7 +380,7 @@ function findNoSolutionReason(artifacts: ArtifactEntry[]): string | undefined { } /** - * Search containers (blocks or steps) for a no-solution reason. + * Search containers (blocks or steps) for a no-solution reason in artifacts. */ function searchContainersForNoSolutionReason( containers: WithArtifacts[] @@ -396,6 +396,28 @@ function searchContainersForNoSolutionReason( return; } +/** + * Search containers for step-level no-solution reason. + * + * The Seer API returns solution data directly on steps with `key === "solution"`. + * When no solution is produced, the step has an empty/missing `solution` array + * but its `description` field carries the reason why no fix was found. + */ +function searchContainersForStepLevelNoSolutionReason( + containers: StepWithSolution[] +): string | undefined { + for (const container of containers) { + if ( + container.key === "solution" && + (!container.solution || container.solution.length === 0) && + container.description + ) { + return container.description; + } + } + return; +} + /** * Search an array of containers (blocks or steps) for a solution artifact. */ @@ -513,32 +535,52 @@ export function extractSolution(state: AutofixState): SolutionArtifact | null { /** * Extract the reason why no solution was produced. * - * When Seer completes analysis but cannot produce a code fix, the API - * returns a solution artifact with `data: null` and a `reason` string. - * This function searches blocks and steps for that reason. + * Searches blocks and steps for a no-solution reason in two places: + * 1. Step-level: `step.key === "solution"` with empty `solution[]` and a + * `description` explaining why (current API format). + * 2. Artifact-level: `artifact.key === "solution"` with a `reason` field + * (legacy format, kept as fallback). * - * @param state - Autofix state (may contain blocks or steps with artifacts) + * @param state - Autofix state (may contain blocks or steps with solution data) * @returns Reason string if found, undefined otherwise */ export function extractNoSolutionReason( state: AutofixState ): string | undefined { const stateWithExtras = state as AutofixState & { - blocks?: WithArtifacts[]; - steps?: WithArtifacts[]; + blocks?: (WithArtifacts & StepWithSolution)[]; + steps?: (WithArtifacts & StepWithSolution)[]; }; + // Search blocks first (explorer mode / newer API) if (stateWithExtras.blocks) { - const reason = searchContainersForNoSolutionReason(stateWithExtras.blocks); - if (reason) { - return reason; + const stepLevel = searchContainersForStepLevelNoSolutionReason( + stateWithExtras.blocks + ); + if (stepLevel) { + return stepLevel; + } + const artifactLevel = searchContainersForNoSolutionReason( + stateWithExtras.blocks + ); + if (artifactLevel) { + return artifactLevel; } } + // Search steps (regular autofix API) if (stateWithExtras.steps) { - const reason = searchContainersForNoSolutionReason(stateWithExtras.steps); - if (reason) { - return reason; + const stepLevel = searchContainersForStepLevelNoSolutionReason( + stateWithExtras.steps + ); + if (stepLevel) { + return stepLevel; + } + const artifactLevel = searchContainersForNoSolutionReason( + stateWithExtras.steps + ); + if (artifactLevel) { + return artifactLevel; } } diff --git a/test/types/seer.test.ts b/test/types/seer.test.ts index 957170367..84e46acef 100644 --- a/test/types/seer.test.ts +++ b/test/types/seer.test.ts @@ -345,6 +345,63 @@ describe("extractNoSolutionReason", () => { const state: AutofixState = { run_id: 1, status: "COMPLETED" }; expect(extractNoSolutionReason(state)).toBeUndefined(); }); + + test("extracts reason from step-level description when solution is empty", () => { + const state = { + run_id: 1, + status: "NEED_MORE_INFORMATION", + blocks: [ + { + key: "solution", + description: + "Cannot produce a fix: the issue is in a third-party library", + solution: [], + artifacts: [], + }, + ], + } as unknown as AutofixState; + + expect(extractNoSolutionReason(state)).toBe( + "Cannot produce a fix: the issue is in a third-party library" + ); + }); + + test("extracts reason from step-level when solution field is missing", () => { + const state = { + run_id: 1, + status: "NEED_MORE_INFORMATION", + steps: [ + { + key: "solution", + description: "Infrastructure-level issue, no code change applicable", + artifacts: [], + }, + ], + } as unknown as AutofixState; + + expect(extractNoSolutionReason(state)).toBe( + "Infrastructure-level issue, no code change applicable" + ); + }); + + test("prefers step-level reason over artifact-level reason", () => { + const state = { + run_id: 1, + status: "COMPLETED", + blocks: [ + { + key: "solution", + description: "Step-level reason", + solution: [], + artifacts: [ + { key: "solution", data: null, reason: "Artifact-level reason" }, + ], + }, + ], + } as unknown as AutofixState; + + expect(extractNoSolutionReason(state)).toBe("Step-level reason"); + }); }); describe("extractSolution", () => { From 8cb9f4f74dd00474aa0a3587bfb93a1bf8dcc0fc Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 18 May 2026 12:19:43 +0000 Subject: [PATCH 4/4] chore: regenerate docs --- plugins/sentry-cli/skills/sentry-cli/SKILL.md | 25 +++- .../skills/sentry-cli/references/api.md | 40 ++++++ .../skills/sentry-cli/references/auth.md | 42 ++++++ .../skills/sentry-cli/references/cli.md | 50 +++++++ .../skills/sentry-cli/references/dashboard.md | 83 +++++++++++ .../skills/sentry-cli/references/event.md | 35 +++++ .../skills/sentry-cli/references/explore.md | 57 ++++++++ .../skills/sentry-cli/references/init.md | 28 ++++ .../skills/sentry-cli/references/issue.md | 135 ++++++++++++++++++ .../skills/sentry-cli/references/log.md | 39 +++++ .../skills/sentry-cli/references/org.md | 16 +++ .../skills/sentry-cli/references/project.md | 39 +++++ .../skills/sentry-cli/references/release.md | 51 +++++++ .../skills/sentry-cli/references/replay.md | 36 +++++ .../skills/sentry-cli/references/repo.md | 13 ++ .../skills/sentry-cli/references/schema.md | 19 +++ .../skills/sentry-cli/references/sourcemap.md | 28 ++++ .../skills/sentry-cli/references/span.md | 41 ++++++ .../skills/sentry-cli/references/team.md | 13 ++ .../skills/sentry-cli/references/trace.md | 54 +++++++ .../skills/sentry-cli/references/trial.md | 19 +++ 21 files changed, 861 insertions(+), 2 deletions(-) diff --git a/plugins/sentry-cli/skills/sentry-cli/SKILL.md b/plugins/sentry-cli/skills/sentry-cli/SKILL.md index b6bf48dc1..df00799cf 100644 --- a/plugins/sentry-cli/skills/sentry-cli/SKILL.md +++ b/plugins/sentry-cli/skills/sentry-cli/SKILL.md @@ -476,8 +476,29 @@ Browse the Sentry API schema → Full flags and examples: `references/schema.md` +## Global Options + +All commands support the following global options: + +- `--help` - Show help for the command +- `--version` - Show CLI version +- `--log-level ` - Set log verbosity (`error`, `warn`, `log`, `info`, `debug`, `trace`). Overrides `SENTRY_LOG_LEVEL` +- `--verbose` - Shorthand for `--log-level debug` + ## Output Formats -Most commands support `--json` flag for JSON output, making it easy to integrate with other tools. +### JSON Output -View commands support `-w` or `--web` flag to open the resource in your browser. +Most list and view commands support `--json` flag for JSON output, making it easy to integrate with other tools: + +```bash +sentry org list --json | jq '.[] | .slug' +``` + +### Opening in Browser + +View commands support `-w` or `--web` flag to open the resource in your browser: + +```bash +sentry issue view PROJ-123 -w +``` diff --git a/plugins/sentry-cli/skills/sentry-cli/references/api.md b/plugins/sentry-cli/skills/sentry-cli/references/api.md index c4023cbdb..e0fe92d50 100644 --- a/plugins/sentry-cli/skills/sentry-cli/references/api.md +++ b/plugins/sentry-cli/skills/sentry-cli/references/api.md @@ -26,4 +26,44 @@ Make an authenticated API request - `--verbose - Include full HTTP request and response in the output` - `-n, --dry-run - Show the resolved request without sending it` +**Examples:** + +```bash +# List organizations +sentry api organizations/ + +# Get a specific issue +sentry api issues/123456789/ + +# Create a release +sentry api organizations/my-org/releases/ \ + -X POST -F version=1.0.0 + +# With inline JSON body +sentry api issues/123456789/ \ + -X POST -d '{"status": "resolved"}' + +# Update an issue status +sentry api issues/123456789/ \ + -X PUT -F status=resolved + +# Assign an issue +sentry api issues/123456789/ \ + -X PUT --field assignedTo="user@example.com" + +sentry api projects/my-org/my-project/ -X DELETE + +# Add custom headers +sentry api organizations/ -H "X-Custom: value" + +# Read body from a file +sentry api projects/my-org/my-project/releases/ -X POST --input release.json + +# Verbose mode (shows full HTTP request/response) +sentry api organizations/ --verbose + +# Preview the request without sending +sentry api organizations/ --dry-run +``` + All commands also support `--json`, `--fields`, `--help`, `--log-level`, and `--verbose` flags. diff --git a/plugins/sentry-cli/skills/sentry-cli/references/auth.md b/plugins/sentry-cli/skills/sentry-cli/references/auth.md index 5b12e6302..1b06207f7 100644 --- a/plugins/sentry-cli/skills/sentry-cli/references/auth.md +++ b/plugins/sentry-cli/skills/sentry-cli/references/auth.md @@ -21,10 +21,28 @@ Authenticate with Sentry - `--force - Re-authenticate without prompting` - `--url - Sentry instance URL to authenticate against (e.g. https://sentry.example.com). Required for self-hosted; defaults to SaaS (https://sentry.io).` +**Examples:** + +```bash +sentry auth login + +sentry auth login --token YOUR_SENTRY_API_TOKEN + +SENTRY_URL=https://sentry.example.com sentry auth login + +SENTRY_URL=https://sentry.example.com sentry auth login --token YOUR_TOKEN +``` + ### `sentry auth logout` Log out of Sentry +**Examples:** + +```bash +sentry auth logout +``` + ### `sentry auth refresh` Refresh your authentication token @@ -32,6 +50,12 @@ Refresh your authentication token **Flags:** - `--force - Force refresh even if token is still valid` +**Examples:** + +```bash +sentry auth refresh +``` + ### `sentry auth status` View authentication status @@ -40,10 +64,28 @@ View authentication status - `--show-token - Show the stored token (masked by default)` - `-f, --fresh - Bypass cache, re-detect projects, and fetch fresh data` +**Examples:** + +```bash +sentry auth status + +# Show the raw token +sentry auth status --show-token + +# View current user +sentry auth whoami +``` + ### `sentry auth token` Print the stored authentication token +**Examples:** + +```bash +sentry auth token +``` + ### `sentry auth whoami` Show the currently authenticated identity diff --git a/plugins/sentry-cli/skills/sentry-cli/references/cli.md b/plugins/sentry-cli/skills/sentry-cli/references/cli.md index 5300c7df1..a029e08c0 100644 --- a/plugins/sentry-cli/skills/sentry-cli/references/cli.md +++ b/plugins/sentry-cli/skills/sentry-cli/references/cli.md @@ -24,6 +24,16 @@ View and manage default settings Send feedback about the CLI +**Examples:** + +```bash +# Send positive feedback +sentry cli feedback i love this tool + +# Report an issue +sentry cli feedback the issue view is confusing +``` + ### `sentry cli fix` Diagnose and repair CLI database issues @@ -31,6 +41,12 @@ Diagnose and repair CLI database issues **Flags:** - `--dry-run - Show what would be fixed without making changes` +**Examples:** + +```bash +sentry cli fix +``` + ### `sentry cli setup` Configure shell integration @@ -44,6 +60,19 @@ Configure shell integration - `--no-agent-skills - Skip agent skill installation for AI coding assistants` - `--quiet - Suppress output (for scripted usage)` +**Examples:** + +```bash +# Run full setup (PATH, completions, agent skills) +sentry cli setup + +# Skip agent skill installation +sentry cli setup --no-agent-skills + +# Skip PATH and completion modifications +sentry cli setup --no-modify-path --no-completions +``` + ### `sentry cli upgrade ` Update the Sentry CLI to the latest version @@ -54,4 +83,25 @@ Update the Sentry CLI to the latest version - `--offline - Upgrade using only cached version info and patches (no network)` - `--method - Installation method to use (curl, brew, npm, pnpm, bun, yarn)` +**Examples:** + +```bash +sentry cli upgrade --check + +# Upgrade to latest stable +sentry cli upgrade + +# Upgrade to a specific version +sentry cli upgrade 0.5.0 + +# Force re-download +sentry cli upgrade --force + +# Switch to nightly builds +sentry cli upgrade nightly + +# Switch back to stable +sentry cli upgrade stable +``` + All commands also support `--json`, `--fields`, `--help`, `--log-level`, and `--verbose` flags. diff --git a/plugins/sentry-cli/skills/sentry-cli/references/dashboard.md b/plugins/sentry-cli/skills/sentry-cli/references/dashboard.md index 5ddb38ed6..4a8df0d38 100644 --- a/plugins/sentry-cli/skills/sentry-cli/references/dashboard.md +++ b/plugins/sentry-cli/skills/sentry-cli/references/dashboard.md @@ -21,6 +21,19 @@ List dashboards - `-f, --fresh - Bypass cache, re-detect projects, and fetch fresh data` - `-c, --cursor - Navigate pages: "next", "prev", "first" (or raw cursor string)` +**Examples:** + +```bash +# List all dashboards +sentry dashboard list + +# Filter by name pattern +sentry dashboard list "Backend*" + +# Open dashboard list in browser +sentry dashboard list -w +``` + ### `sentry dashboard view ` View a dashboard @@ -31,10 +44,32 @@ View a dashboard - `-r, --refresh - Auto-refresh interval in seconds (default: 60, min: 10)` - `-t, --period - Time range: "7d", "2026-04-01..2026-05-01", ">=2026-04-01"` +**Examples:** + +```bash +# View by title +sentry dashboard view 'Frontend Performance' + +# View by ID +sentry dashboard view 12345 + +# Auto-refresh every 30 seconds +sentry dashboard view "Backend Performance" --refresh 30 + +# Open in browser +sentry dashboard view 12345 -w +``` + ### `sentry dashboard create ` Create a dashboard +**Examples:** + +```bash +sentry dashboard create 'Frontend Performance' +``` + ### `sentry dashboard widget add ` Add a widget to a dashboard @@ -53,6 +88,31 @@ Add a widget to a dashboard - `--height - Widget height in grid rows (min 1)` - `-l, --layout - Layout mode: sequential (append in order) or dense (fill gaps) - (default: "sequential")` +**Examples:** + +```bash +# Simple counter widget +sentry dashboard widget add 'My Dashboard' "Error Count" \ + --display big_number --query count + +# Line chart with group-by +sentry dashboard widget add 'My Dashboard' "Errors by Browser" \ + --display line --query count --group-by browser.name + +# Table with multiple aggregates, sorted descending +sentry dashboard widget add 'My Dashboard' "Top Endpoints" \ + --display table \ + --query count --query p95:span.duration \ + --group-by transaction \ + --sort -count --limit 10 + +# With search filter +sentry dashboard widget add 'My Dashboard' "Slow Requests" \ + --display bar --query p95:span.duration \ + --where "span.op:http.client" \ + --group-by span.description +``` + ### `sentry dashboard widget edit ` Edit a widget in a dashboard @@ -73,6 +133,19 @@ Edit a widget in a dashboard - `--width - Widget width in grid columns (1–6)` - `--height - Widget height in grid rows (min 1)` +**Examples:** + +```bash +# Change display type +sentry dashboard widget edit 12345 --title 'Error Count' --display bar + +# Rename a widget +sentry dashboard widget edit 'My Dashboard' --index 0 --new-title 'Total Errors' + +# Change the query +sentry dashboard widget edit 12345 --title 'Error Rate' --query p95:span.duration +``` + ### `sentry dashboard widget delete ` Delete a widget from a dashboard @@ -84,6 +157,16 @@ Delete a widget from a dashboard - `-f, --force - Force the operation without confirmation` - `-n, --dry-run - Show what would happen without making changes` +**Examples:** + +```bash +# Delete by title +sentry dashboard widget delete 'My Dashboard' --title 'Error Count' + +# Delete by index +sentry dashboard widget delete 12345 --index 2 +``` + ### `sentry dashboard revisions ` List dashboard revisions diff --git a/plugins/sentry-cli/skills/sentry-cli/references/event.md b/plugins/sentry-cli/skills/sentry-cli/references/event.md index 025f45f59..e17fb3f64 100644 --- a/plugins/sentry-cli/skills/sentry-cli/references/event.md +++ b/plugins/sentry-cli/skills/sentry-cli/references/event.md @@ -20,6 +20,15 @@ View details of one or more events - `--spans - Span tree depth limit (number, "all" for unlimited, "no" to disable) - (default: "3")` - `-f, --fresh - Bypass cache, re-detect projects, and fetch fresh data` +**Examples:** + +```bash +sentry event view abc123def456abc123def456abc12345 + +# Open in browser +sentry event view abc123def456abc123def456abc12345 -w +``` + ### `sentry event list ` List events for an issue @@ -52,4 +61,30 @@ List events for an issue | `crashFile` | string \| null | Crash file URL | | `metadata` | object \| null | Event metadata | +**Examples:** + +```bash +# List events for an issue (using short ID) +sentry event list PROJ-ABC + +# List events for an issue (using numeric ID) +sentry event list 123456789 + +# Filter by search query +sentry event list PROJ-ABC --query "browser:Chrome" + +# Include full event bodies (stacktraces) +sentry event list PROJ-ABC --full + +# Limit results and time range +sentry event list PROJ-ABC --limit 50 --period 24h + +# Paginate through results +sentry event list PROJ-ABC -c next +sentry event list PROJ-ABC -c prev + +# Output as JSON +sentry event list PROJ-ABC --json +``` + All commands also support `--json`, `--fields`, `--help`, `--log-level`, and `--verbose` flags. diff --git a/plugins/sentry-cli/skills/sentry-cli/references/explore.md b/plugins/sentry-cli/skills/sentry-cli/references/explore.md index b70b3b254..aa0dc82fd 100644 --- a/plugins/sentry-cli/skills/sentry-cli/references/explore.md +++ b/plugins/sentry-cli/skills/sentry-cli/references/explore.md @@ -28,4 +28,61 @@ Query aggregate event data (Explore) - `-f, --fresh - Bypass cache, re-detect projects, and fetch fresh data` - `-c, --cursor - Navigate pages: "next", "prev", "first" (or raw cursor string)` +**Examples:** + +```bash +# Top errors in the last 24 hours, scoped to a project +sentry explore my-org/cli + +# All projects in an org +sentry explore my-org/ + +# Bare project slug (searches across orgs) +sentry explore cli + +# Auto-detect from DSN/config +sentry explore + +# Errors with user impact for a specific UTC window +sentry explore my-org/cli -F title -F "count()" -F "count_unique(user)" \ + --period "2024-01-15T00:00:00Z/2024-01-16T00:00:00Z" + +# Filter by specific error type (combines with auto-injected project filter) +sentry explore my-org/cli -F title -F "count()" \ + -q "error.type:TypeError" --period 1h + +# Span operation latency by route +sentry explore my-org/cli -F span.op -F "p50(span.duration)" \ + -F "p95(span.duration)" --dataset spans --period 1h + +# Top spans by count +sentry explore my-org/cli -F span.op -F "count()" \ + --dataset spans --sort "-count()" + +# Sum a custom metric (e.g., LLM token usage) across an org +sentry explore my-org/ -m llm.token_usage --dataset metrics --period 7d + +# Break down by a tag column (e.g., model name) +sentry explore my-org/seer -F gen_ai.request.model \ + -m llm.token_usage --dataset metrics --period 7d + +# Use a different aggregation (default is sum) +sentry explore my-org/ -m cache.hit_rate --agg avg --dataset metrics + +sentry explore my-org/ \ + -F "sum(value,llm.token_usage,distribution,none)" \ + --dataset metrics --period 7d + +# Log severity counts in the last hour +sentry explore my-org/cli -F severity -F "count()" \ + --dataset logs --period 1h + +# Pipe to jq for filtering +sentry explore my-org/cli -F title -F "count()" --json | jq '.data[:5]' + +# Get raw data for analysis +sentry explore my-org/cli -F title -F "count()" -F "count_unique(user)" \ + --json --limit 100 +``` + All commands also support `--json`, `--fields`, `--help`, `--log-level`, and `--verbose` flags. diff --git a/plugins/sentry-cli/skills/sentry-cli/references/init.md b/plugins/sentry-cli/skills/sentry-cli/references/init.md index 09bbd26e6..802a23900 100644 --- a/plugins/sentry-cli/skills/sentry-cli/references/init.md +++ b/plugins/sentry-cli/skills/sentry-cli/references/init.md @@ -22,4 +22,32 @@ Initialize Sentry in your project (experimental) - `-t, --team - Team slug to create the project under` - `--tui - Use the Ink-based interactive UI (default). Pass --no-tui to fall back to plain log output.` +**Examples:** + +```bash +# Interactive setup +sentry init + +# Non-interactive agent/CI setup +sentry init --yes --features errors,tracing,replay + +# Dry run to preview changes +sentry init --dry-run + +# Target a subdirectory +sentry init ./my-app + +# Use a specific org (auto-detect project) +sentry init acme/ + +# Use a specific org and project +sentry init acme/my-app + +# Assign a team when creating a new project +sentry init acme/ --team backend + +# Enable specific features +sentry init --features profiling,replay +``` + All commands also support `--json`, `--fields`, `--help`, `--log-level`, and `--verbose` flags. diff --git a/plugins/sentry-cli/skills/sentry-cli/references/issue.md b/plugins/sentry-cli/skills/sentry-cli/references/issue.md index cc66e6608..448b6546b 100644 --- a/plugins/sentry-cli/skills/sentry-cli/references/issue.md +++ b/plugins/sentry-cli/skills/sentry-cli/references/issue.md @@ -48,6 +48,37 @@ List issues in a project | `isUnhandled` | boolean | Whether the issue is unhandled | | `seerFixabilityScore` | number \| null | Seer AI fixability score (0-1) | +**Examples:** + +```bash +# List issues in a specific project +sentry issue list my-org/frontend + +# All projects in an org +sentry issue list my-org/ + +# Search for a project across organizations +sentry issue list frontend + +# Show only unresolved issues +sentry issue list my-org/frontend --query "is:unresolved" + +# Show resolved issues +sentry issue list my-org/frontend --query "is:resolved" + +# Sort by frequency +sentry issue list my-org/frontend --sort freq --limit 20 + +# Multiple filters (space-separated = implicit AND) +sentry issue list --query "is:unresolved level:error assigned:me" + +# Negation and wildcards +sentry issue list --query "!browser:Chrome message:*timeout*" + +# Match multiple values for one key (in-list syntax) +sentry issue list --query "browser:[Chrome,Firefox]" +``` + ### `sentry issue events ` List events for a specific issue @@ -88,6 +119,25 @@ Analyze an issue's root cause using Seer AI - `--force - Force new analysis even if one exists` - `-f, --fresh - Bypass cache, re-detect projects, and fetch fresh data` +**Examples:** + +```bash +# Analyze root cause (may take a few minutes for new issues) +sentry issue explain 123456789 + +# By short ID with org prefix +sentry issue explain my-org/MYPROJECT-ABC + +# Force a fresh analysis +sentry issue explain 123456789 --force + +# Generate a fix plan (requires explain to be run first) +sentry issue plan 123456789 + +# Specify which root cause to plan for +sentry issue plan 123456789 --cause 0 +``` + ### `sentry issue plan ` Generate a solution plan using Seer AI @@ -105,6 +155,15 @@ View details of a specific issue - `--spans - Span tree depth limit (number, "all" for unlimited, "no" to disable) - (default: "3")` - `-f, --fresh - Bypass cache, re-detect projects, and fetch fresh data` +**Examples:** + +```bash +sentry issue view FRONT-ABC + +# Open in browser +sentry issue view FRONT-ABC -w +``` + ### `sentry issue resolve ` Mark an issue as resolved @@ -112,6 +171,35 @@ Mark an issue as resolved **Flags:** - `-i, --in - Resolve in a release, next release, or commit ('' | '@next' | '@commit' | '@commit:@')` +**Examples:** + +```bash +# Resolve immediately (no regression tracking) +sentry issue resolve CLI-G5 + +# Resolve in a specific release — future events on newer releases are +# regression-flagged +sentry issue resolve CLI-G5 --in 0.26.1 + +# Monorepo-style releases work too (no special parsing) +sentry issue resolve CLI-G5 --in spotlight@1.2.3 + +# Resolve in the next release (tied to current HEAD) +sentry issue resolve CLI-G5 --in @next +sentry issue resolve CLI-G5 -i @next + +# Resolve in the current git HEAD — auto-detects the Sentry repo from +# your git origin remote (hard-errors if it can't) +sentry issue resolve CLI-G5 --in @commit + +# Explicit commit + repo (no git inspection; repo must be registered in Sentry) +sentry issue resolve CLI-G5 --in @commit:getsentry/cli@abc123def + +# Reopen a resolved issue +sentry issue unresolve CLI-G5 +sentry issue reopen CLI-G5 # alias +``` + ### `sentry issue unresolve ` Reopen a resolved issue @@ -123,6 +211,37 @@ Archive (ignore) an issue **Flags:** - `-u, --until - Condition for unarchival: forever, auto, 30m, 10x, 10u, 10x/5m, etc.` +**Examples:** + +```bash +# Archive forever (fully silenced) +sentry issue archive CLI-G5 + +# Smart detection — unarchives when Sentry detects a spike in event frequency +sentry issue archive CLI-G5 --until auto + +# Duration-based +sentry issue archive CLI-G5 --until 1h # 1 hour +sentry issue archive CLI-G5 --until 7d # 7 days +sentry issue archive CLI-G5 --until 2026-12-31 # specific date + +# Count-based — unarchive after N more events +sentry issue archive CLI-G5 --until 100x + +# User-based — unarchive after N more users affected +sentry issue archive CLI-G5 --until 10u + +# Compound — count within a time window +sentry issue archive CLI-G5 --until 100x/1h # 100 events within 1 hour +sentry issue archive CLI-G5 --until 10u/1d # 10 users within 1 day + +# Verbose forms also work +sentry issue archive CLI-G5 --until 10events/2hours + +# 'ignore' is an alias for 'archive' +sentry issue ignore CLI-G5 --until auto +``` + ### `sentry issue merge ` Merge 2+ issues into a single canonical group @@ -130,4 +249,20 @@ Merge 2+ issues into a single canonical group **Flags:** - `-i, --into - Prefer this issue as the canonical parent (must match one of the provided IDs)` +**Examples:** + +```bash +# Let Sentry auto-pick the parent (typically the largest by event count) +sentry issue merge CLI-K9 CLI-15H CLI-15N + +# Pin the canonical parent explicitly — accepts the same formats as +# positional args, including org-qualified and project-alias forms +sentry issue merge CLI-K9 CLI-15H CLI-15N --into CLI-K9 +sentry issue merge my-org/CLI-K9 my-org/CLI-15H --into my-org/CLI-K9 +sentry issue merge cli-k9 cli-15h --into cli-k9 # alias form + +# Cross-org merges are rejected — all issues must share an organization +# Non-error issue types (performance, info, etc.) cannot be merged +``` + All commands also support `--json`, `--fields`, `--help`, `--log-level`, and `--verbose` flags. diff --git a/plugins/sentry-cli/skills/sentry-cli/references/log.md b/plugins/sentry-cli/skills/sentry-cli/references/log.md index 749f29e6f..54355ca2e 100644 --- a/plugins/sentry-cli/skills/sentry-cli/references/log.md +++ b/plugins/sentry-cli/skills/sentry-cli/references/log.md @@ -34,6 +34,33 @@ List logs from a project | `severity` | string \| null | Severity level (error, warning, info, debug) | | `trace` | string \| null | Trace ID for correlation | +**Examples:** + +```bash +# List last 100 logs (default) +sentry log list + +# Show only error logs +sentry log list -q 'level:error' + +# Filter by message content +sentry log list -q 'database' + +# Limit results +sentry log list --limit 50 + +# Stream with default 2-second poll interval +sentry log list -f + +# Stream with custom 5-second poll interval +sentry log list -f 5 + +# Stream error logs from a specific project +sentry log list my-org/backend -f -q 'level:error' + +sentry log list --json | jq '.data[] | select(.severity == "error")' +``` + ### `sentry log view ` View details of one or more log entries @@ -42,4 +69,16 @@ View details of one or more log entries - `-w, --web - Open in browser` - `-f, --fresh - Bypass cache, re-detect projects, and fetch fresh data` +**Examples:** + +```bash +sentry log view 968c763c740cfda8b6728f27fb9e9b01 + +# With explicit project +sentry log view my-org/backend 968c763c740cfda8b6728f27fb9e9b01 + +# Open in browser +sentry log view 968c763c740cfda8b6728f27fb9e9b01 -w +``` + All commands also support `--json`, `--fields`, `--help`, `--log-level`, and `--verbose` flags. diff --git a/plugins/sentry-cli/skills/sentry-cli/references/org.md b/plugins/sentry-cli/skills/sentry-cli/references/org.md index 0b9284aca..cdda42ff7 100644 --- a/plugins/sentry-cli/skills/sentry-cli/references/org.md +++ b/plugins/sentry-cli/skills/sentry-cli/references/org.md @@ -27,4 +27,20 @@ View details of an organization - `-w, --web - Open in browser` - `-f, --fresh - Bypass cache, re-detect projects, and fetch fresh data` +**Examples:** + +```bash +# List organizations +sentry org list + +# View organization details +sentry org view my-org + +# Open in browser +sentry org view my-org -w + +# JSON output +sentry org list --json +``` + All commands also support `--json`, `--fields`, `--help`, `--log-level`, and `--verbose` flags. diff --git a/plugins/sentry-cli/skills/sentry-cli/references/project.md b/plugins/sentry-cli/skills/sentry-cli/references/project.md index 6a042a74c..70ecb1ab3 100644 --- a/plugins/sentry-cli/skills/sentry-cli/references/project.md +++ b/plugins/sentry-cli/skills/sentry-cli/references/project.md @@ -19,6 +19,19 @@ Create a new project - `-t, --team - Team to create the project under` - `-n, --dry-run - Show what would happen without making changes` +**Examples:** + +```bash +# Create a new project +sentry project create my-new-app javascript-nextjs + +# Create under a specific org and team +sentry project create my-org/my-new-app python --team backend-team + +# Preview without creating +sentry project create my-new-app node --dry-run +``` + ### `sentry project delete ` Delete a project @@ -28,6 +41,16 @@ Delete a project - `-f, --force - Force the operation without confirmation` - `-n, --dry-run - Show what would happen without making changes` +**Examples:** + +```bash +# Delete a project (will prompt for confirmation) +sentry project delete my-org/old-project + +# Delete without confirmation +sentry project delete my-org/old-project --yes +``` + ### `sentry project list ` List projects @@ -46,4 +69,20 @@ View details of a project - `-w, --web - Open in browser` - `-f, --fresh - Bypass cache, re-detect projects, and fetch fresh data` +**Examples:** + +```bash +# List all projects in an org +sentry project list my-org/ + +# Filter by platform +sentry project list my-org/ --platform javascript + +# View project details +sentry project view my-org/frontend + +# Open project in browser +sentry project view my-org/frontend -w +``` + All commands also support `--json`, `--fields`, `--help`, `--log-level`, and `--verbose` flags. diff --git a/plugins/sentry-cli/skills/sentry-cli/references/release.md b/plugins/sentry-cli/skills/sentry-cli/references/release.md index 4112254a6..d928d3d7e 100644 --- a/plugins/sentry-cli/skills/sentry-cli/references/release.md +++ b/plugins/sentry-cli/skills/sentry-cli/references/release.md @@ -90,4 +90,55 @@ Set commits for a release Propose a release version +**Examples:** + +```bash +# List releases (auto-detect org) +sentry release list + +# List releases in a specific org +sentry release list my-org/ + +# View release details +sentry release view 1.0.0 +sentry release view my-org/1.0.0 + +# Create and finalize a release +sentry release create 1.0.0 --finalize + +# Create a release, then finalize separately +sentry release create 1.0.0 +sentry release set-commits 1.0.0 --auto +sentry release finalize 1.0.0 + +# Set commits from local git history +sentry release set-commits 1.0.0 --local + +# Create a deploy +sentry release deploy 1.0.0 production +sentry release deploy 1.0.0 staging "Deploy #42" + +# Propose a version from git HEAD +sentry release create $(sentry release propose-version) + +# List deploys for a release +sentry release deploys 1.0.0 +sentry release deploys my-org/1.0.0 + +# Delete a release +sentry release delete my-org/1.0.0 +sentry release delete my-org/1.0.0 --yes # Skip confirmation +sentry release delete my-org/1.0.0 --dry-run # Preview without deleting + +# Output as JSON +sentry release list --json +sentry release view 1.0.0 --json + +# Full release workflow with explicit org +sentry release create my-org/1.0.0 --project my-project +sentry release set-commits my-org/1.0.0 --auto +sentry release finalize my-org/1.0.0 +sentry release deploy my-org/1.0.0 production +``` + All commands also support `--json`, `--fields`, `--help`, `--log-level`, and `--verbose` flags. diff --git a/plugins/sentry-cli/skills/sentry-cli/references/replay.md b/plugins/sentry-cli/skills/sentry-cli/references/replay.md index 2a49cb726..224b9902b 100644 --- a/plugins/sentry-cli/skills/sentry-cli/references/replay.md +++ b/plugins/sentry-cli/skills/sentry-cli/references/replay.md @@ -60,6 +60,26 @@ List recent Session Replays | `user` | object \| null | User metadata | | `warning_ids` | array | Linked warning event IDs | +**Examples:** + +```bash +# List recent replays for a project +sentry replay list my-org/frontend + +# Search across all projects in an org +sentry replay list my-org/ --query "environment:production" + +# Change the time window and sort +sentry replay list my-org/frontend --period 24h --sort errors + +# Paginate through results +sentry replay list my-org/frontend -c next +sentry replay list my-org/frontend -c prev + +# Output machine-readable data +sentry replay list my-org/frontend --json +``` + ### `sentry replay view ` View a Session Replay @@ -109,4 +129,20 @@ View a Session Replay | `relatedIssues` | array | Replay-related issues | | `relatedTraces` | array | Replay-related traces | +**Examples:** + +```bash +# View a replay by ID using auto-detected org/project context +sentry replay view 346789a703f6454384f1de473b8b9fcc + +# View a replay with an explicit org +sentry replay view my-org/346789a703f6454384f1de473b8b9fcc + +# View a replay with explicit org/project context +sentry replay view my-org/frontend/346789a703f6454384f1de473b8b9fcc + +# Open a replay in the browser +sentry replay view my-org/346789a703f6454384f1de473b8b9fcc --web +``` + All commands also support `--json`, `--fields`, `--help`, `--log-level`, and `--verbose` flags. diff --git a/plugins/sentry-cli/skills/sentry-cli/references/repo.md b/plugins/sentry-cli/skills/sentry-cli/references/repo.md index c8bd952a9..57a8bb3ea 100644 --- a/plugins/sentry-cli/skills/sentry-cli/references/repo.md +++ b/plugins/sentry-cli/skills/sentry-cli/references/repo.md @@ -34,4 +34,17 @@ List repositories | `externalSlug` | string \| null | External slug (e.g. org/repo) | | `externalId` | string \| null | External ID | +**Examples:** + +```bash +# List repositories (auto-detect org) +sentry repo list + +# List repos in a specific org with pagination +sentry repo list my-org/ -c next + +# Output as JSON +sentry repo list --json +``` + All commands also support `--json`, `--fields`, `--help`, `--log-level`, and `--verbose` flags. diff --git a/plugins/sentry-cli/skills/sentry-cli/references/schema.md b/plugins/sentry-cli/skills/sentry-cli/references/schema.md index 3523d3e34..32a4603f9 100644 --- a/plugins/sentry-cli/skills/sentry-cli/references/schema.md +++ b/plugins/sentry-cli/skills/sentry-cli/references/schema.md @@ -19,4 +19,23 @@ Browse the Sentry API schema - `--all - Show all endpoints in a flat list` - `-q, --search - Search endpoints by keyword` +**Examples:** + +```bash +# List all API resources +sentry schema + +# Browse issue endpoints +sentry schema issues + +# View details for a specific operation +sentry schema issues list + +# Search for monitoring-related endpoints +sentry schema --search monitor + +# Flat list of every endpoint +sentry schema --all +``` + All commands also support `--json`, `--fields`, `--help`, `--log-level`, and `--verbose` flags. diff --git a/plugins/sentry-cli/skills/sentry-cli/references/sourcemap.md b/plugins/sentry-cli/skills/sentry-cli/references/sourcemap.md index fde59832d..0a2338629 100644 --- a/plugins/sentry-cli/skills/sentry-cli/references/sourcemap.md +++ b/plugins/sentry-cli/skills/sentry-cli/references/sourcemap.md @@ -22,6 +22,19 @@ Inject debug IDs into JavaScript files and sourcemaps - `--dry-run - Show what would be modified without writing` - `--allow-empty - Exit successfully when no JS + sourcemap pairs are found (default: error out to catch silent build misconfigurations)` +**Examples:** + +```bash +# Inject debug IDs into all JS files in dist/ +sentry sourcemap inject ./dist + +# Preview changes without writing +sentry sourcemap inject ./dist --dry-run + +# Only process specific extensions +sentry sourcemap inject ./build --ext .js,.mjs +``` + ### `sentry sourcemap upload ` Upload sourcemaps to Sentry @@ -38,4 +51,19 @@ Upload sourcemaps to Sentry - `--no-rewrite - Upload files as-is without injecting debug IDs` - `--allow-empty - Exit successfully when no JS + sourcemap pairs are found (default: error out to catch silent build misconfigurations)` +**Examples:** + +```bash +# Upload sourcemaps from dist/ +sentry sourcemap upload ./dist + +# Associate with a release +sentry sourcemap upload ./dist --release 1.0.0 + +# Set a custom URL prefix +sentry sourcemap upload ./dist --url-prefix '~/static/js/' + +sentry sourcemap upload ./dist --allow-empty +``` + All commands also support `--json`, `--fields`, `--help`, `--log-level`, and `--verbose` flags. diff --git a/plugins/sentry-cli/skills/sentry-cli/references/span.md b/plugins/sentry-cli/skills/sentry-cli/references/span.md index 92e678498..fe03b4aa0 100644 --- a/plugins/sentry-cli/skills/sentry-cli/references/span.md +++ b/plugins/sentry-cli/skills/sentry-cli/references/span.md @@ -37,6 +37,34 @@ List spans in a project or trace | `transaction` | string \| null | Transaction name | | `trace` | string | Trace ID | +**Examples:** + +```bash +# List recent spans in the current project +sentry span list + +# Find all DB spans +sentry span list -q "op:db" + +# Slow spans in the last 24 hours +sentry span list -q "duration:>100ms" --period 24h + +# List spans within a specific trace +sentry span list abc123def456abc123def456abc12345 + +# Paginate through results +sentry span list -c next + +# Show only spans from one project within a trace +sentry span list my-org/cli-server/abc123def456abc123def456abc12345 + +# Or use --query to filter by project +sentry span list abc123def456abc123def456abc12345 -q "project:cli-server" + +# Multiple projects at once +sentry span list abc123def456abc123def456abc12345 -q "project:[cli-server,api]" +``` + ### `sentry span view ` View details of specific spans @@ -45,4 +73,17 @@ View details of specific spans - `--spans - Span tree depth limit (number, "all" for unlimited, "no" to disable) - (default: "3")` - `-f, --fresh - Bypass cache, re-detect projects, and fetch fresh data` +**Examples:** + +```bash +# View a single span +sentry span view abc123def456abc123def456abc12345 a1b2c3d4e5f67890 + +# View multiple spans at once +sentry span view abc123def456abc123def456abc12345 a1b2c3d4e5f67890 b2c3d4e5f6789012 + +# With explicit org/project +sentry span view my-org/backend/abc123def456abc123def456abc12345 a1b2c3d4e5f67890 +``` + All commands also support `--json`, `--fields`, `--help`, `--log-level`, and `--verbose` flags. diff --git a/plugins/sentry-cli/skills/sentry-cli/references/team.md b/plugins/sentry-cli/skills/sentry-cli/references/team.md index 736f5abf0..c841fb99d 100644 --- a/plugins/sentry-cli/skills/sentry-cli/references/team.md +++ b/plugins/sentry-cli/skills/sentry-cli/references/team.md @@ -32,4 +32,17 @@ List teams | `teamRole` | string \| null | Your role in the team | | `memberCount` | number | Number of members | +**Examples:** + +```bash +# List teams +sentry team list my-org/ + +# Paginate through teams +sentry team list my-org/ -c next + +# Output as JSON +sentry team list --json +``` + All commands also support `--json`, `--fields`, `--help`, `--log-level`, and `--verbose` flags. diff --git a/plugins/sentry-cli/skills/sentry-cli/references/trace.md b/plugins/sentry-cli/skills/sentry-cli/references/trace.md index 1c081b93e..1baaf028a 100644 --- a/plugins/sentry-cli/skills/sentry-cli/references/trace.md +++ b/plugins/sentry-cli/skills/sentry-cli/references/trace.md @@ -34,6 +34,22 @@ List recent traces in a project | `transaction.duration` | number | Duration (ms) | | `project` | string | Project slug | +**Examples:** + +```bash +# List last 20 traces (default) +sentry trace list + +# Sort by slowest first +sentry trace list --sort duration + +# Filter by transaction name, last 24 hours +sentry trace list -q "transaction:GET /api/users" --period 24h + +# Paginate through results +sentry trace list my-org/backend -c next +``` + ### `sentry trace view ` View details of a specific trace @@ -44,6 +60,31 @@ View details of a specific trace - `--spans - Span tree depth limit (number, "all" for unlimited, "no" to disable) - (default: "3")` - `-f, --fresh - Bypass cache, re-detect projects, and fetch fresh data` +**Examples:** + +```bash +# View trace details with span tree +sentry trace view abc123def456abc123def456abc12345 + +# Open trace in browser +sentry trace view abc123def456abc123def456abc12345 -w + +# Auto-recover from an issue short ID +sentry trace view PROJ-123 + +# Filter trace view to one project's spans +sentry trace view my-org/cli-server/abc123def456abc123def456abc12345 + +# Full trace across all projects (default) +sentry trace view my-org/abc123def456abc123def456abc12345 + +# Filter trace logs by project +sentry trace logs my-org/cli-server/abc123def456abc123def456abc12345 + +# Multiple projects via --query +sentry trace logs abc123def456abc123def456abc12345 -q "project:[cli-server,api]" +``` + ### `sentry trace logs ` View logs associated with a trace @@ -56,4 +97,17 @@ View logs associated with a trace - `-s, --sort - Sort order: "newest" (default) or "oldest" - (default: "newest")` - `-f, --fresh - Bypass cache, re-detect projects, and fetch fresh data` +**Examples:** + +```bash +# View logs for a trace +sentry trace logs abc123def456abc123def456abc12345 + +# Search with a longer time window +sentry trace logs --period 30d abc123def456abc123def456abc12345 + +# Filter logs within a trace +sentry trace logs -q 'level:error' abc123def456abc123def456abc12345 +``` + All commands also support `--json`, `--fields`, `--help`, `--log-level`, and `--verbose` flags. diff --git a/plugins/sentry-cli/skills/sentry-cli/references/trial.md b/plugins/sentry-cli/skills/sentry-cli/references/trial.md index 2eec1d111..c25143ccd 100644 --- a/plugins/sentry-cli/skills/sentry-cli/references/trial.md +++ b/plugins/sentry-cli/skills/sentry-cli/references/trial.md @@ -30,4 +30,23 @@ List product trials Start a product trial +**Examples:** + +```bash +# List all trials for the current org +sentry trial list + +# List trials for a specific org +sentry trial list my-org + +# Start a Seer trial +sentry trial start seer + +# Start a trial for a specific org +sentry trial start replays my-org + +# Start a Business plan trial (opens browser) +sentry trial start plan +``` + All commands also support `--json`, `--fields`, `--help`, `--log-level`, and `--verbose` flags.