Add Sentry CLI skill

This commit is contained in:
2026-05-20 11:11:09 +01:00
parent c626224e60
commit 6ee5596160
22 changed files with 2423 additions and 0 deletions
+269
View File
@@ -0,0 +1,269 @@
---
name: sentry-cli-issue
version: 0.33.0
description: Manage Sentry issues
requires:
bins: ["sentry"]
auth: true
---
# Issue Commands
Manage Sentry issues
### `sentry issue list <org/project>`
List issues in a project
**Flags:**
- `-q, --query <value> - Search query (Sentry syntax, implicit AND, no OR operator)`
- `-n, --limit <value> - Maximum number of issues to list - (default: "25")`
- `-s, --sort <value> - Sort by: date, new, freq, user - (default: "date")`
- `-t, --period <value> - Time range: "7d", "2026-04-01..2026-05-01", ">=2026-04-01" - (default: "90d")`
- `-c, --cursor <value> - Pagination cursor (use "next" for next page, "prev" for previous)`
- `--compact - Single-line rows for compact output (auto-detects if omitted)`
- `-f, --fresh - Bypass cache, re-detect projects, and fetch fresh data`
**JSON Fields** (use `--json --fields` to select specific fields):
| Field | Type | Description |
|-------|------|-------------|
| `id` | string | Numeric issue ID |
| `shortId` | string | Human-readable short ID (e.g. PROJ-ABC) |
| `title` | string | Issue title |
| `culprit` | string | Culprit string |
| `count` | string | Total event count |
| `userCount` | number | Number of affected users |
| `firstSeen` | string | First occurrence (ISO 8601) |
| `lastSeen` | string | Most recent occurrence (ISO 8601) |
| `level` | string | Severity level |
| `status` | string | Issue status |
| `permalink` | string | URL to the issue in Sentry |
| `project` | object | Project info |
| `metadata` | object | Issue metadata |
| `assignedTo` | object \| null | Assigned user or team |
| `priority` | string | Triage priority |
| `platform` | string | Platform |
| `substatus` | string \| null | Issue substatus |
| `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 <issue>`
List events for a specific issue
**Flags:**
- `-n, --limit <value> - Number of events (1-1000) - (default: "25")`
- `-q, --query <value> - Search query (Sentry search syntax)`
- `--full - Include full event body (stacktraces)`
- `-t, --period <value> - Time range: "7d", "2026-04-01..2026-05-01", ">=2026-04-01" - (default: "7d")`
- `-f, --fresh - Bypass cache, re-detect projects, and fetch fresh data`
- `-c, --cursor <value> - Navigate pages: "next", "prev", "first" (or raw cursor string)`
**JSON Fields** (use `--json --fields` to select specific fields):
| Field | Type | Description |
|-------|------|-------------|
| `id` | string | Internal event ID |
| `event.type` | string | Event type (error, default, transaction) |
| `groupID` | string \| null | Group (issue) ID |
| `eventID` | string | UUID-format event ID |
| `projectID` | string | Project ID |
| `message` | string | Event message |
| `title` | string | Event title |
| `location` | string \| null | Source location (file:line) |
| `culprit` | string \| null | Culprit function/module |
| `user` | object \| null | User context |
| `tags` | array | Event tags |
| `platform` | string \| null | Platform (python, javascript, etc.) |
| `dateCreated` | string | ISO 8601 creation timestamp |
| `crashFile` | string \| null | Crash file URL |
| `metadata` | object \| null | Event metadata |
### `sentry issue explain <issue>`
Analyze an issue's root cause using Seer AI
**Flags:**
- `--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 <issue>`
Generate a solution plan using Seer AI
**Flags:**
- `--cause <value> - Root cause ID to plan (required if multiple causes exist)`
- `--force - Force new plan even if one exists`
- `-f, --fresh - Bypass cache, re-detect projects, and fetch fresh data`
### `sentry issue view <issue>`
View details of a specific issue
**Flags:**
- `-w, --web - Open in browser`
- `--spans <value> - 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 <issue>`
Mark an issue as resolved
**Flags:**
- `-i, --in <value> - Resolve in a release, next release, or commit ('<version>' | '@next' | '@commit' | '@commit:<repo>@<sha>')`
**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 <issue>`
Reopen a resolved issue
### `sentry issue archive <issue>`
Archive (ignore) an issue
**Flags:**
- `-u, --until <value> - 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 <issue...>`
Merge 2+ issues into a single canonical group
**Flags:**
- `-i, --into <value> - 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.