Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 16 additions & 74 deletions AGENTS.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/src/content/docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ cli/
│ │ ├── auth/ # login, logout, refresh, status, token, whoami
│ │ ├── cli/ # defaults, feedback, fix, setup, upgrade
│ │ ├── dashboard/ # list, view, create, add, edit, delete
│ │ ├── event/ # view, list
│ │ ├── event/ # view, list, send
│ │ ├── issue/ # list, events, explain, plan, view, resolve, unresolve, archive, merge
│ │ ├── log/ # list, view
│ │ ├── org/ # list, view
Expand Down
58 changes: 58 additions & 0 deletions docs/src/fragments/commands/event.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,57 @@



## Examples

### Sending Events

```bash
# Send an error event (default level)
sentry event send -m "Something went wrong"

# Specify level, release, and environment
sentry event send -m "Deploy check" -l info -r 1.0.0 -E production

# Add tags and extra data
sentry event send -m "Payment failed" --tag env:prod --tag region:us-east --extra amount:99.99

# Set user context
sentry event send -m "Login error" --user id:42 --user email:alice@example.com

# Custom fingerprint to group related events together
sentry event send -m "DB timeout" --fingerprint db-timeout --fingerprint {{ default }}
```

### Send from a JSON file

```bash
# Send a serialized Sentry Event object
sentry event send ./crash.json

# Send without re-parsing (raw mode — also supports pre-built envelopes)
sentry event send --raw ./crash.json
sentry event send --raw ./captured.envelope
```

### DSN authentication

`sentry event send` authenticates via a **DSN** rather than a user token.
No `sentry auth login` is required.

The DSN is resolved in priority order:

1. `--dsn <value>` flag (explicit)
2. `SENTRY_DSN` environment variable

```bash
# Explicit DSN
sentry event send -m "Test" --dsn "https://key@o123.ingest.us.sentry.io/456"

# Via environment variable
export SENTRY_DSN="https://key@o123.ingest.us.sentry.io/456"
sentry event send -m "Test"
```

### Listing Events

```bash
Expand Down Expand Up @@ -68,3 +118,11 @@ Event IDs can be found:
1. In the Sentry UI when viewing an issue's events
2. In the output of `sentry issue view` commands
3. In error reports sent to Sentry (as `event_id`)

## Backward compatibility

The old sentry-cli top-level command is available as a hidden alias:

```bash
sentry send-event # same as: sentry event send
```
3 changes: 2 additions & 1 deletion plugins/sentry-cli/skills/sentry-cli/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -323,10 +323,11 @@ Manage Sentry issues

### Event

View and list Sentry events
View, list, and send Sentry events

- `sentry event view <org/project/event-id...>` — View details of one or more events
- `sentry event list <issue>` — List events for an issue
- `sentry event send <args...>` — Send a Sentry event

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

Expand Down
60 changes: 58 additions & 2 deletions plugins/sentry-cli/skills/sentry-cli/references/event.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
---
name: sentry-cli-event
version: 0.32.0-dev.0
description: View and list Sentry events
description: View, list, and send Sentry events
requires:
bins: ["sentry"]
auth: true
---

# Event Commands

View and list Sentry events
View, list, and send Sentry events

### `sentry event view <org/project/event-id...>`

Expand Down Expand Up @@ -87,4 +87,60 @@ sentry event list PROJ-ABC -c prev
sentry event list PROJ-ABC --json
```

### `sentry event send <args...>`

Send a Sentry event

**Flags:**
- `--dsn <value> - DSN to send events to (overrides SENTRY_DSN env var)`
- `-m, --message <value>... - Event message (repeat for multi-line)`
- `-a, --message-arg <value>... - Arguments for message template (repeat for multiple)`
- `-l, --level <value> - Event severity level - (default: "error")`
- `-r, --release <value> - Release version`
- `-d, --dist <value> - Distribution identifier`
- `-E, --env <value> - Environment name (e.g. production, staging)`
- `-p, --platform <value> - Platform identifier (default: other)`
- `-t, --tag <value>... - Tag as KEY:VALUE (repeat for multiple)`
- `-e, --extra <value>... - Extra data as KEY:VALUE (repeat for multiple)`
- `-u, --user <value>... - User info as KEY:VALUE — id, email, username, ip_address, or custom`
- `-f, --fingerprint <value>... - Custom fingerprint part (repeat for multiple)`
- `--timestamp <value> - Event timestamp (Unix epoch, ISO 8601, or RFC 2822)`
- `--no-environ - Do not include environment variables in the event`
- `--raw - Send file contents as-is without parsing`

**Examples:**

```bash
# Send an error event (default level)
sentry event send -m "Something went wrong"

# Specify level, release, and environment
sentry event send -m "Deploy check" -l info -r 1.0.0 -E production

# Add tags and extra data
sentry event send -m "Payment failed" --tag env:prod --tag region:us-east --extra amount:99.99

# Set user context
sentry event send -m "Login error" --user id:42 --user email:alice@example.com

# Custom fingerprint to group related events together
sentry event send -m "DB timeout" --fingerprint db-timeout --fingerprint {{ default }}

# Send a serialized Sentry Event object
sentry event send ./crash.json

# Send without re-parsing (raw mode — also supports pre-built envelopes)
sentry event send --raw ./crash.json
sentry event send --raw ./captured.envelope

# Explicit DSN
sentry event send -m "Test" --dsn "https://key@o123.ingest.us.sentry.io/456"

# Via environment variable
export SENTRY_DSN="https://key@o123.ingest.us.sentry.io/456"
sentry event send -m "Test"

sentry send-event # same as: sentry event send
```

All commands also support `--json`, `--fields`, `--help`, `--log-level`, and `--verbose` flags.
7 changes: 7 additions & 0 deletions src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ import { listCommand as replayListCommand } from "./commands/replay/list.js";
import { repoRoute } from "./commands/repo/index.js";
import { listCommand as repoListCommand } from "./commands/repo/list.js";
import { schemaCommand } from "./commands/schema.js";
import { sendEnvelopeCommand } from "./commands/send-envelope.js";
import { sendEventCommand } from "./commands/send-event.js";
import { sourcemapRoute } from "./commands/sourcemap/index.js";
import { spanRoute } from "./commands/span/index.js";
import { listCommand as spanListCommand } from "./commands/span/list.js";
Expand Down Expand Up @@ -105,6 +107,9 @@ export const routes = buildRouteMap({
init: initCommand,
api: apiCommand,
schema: schemaCommand,
// Backward-compat aliases for old sentry-cli — hidden from help
"send-event": sendEventCommand,
"send-envelope": sendEnvelopeCommand,
dashboards: dashboardListCommand,
issues: issueListCommand,
orgs: orgListCommand,
Expand Down Expand Up @@ -141,6 +146,8 @@ export const routes = buildRouteMap({
trials: true,
sourcemaps: true,
whoami: true,
"send-event": true,
"send-envelope": true,
},
},
});
Expand Down
9 changes: 6 additions & 3 deletions src/commands/event/index.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
import { buildRouteMap } from "../../lib/route-map.js";
import { listCommand } from "./list.js";
import { sendCommand } from "./send.js";
import { viewCommand } from "./view.js";

export const eventRoute = buildRouteMap({
routes: {
view: viewCommand,
list: listCommand,
send: sendCommand,
},
defaultCommand: "view",
docs: {
brief: "View and list Sentry events",
brief: "View, list, and send Sentry events",
fullDescription:
"View and list event data from Sentry.\n\n" +
"View, list, and send event data from Sentry.\n\n" +
"Use 'sentry event view <event-id>' to view a specific event.\n" +
"Use 'sentry event list <issue-id>' to list events for an issue.",
"Use 'sentry event list <issue-id>' to list events for an issue.\n" +
"Use 'sentry event send -m <message>' to send a test event.",
hideRoute: {},
},
});
Loading
Loading