# Sentry CLI
> Manage Sentry error tracking from the terminal

## Summary
Official Sentry CLI for managing releases, uploading source maps and debug symbols, tracking deployments, and integrating Sentry error tracking into CI/CD pipelines.

## Capabilities
- Upload JavaScript source maps for readable stack traces
- Create and manage releases with commit tracking
- Upload debug symbols (dSYM, PDB, ELF) for native crash reports
- Notify Sentry of deployments to specific environments
- Upload ProGuard mappings for Android crash deobfuscation
- Send custom events and test DSN connectivity

## When to Use
- Uploading source maps to Sentry for JavaScript/TypeScript applications
- Managing Sentry releases and associating commits in CI/CD
- Uploading debug symbols for native mobile or desktop applications
- Notifying Sentry of deployments to track release health
- Testing Sentry configuration and DSN connectivity

## When NOT to Use
- Not using Sentry for error tracking
- Only using the Sentry web UI for issue management
- Using a different error tracking service

## Key Flags
- `releases new`: Create a new release
- `releases files upload-sourcemaps`: Upload source maps for a release
- `releases set-commits`: Associate commits with a release
- `releases deploys new`: Record a deployment for a release
- `upload-dif`: Upload debug information files
- `send-event`: Send a test event to Sentry

## Usage Patterns
### Create release and upload source maps
```
sentry-cli releases new v1.0.0 && sentry-cli releases files v1.0.0 upload-sourcemaps ./dist
```
Creates a release and uploads all source maps from the dist directory

### Finalize a release with commits
```
sentry-cli releases set-commits v1.0.0 --auto && sentry-cli releases finalize v1.0.0
```
Associates git commits and marks the release as finalized

### Record a deployment
```
sentry-cli releases deploys v1.0.0 new -e production
```
Records that the release was deployed to the production environment

### Test Sentry configuration
```
sentry-cli send-event -m 'Test event from CLI'
```
Sends a test event to verify Sentry is properly configured

## Input / Output
- **stdin**: Minimal stdin usage; configuration via environment variables and .sentryclirc
- **stdout**: Upload progress, release information, and confirmation messages
- **stderr**: Error messages and upload warnings

## Installation
- **homebrew**: `brew install getsentry/tools/sentry-cli`
- **npm**: `npm i -g @sentry/cli`

## Related Tools
- [gh](/tools/gh) (complementary): gh manages GitHub releases; sentry-cli links Sentry releases to commits
- [railway](/tools/railway) (complementary): sentry-cli can be used in Railway builds to upload source maps

---
Source: https://littlescripts.sh/tools/sentry-cli
