Skip to content

Commit ca14e7c

Browse files
feat(event): add 'sentry event list' command for issue-scoped event listing (#671)
## Summary Adds `sentry event list <issue-id>` as a top-level command for listing events belonging to a Sentry issue. This is functionally equivalent to `sentry issue events` but lives in the `event` route with its own command identity. The `sentry events` plural alias now uses Pattern A (points to the list command directly), matching how `sentry issues` → `issue list`, `sentry traces` → `trace list`, etc. ### Changes - **`src/commands/event/shared-events.ts`** (new) — Shared types, constants, formatters, table columns, and flag definitions extracted from `issue/events.ts` - **`src/commands/event/list.ts`** (new) — The `event list` command with correct command identity (pagination hints, error messages) - **`src/commands/issue/events.ts`** — Refactored to import shared parts (no behavior change) - **`src/commands/issue/utils.ts`** — `buildCommandHint` and `resolveIssue` accept optional `commandBase` parameter - **`src/commands/event/index.ts`** — Added `list` route alongside `view` - **`src/app.ts`** — Changed `events` alias from `eventRoute` (Pattern B) to `eventListCommand` (Pattern A) - **`src/lib/command-suggestions.ts`** — Removed `event/list` synonym (now a real command) ### Usage ```bash sentry event list CLI-G5 sentry event list @latest --limit 50 sentry event list CLI-G5 --full --json sentry event list CLI-G5 -q "user.email:foo@bar.com" sentry events CLI-G5 # plural alias → event list ``` ### Follow-up: org-scoped event listing This PR covers issue-scoped event listing only. A follow-up issue will track expanding `event list` to support org-scoped queries via the Discover/Events API (`/organizations/{org}/events/`), enabling patterns like `sentry event list <org>/ --dataset errors`. Closes #632 --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 0108c1e commit ca14e7c

File tree

35 files changed

+856
-324
lines changed

35 files changed

+856
-324
lines changed

docs/src/content/docs/commands/dashboard.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ List dashboards
2222
| Option | Description |
2323
|--------|-------------|
2424
| `-w, --web` | Open in browser |
25-
| `-n, --limit <limit>` | Maximum number of dashboards to list (default: "30") |
25+
| `-n, --limit <limit>` | Maximum number of dashboards to list (default: "25") |
2626
| `-f, --fresh` | Bypass cache, re-detect projects, and fetch fresh data |
2727
| `-c, --cursor <cursor>` | Navigate pages: "next", "prev", "first" (or raw cursor string) |
2828

docs/src/content/docs/commands/event.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: event
33
description: Event commands for the Sentry CLI
44
---
55

6-
View Sentry events
6+
View and list Sentry events
77

88
## Commands
99

@@ -25,6 +25,27 @@ View details of a specific event
2525
| `--spans <spans>` | Span tree depth limit (number, "all" for unlimited, "no" to disable) (default: "3") |
2626
| `-f, --fresh` | Bypass cache, re-detect projects, and fetch fresh data |
2727

28+
### `sentry event list <issue>`
29+
30+
List events for an issue
31+
32+
**Arguments:**
33+
34+
| Argument | Description |
35+
|----------|-------------|
36+
| `<issue>` | Issue: @latest, @most_frequent, &lt;org&gt;/ID, &lt;project&gt;-suffix, ID, or suffix |
37+
38+
**Options:**
39+
40+
| Option | Description |
41+
|--------|-------------|
42+
| `-n, --limit <limit>` | Number of events (1-1000) (default: "25") |
43+
| `-q, --query <query>` | Search query (Sentry search syntax) |
44+
| `--full` | Include full event body (stacktraces) |
45+
| `-t, --period <period>` | Time period (e.g., "1h", "24h", "7d", "30d") (default: "7d") |
46+
| `-f, --fresh` | Bypass cache, re-detect projects, and fetch fresh data |
47+
| `-c, --cursor <cursor>` | Navigate pages: "next", "prev", "first" (or raw cursor string) |
48+
2849
All commands support `--json` for machine-readable output and `--fields` to select specific JSON fields.
2950

3051
<!-- GENERATED:END -->

docs/src/content/docs/commands/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ The Sentry CLI provides commands for interacting with various Sentry resources.
1818
| [`repo`](./repo/) | Work with Sentry repositories |
1919
| [`team`](./team/) | Work with Sentry teams |
2020
| [`issue`](./issue/) | Manage Sentry issues |
21-
| [`event`](./event/) | View Sentry events |
21+
| [`event`](./event/) | View and list Sentry events |
2222
| [`log`](./log/) | View Sentry logs |
2323
| [`sourcemap`](./sourcemap/) | Manage sourcemaps |
2424
| [`span`](./span/) | List and view spans in projects or traces |

docs/src/content/docs/commands/org.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ List organizations
1515

1616
| Option | Description |
1717
|--------|-------------|
18-
| `-n, --limit <limit>` | Maximum number of organizations to list (default: "30") |
18+
| `-n, --limit <limit>` | Maximum number of organizations to list (default: "25") |
1919
| `-f, --fresh` | Bypass cache, re-detect projects, and fetch fresh data |
2020

2121
### `sentry org view <org>`

docs/src/content/docs/commands/project.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ List projects
5757

5858
| Option | Description |
5959
|--------|-------------|
60-
| `-n, --limit <limit>` | Maximum number of projects to list (default: "30") |
60+
| `-n, --limit <limit>` | Maximum number of projects to list (default: "25") |
6161
| `-p, --platform <platform>` | Filter by platform (e.g., javascript, python) |
6262
| `-f, --fresh` | Bypass cache, re-detect projects, and fetch fresh data |
6363
| `-c, --cursor <cursor>` | Navigate pages: "next", "prev", "first" (or raw cursor string) |

docs/src/content/docs/commands/release.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ List releases
2121

2222
| Option | Description |
2323
|--------|-------------|
24-
| `-n, --limit <limit>` | Maximum number of releases to list (default: "30") |
24+
| `-n, --limit <limit>` | Maximum number of releases to list (default: "25") |
2525
| `-f, --fresh` | Bypass cache, re-detect projects, and fetch fresh data |
2626
| `-c, --cursor <cursor>` | Navigate pages: "next", "prev", "first" (or raw cursor string) |
2727

docs/src/content/docs/commands/repo.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ List repositories
2121

2222
| Option | Description |
2323
|--------|-------------|
24-
| `-n, --limit <limit>` | Maximum number of repositories to list (default: "30") |
24+
| `-n, --limit <limit>` | Maximum number of repositories to list (default: "25") |
2525
| `-f, --fresh` | Bypass cache, re-detect projects, and fetch fresh data |
2626
| `-c, --cursor <cursor>` | Navigate pages: "next", "prev", "first" (or raw cursor string) |
2727

docs/src/content/docs/commands/team.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ List teams
2121

2222
| Option | Description |
2323
|--------|-------------|
24-
| `-n, --limit <limit>` | Maximum number of teams to list (default: "30") |
24+
| `-n, --limit <limit>` | Maximum number of teams to list (default: "25") |
2525
| `-f, --fresh` | Bypass cache, re-detect projects, and fetch fresh data |
2626
| `-c, --cursor <cursor>` | Navigate pages: "next", "prev", "first" (or raw cursor string) |
2727

docs/src/content/docs/commands/trace.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ List recent traces in a project
2121

2222
| Option | Description |
2323
|--------|-------------|
24-
| `-n, --limit <limit>` | Number of traces (1-1000) (default: "20") |
24+
| `-n, --limit <limit>` | Number of traces (1-1000) (default: "25") |
2525
| `-q, --query <query>` | Search query (Sentry search syntax) |
2626
| `-s, --sort <sort>` | Sort by: date, duration (default: "date") |
2727
| `-t, --period <period>` | Time period (e.g., "1h", "24h", "7d", "30d") (default: "7d") |

plugins/sentry-cli/skills/sentry-cli/SKILL.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,9 +303,10 @@ Manage Sentry issues
303303

304304
### Event
305305

306-
View Sentry events
306+
View and list Sentry events
307307

308308
- `sentry event view <org/project/event-id...>` — View details of a specific event
309+
- `sentry event list <issue>` — List events for an issue
309310

310311
→ Full flags and examples: `references/event.md`
311312

0 commit comments

Comments
 (0)