Summary
Add an events subcommand to sentry issue to list events for a specific issue. This is the most requested unknown command in CLI-Q3 telemetry (~20 events from users trying sentry issue events <issue-id>).
Implementation Details
API Endpoint
GET /api/0/organizations/{org}/issues/{issue_id}/events/
New API Function
Add listIssueEvents to src/lib/api/events.ts:
- Paginated response using
apiRequestToRegion + parseLinkHeader
- Return type:
PaginatedResponse<SentryEvent[]>
- Accept org slug, issue ID, and standard pagination options (perPage, cursor)
- The
SentryEvent type already exists in src/types/sentry.ts
New Command
Create src/commands/issue/events.ts:
- Register as
events in src/commands/issue/index.ts route map
- Accept the same issue ID positional as
issue view (reuse issueIdPositional from ./utils.ts)
- Support
--limit, --cursor (next/prev), --json, --fields flags
- Follow the cursor-stack pagination pattern (
resolveCursor, advancePaginationState, hasPreviousPage, paginationHint)
- Use
PAGINATION_KEY = "issue-events-list"
Human Output
- Table format showing: event ID, timestamp, message/title, platform, tags
- Reuse formatting helpers from
src/lib/formatters/ (e.g., formatEventDetails for individual events)
- Include pagination navigation hints
JSON Output
- Standard list envelope with
nextCursor and hasPrev
- Each event as a
SentryEvent object
References
- List command pattern:
src/commands/trace/list.ts, src/commands/span/list.ts
- Issue resolution:
src/commands/issue/utils.ts (resolveIssue)
- Event types:
src/types/sentry.ts (SentryEvent)
- Pagination:
src/lib/db/pagination.ts, src/lib/list-command.ts
Context
A temporary synonym suggestion for issue/events → sentry issue view exists in src/lib/command-suggestions.ts. Remove that entry once this command is implemented.
Summary
Add an
eventssubcommand tosentry issueto list events for a specific issue. This is the most requested unknown command in CLI-Q3 telemetry (~20 events from users tryingsentry issue events <issue-id>).Implementation Details
API Endpoint
GET /api/0/organizations/{org}/issues/{issue_id}/events/New API Function
Add
listIssueEventstosrc/lib/api/events.ts:apiRequestToRegion+parseLinkHeaderPaginatedResponse<SentryEvent[]>SentryEventtype already exists insrc/types/sentry.tsNew Command
Create
src/commands/issue/events.ts:eventsinsrc/commands/issue/index.tsroute mapissue view(reuseissueIdPositionalfrom./utils.ts)--limit,--cursor(next/prev),--json,--fieldsflagsresolveCursor,advancePaginationState,hasPreviousPage,paginationHint)PAGINATION_KEY = "issue-events-list"Human Output
src/lib/formatters/(e.g.,formatEventDetailsfor individual events)JSON Output
nextCursorandhasPrevSentryEventobjectReferences
src/commands/trace/list.ts,src/commands/span/list.tssrc/commands/issue/utils.ts(resolveIssue)src/types/sentry.ts(SentryEvent)src/lib/db/pagination.ts,src/lib/list-command.tsContext
A temporary synonym suggestion for
issue/events→sentry issue viewexists insrc/lib/command-suggestions.ts. Remove that entry once this command is implemented.