Configuration Directory
The CLI stores all persistent data in a configuration directory:Custom Configuration Directory
You can change the config directory withSENTRY_CONFIG_DIR:
- Separate profiles
- SaaS vs Self-Hosted
- Project-local config
Directory Permissions
The config directory is created with secure permissions:Database
The CLI uses SQLite to store:- Authentication: OAuth tokens, expiry times, refresh tokens
- User info: Email, name, user ID
- Defaults: Default organization and project
- Cache: Organization regions, project metadata, DSN lookups
- Pagination: Cursor state for paginated list commands
Database Schema
Key tables:Cache TTL
Most caches expire after 7 days. The CLI automatically cleans up expired entries (10% probability on each write). To force cache refresh:Database Corruption
If the database becomes corrupted:Deleting the database logs you out. You’ll need to authenticate again.
Default Organization and Project
Set defaults to avoid typing org/project on every command:When Defaults Are Used
Defaults apply when:- No org/project specified in arguments
- No DSN detected in current directory
- No
--orgor--projectflags provided
Precedence
- Explicit arguments:
sentry issue list my-org/my-project - Flags:
--org my-org --project my-project - DSN auto-detection: From
.envor source code - Defaults: Stored in database
Viewing Defaults
Clearing Defaults
Environment Variables
Authentication
string
Authentication token. Takes priority over
SENTRY_TOKEN and stored OAuth tokens.string
Alternative authentication token. Used if
SENTRY_AUTH_TOKEN is not set.Token precedence:
SENTRY_AUTH_TOKEN > SENTRY_TOKEN > stored OAuth tokenSelf-Hosted Configuration
string
Base URL for self-hosted Sentry instances. Defaults to See the Self-Hosted guide for details.
https://sentry.io.string
OAuth client ID for self-hosted instances. Required for OAuth device flow on self-hosted Sentry 26.1.0+.
Configuration
string
Directory for storing CLI configuration and database. Defaults to
~/.sentry.Logging and Debugging
string
Log level for CLI output. Options:
error, warn, info (default), debug, trace.string
Disable colored output. Set to any value to disable.
string
Force plain text output (no colors, no ANSI). Useful for non-TTY environments.
Telemetry
string
Disable error and performance telemetry. Set to The CLI sends errors and performance data to Sentry to help improve the product. Disabling telemetry opts you out.
1 or true to disable.Common Configuration Patterns
Multi-Account Setup
Manage multiple Sentry accounts with shell aliases:~/.bashrc
Project-Local Configuration
Store Sentry config in your project:1
Create local config directory
2
Set environment variable
.env.local
3
Use in scripts
deploy.sh
CI/CD Configuration
Best practices for CI/CD:Development vs Production
Separate configs for different environments:Debugging Configuration Issues
Check effective configuration
Enable debug logging
Test token validity
Check database location
Reset configuration
If configuration is broken:Security Best Practices
Never commit the config directory
Never commit the config directory
.gitignore
Use environment variables in CI
Use environment variables in CI
Restrict token scopes
Restrict token scopes
When creating auth tokens, only grant necessary scopes:Read-only access:
project:readorg:readevent:read
project:readproject:writeorg:read
Rotate tokens regularly
Rotate tokens regularly
Use separate configs for work accounts
Use separate configs for work accounts