Skip to content
Merged
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
8 changes: 8 additions & 0 deletions .oxlintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@
"sentry-cli/no-generic-is-record": "error",
"sentry-cli/prefer-paginate-helper": "error",
"sentry-cli/no-namespace-import": "error",
"sentry-cli/no-examples-in-full-description": "error",
"sentry-cli/no-regex-markdown-parsing": "error",
"no-restricted-imports": [
"error",
{
Expand All @@ -89,6 +91,12 @@
"sentry-cli/no-skipped-tests": "error"
}
},
{
"files": ["packages/cli/script/**/*.ts"],
"rules": {
"sentry-cli/no-regex-markdown-parsing": "error"
}
},
{
"files": ["packages/cli/src/**/*.{ts,tsx}"],
"rules": {
Expand Down
102 changes: 1 addition & 101 deletions apps/cli-docs/src/fragments/commands/alert.md
Original file line number Diff line number Diff line change
@@ -1,108 +1,8 @@


## Examples

### Create an issue alert rule

```bash
# Create an issue alert rule with inline JSON condition/action
sentry alert issues create my-org/my-project \
--name "Error Spike" \
--condition '{"type":"first_seen_event","comparison":true,"conditionResult":true}' \
--action '{"type":"email","data":{},"config":{"targetType":"team","targetIdentifier":"1"}}'
```

### List issue alert rules

```bash
# List issue alert rules for a project
sentry alert issues list my-org/my-project

# Filter rules by name
sentry alert issues list my-org/my-project --query "spike"
```

### View an issue alert rule

```bash
# View by ID
sentry alert issues view my-org/my-project/12345

# View by name
sentry alert issues view my-org/my-project/"Error Spike"
```

### Edit an issue alert rule

```bash
# Edit issue alert name/status
sentry alert issues edit my-org/my-project/12345 --name "Prod Error Spike" --status disabled
```

### Delete an issue alert rule

```bash
# Delete with preview
sentry alert issues delete my-org/my-project/12345 --dry-run
```

### Create a metric alert rule

```bash
# Alert when P95 span duration goes above 500ms
sentry alert metrics create my-org \
--name "P95 Latency" \
--project my-app \
--query "environment:prod" \
--aggregate "p95(span.duration)" \
--dataset spans \
--time-window 5 \
--trigger '{"alertThreshold":500}'

# Alert on any matching log line and notify through an existing alert
sentry alert metrics create my-org \
--name "AI chat failures" \
--project my-app \
--query "action:ai.chat result:error" \
--aggregate "count()" \
--dataset logs \
--time-window 5 \
--trigger '{"alertThreshold":0,"resolveThreshold":0}' \
--workflow 12345
```
## Metric alert triggers

Triggers take `alertThreshold`, an optional `label` (`critical` or `warning`),
`resolveThreshold`, and `thresholdType` (`0` above, `1` below). Notification
actions are not part of triggers; pass `--workflow` with the ID of an existing
alert to notify.

### List metric alert rules

```bash
# List metric alert rules for an organization
sentry alert metrics list my-org/
```

### View a metric alert rule

```bash
# View by ID
sentry alert metrics view my-org/67890

# View by name
sentry alert metrics view my-org/"P95 latency alert"
```

### Edit a metric alert rule

```bash
# Edit metric alert query/window
sentry alert metrics edit my-org/67890 --query "environment:prod event.type:error" --time-window 15
```

### Delete a metric alert rule

```bash
# Delete without prompt
sentry alert metrics delete my-org/67890 --yes
```
68 changes: 4 additions & 64 deletions apps/cli-docs/src/fragments/commands/api.md
Original file line number Diff line number Diff line change
@@ -1,81 +1,21 @@


## Examples
## Endpoints

Endpoints are relative to `/api/0/` — the prefix is added automatically. Absolute HTTP(S) Sentry URLs also work; their origin is validated against your authenticated host.

### GET requests

```bash
# List organizations
sentry api organizations/

# Get a specific issue
sentry api issues/123456789/
```

If a successful GET response is interrupted while downloading, the CLI retries
within its existing limit of three attempts. This also applies to complete API
responses read by other commands. The request timeout covers these response
bodies; streaming responses such as SSE are excluded.

### POST requests

```bash
# Create a release
sentry api organizations/my-org/releases/ \
-X POST -F version=1.0.0

# With inline JSON body
sentry api issues/123456789/ \
-X POST -d '{"status": "resolved"}'
```

### PUT requests

```bash
# Update an issue status
sentry api issues/123456789/ \
-X PUT -F status=resolved

# Assign an issue
sentry api issues/123456789/ \
-X PUT --field assignedTo="user@example.com"
```

### DELETE requests

```bash
sentry api projects/my-org/my-project/ -X DELETE
```

### Advanced usage

```bash
# Add custom headers
sentry api organizations/ -H "X-Custom: value"

# Read body from a file
sentry api projects/my-org/my-project/releases/ -X POST --input release.json

# Verbose mode (shows full HTTP request/response)
sentry api organizations/ --verbose

# Preview the request without sending
sentry api organizations/ --dry-run
```

### Dataset Names
## Dataset Names

When querying the Events API (`/events/` endpoint), valid dataset values are: `spans`, `logs`, `errors`, `tracemetrics`, `profile_functions`, and `uptime_results`.

### Binary responses

Endpoints that return binary data — image attachments, minidumps, debug files — are streamed to stdout as raw bytes, so you can redirect them straight to a file:
## Binary responses

```bash
sentry api "https://sentry.io/api/0/projects/my-org/my-project/events/EVENT_ID/attachments/ATTACHMENT_ID/?download=1" > screenshot.png
```
Endpoints that return binary data — image attachments, minidumps, debug files — are streamed to stdout as raw bytes, so you can redirect them straight to a file.

When the response is a PNG or JPEG image **and** you're on a graphics-capable terminal, the image is rendered inline instead of dumping raw bytes into your session. Terminals that speak the newer kitty graphics protocol (kitty, WezTerm, Ghostty, recent Konsole) are used in preference to sixel, which remains the fallback for older terminals. Redirecting or piping stdout always keeps the raw bytes. Set `SENTRY_NO_GRAPHICS=1` (or run `sentry cli defaults graphics off`) to disable inline rendering; `SENTRY_NO_SIXEL` is still honored as a deprecated alias.

Expand Down
119 changes: 8 additions & 111 deletions apps/cli-docs/src/fragments/commands/auth.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@


## Examples

### OAuth login (recommended)

```bash
sentry auth
```
## OAuth login

Bare `sentry auth` logs in when you're logged out and shows status when you're
already authenticated. `sentry auth login` always starts the login flow.
Expand All @@ -18,49 +12,19 @@ already authenticated. `sentry auth login` always starts the login flow.
5. The CLI stores the OAuth credentials and, when the server provides a refresh
token, automatically refreshes the access token

### Token login

```bash
sentry auth --token YOUR_SENTRY_API_TOKEN
```

### Read-only OAuth login

Request only read-only scopes — useful for tokens handed to AI agents or
CI jobs that should not mutate Sentry state:

```bash
sentry auth --read-only
```

### Custom OAuth scopes

Request specific scopes (repeatable, comma-separated):
Use `--read-only` to request only read-only scopes — useful for tokens handed
to AI agents or CI jobs that should not mutate Sentry state. Use `--scope` to
request specific scopes (repeatable, comma-separated).

```bash
sentry auth --scope project:read --scope org:read
sentry auth --scope project:read,event:read
```

### Self-hosted Sentry
## Self-hosted Sentry

Pass `--url` to log in to a self-hosted instance. Setting `SENTRY_HOST` or
`SENTRY_URL` alone is not enough: the CLI refuses to log in to a self-hosted
host unless `--url` confirms it.

```bash
sentry auth --url https://sentry.example.com
```

For token-based auth with self-hosted:

```bash
sentry auth --token YOUR_TOKEN --url https://sentry.example.com
```

See [Self-Hosted Sentry](../../self-hosted/) for details.

### Multiple accounts
## Multiple accounts

The CLI can store several accounts at once — for example a work and a personal
account, or a SaaS and a self-hosted login. When you're already logged in,
Expand All @@ -70,19 +34,8 @@ credentials instead of adding a duplicate. `--force` skips the prompt and
replaces the stored login for that server instead (or adds one when that
server has none); accounts on other servers are never replaced.

```bash
# Add (or log in again to) a specific account without prompting
sentry auth login jane@example.com
sentry auth login jane@example.com --url https://sentry.example.com
sentry auth login jane@example.com:sentry.example.com # same as --url

# Show stored accounts; * marks the active one
sentry auth list

# Switch the account commands use (pick from a searchable list without an argument)
sentry auth switch jane@example.com
sentry auth switch
```
Use `sentry auth list` to show stored accounts and `sentry auth switch` to
change the active one.

Sentry approves a device-flow login as whoever is signed in to the browser, so
`sentry auth login <email>` checks the approved account and refuses (saving
Expand Down Expand Up @@ -139,62 +92,6 @@ account's server. `SENTRY_HOST`/`SENTRY_URL` and `SENTRY_AUTH_TOKEN` (with
`SENTRY_FORCE_ENV_TOKEN=1`) still take precedence over the active account.
Default organization and project settings are shared by all accounts.

### Logout

```bash
# Log out of the active account (the most recently used other account becomes active)
sentry auth logout

# Log out of specific accounts (space- or comma-separated)
sentry auth logout jane@example.com
sentry auth logout jane@example.com,jane@personal.dev

# Pick the account on one server when the same email is stored twice
sentry auth logout jane@example.com --url https://sentry.example.com

# Log out of every stored account
sentry auth logout all
```

### Refresh the OAuth access token

```bash
sentry auth refresh

# Refresh with read-only scopes
sentry auth refresh --read-only

# Refresh with specific scopes
sentry auth refresh --scope project:read --scope org:read
```

### Print stored token

```bash
sentry auth token
```

### Check auth status

```bash
sentry auth status
```

```
✓ Authenticated
User: username
Access token expires: in 4 weeks
Automatic refresh: enabled
```

```bash
# Show the raw token
sentry auth status --show-token

# View current user
sentry auth whoami
```

## Credential Storage

Auth tokens are stored in the Sentry CLI configuration directory
Expand Down
13 changes: 0 additions & 13 deletions apps/cli-docs/src/fragments/commands/build.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,5 @@


## Examples

```bash
# Download a build artifact by ID
sentry build download 1234567890

# Download to a specific path
sentry build download 1234567890 --output ./app.ipa

# Output the result as JSON
sentry build download 1234567890 --json
```

## Important Notes

- `build upload` supports **Android APK/AAB** and **iOS XCArchive/IPA**. An
Expand Down
Loading
Loading