Skip to content

feat: add sentry issue events command to list events for an issue #632

Description

@BYK

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/eventssentry issue view exists in src/lib/command-suggestions.ts. Remove that entry once this command is implemented.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions