Skip to main content
Sentry CLI stores configuration in a local SQLite database and reads settings from environment variables. This guide covers how to customize the configuration to suit your workflow.

Configuration Directory

The CLI stores all persistent data in a configuration directory:

Custom Configuration Directory

You can change the config directory with SENTRY_CONFIG_DIR:

Directory Permissions

The config directory is created with secure permissions:
This ensures only your user can read authentication tokens.
The database contains sensitive authentication tokens. Never commit it to version control or share it.

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:
Remove the database and it will be recreated:
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 --org or --project flags provided

Precedence

  1. Explicit arguments: sentry issue list my-org/my-project
  2. Flags: --org my-org --project my-project
  3. DSN auto-detection: From .env or source code
  4. 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 token

Self-Hosted Configuration

string
Base URL for self-hosted Sentry instances. Defaults to https://sentry.io.
See the Self-Hosted guide for details.
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 1 or true to disable.
The CLI sends errors and performance data to Sentry to help improve the product. Disabling telemetry opts you out.

Common Configuration Patterns

Multi-Account Setup

Manage multiple Sentry accounts with shell aliases:
~/.bashrc
Usage:

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:
Never hardcode tokens in CI config. Always use secrets/credentials management.

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

.gitignore
When creating auth tokens, only grant necessary scopes:Read-only access:
  • project:read
  • org:read
  • event:read
CI/CD deployment:
  • project:read
  • project:write
  • org:read
This prevents accidentally using work credentials for personal projects.