Quick Start Guide
This guide will walk you through authenticating with Sentry and running your first commands. In just a few minutes, you’ll be able to list issues, view event details, and get AI-powered debugging insights.Prerequisites
- Sentry CLI installed (see Installation)
- A Sentry account (sign up for free)
- An existing project in Sentry (optional, but recommended)
Step 1: Authentication
Before using Sentry CLI, you need to authenticate with your Sentry account. Sentry CLI supports two authentication methods:OAuth Device Flow (Recommended)
The OAuth device flow is the easiest way to authenticate interactively:Authorize in Your Browser
Press Enter to open the URL automatically, or manually visit
https://sentry.io/device in your browser. Enter the code shown in your terminal.The OAuth flow uses a device code, so you don’t need to copy tokens or expose credentials in your terminal.
API Token Authentication
For CI/CD environments or non-interactive use, authenticate with an API token:- Go to Settings → Account → API → Auth Tokens
- Click Create New Token
- Select the required scopes (at minimum:
org:read,project:read,event:read) - Copy the token and use it with the command above
API tokens are stored securely in
~/.sentry/config.db with file permissions set to 600 (owner read/write only).Environment Variable Authentication
For temporary authentication or CI/CD pipelines, use environment variables:SENTRY_AUTH_TOKENenvironment variableSENTRY_TOKENenvironment variable- OAuth token stored in
~/.sentry/config.db
Self-Hosted Sentry
If you’re using a self-hosted Sentry instance (version 26.1.0+), you’ll need to configure the OAuth client:You must create a public OAuth application in Settings → Developer Settings on your self-hosted instance. For older Sentry versions, use
sentry auth login --token instead.Step 2: Verify Authentication
Check that you’re authenticated successfully:Step 3: Explore Your Organizations and Projects
List your organizations:You can also let Sentry CLI auto-detect your project from your codebase (see Step 4).
Step 4: Auto-Detect Your Project
One of Sentry CLI’s most powerful features is automatic project detection. Navigate to a project directory that contains Sentry configuration:- Search for Sentry DSN in
.envfiles - Scan source code files (JavaScript, Python, Go, Java, Ruby, PHP) for Sentry initialization
- Walk up the directory tree to find project boundaries
- Cache the detected project for fast subsequent access
If your project can’t be auto-detected, you can explicitly specify it:
sentry issue list my-company/my-projectStep 5: List Issues
View recent issues in your project:Filter and Sort Issues
Step 6: Get AI-Powered Insights
Use Seer AI to get root cause analysis and fix recommendations:explain:
Seer AI features require Sentry Business or Enterprise plan with AI enabled for your organization.
Step 7: View Issue Details
Get detailed information about a specific issue:Open in Browser
Use the-w flag to open any resource in your browser:
Step 8: View Event Details
View a specific event within an issue:- Full stacktrace
- Breadcrumbs (user actions leading to the error)
- Context (device info, browser, OS)
- Tags and custom metadata
Step 9: Export to JSON
All commands support JSON output for scripting and automation:JSON output is perfect for integrating Sentry CLI with other tools, CI/CD pipelines, or custom scripts.
Step 10: Make Direct API Requests
For advanced use cases, use theapi command to make direct requests to the Sentry API:
Common Workflows
Daily Issue Triage
CI/CD Integration
Monorepo Projects
For monorepos with multiple Sentry projects:Sentry CLI generates short aliases for projects in monorepos, making it easier to switch between them.
Getting Help
Get help for any command:Configuration Files
Sentry CLI stores configuration and cached data in~/.sentry/:
- config.db: SQLite database containing:
- Authentication tokens (OAuth or API tokens)
- Cached project information
- Organization and region mappings
- Project aliases for monorepos
- User information
Logging and Debugging
Enable debug logging to troubleshoot issues:Next Steps
Authentication
Learn about all authentication commands and token management
Issue Commands
Explore all issue management and debugging commands
Project Commands
Learn how to list, view, and manage projects
API Access
Make direct API requests for advanced use cases