Skip to content
Docs GitHub

Configuration

The Sentry CLI can be configured through environment variables and a local database. Most users don’t need to set any of these — the CLI auto-detects your project from your codebase and stores credentials locally after sentry auth login.

Environment Variables

SENTRY_URL

Base URL of your Sentry instance. Only needed for self-hosted Sentry. SaaS users (sentry.io) should not set this.

Terminal window
export SENTRY_URL=https://sentry.example.com

When set, all API requests (including OAuth login) are directed to this URL instead of https://sentry.io. The CLI also sets this automatically when you pass a self-hosted Sentry URL as a command argument.

SENTRY_ORG

Default organization slug. Skips organization auto-detection.

Terminal window
export SENTRY_ORG=my-org

SENTRY_PROJECT

Default project slug. Can also include the org in org/project format.

Terminal window
# Project only (requires SENTRY_ORG or auto-detection for the org)
export SENTRY_PROJECT=my-project
# Org and project together
export SENTRY_PROJECT=my-org/my-project

When using the org/project combo format, SENTRY_ORG is ignored.

SENTRY_DSN

Sentry DSN for project auto-detection. This is the same DSN you use in Sentry.init(). The CLI resolves it to determine your organization and project.

Terminal window
export SENTRY_DSN=https://key@o123.ingest.us.sentry.io/456

The CLI also detects DSNs from .env files and source code automatically — see DSN Auto-Detection.

SENTRY_CLIENT_ID

Client ID of a public OAuth application on your Sentry instance. Required for self-hosted Sentry (26.1.0+) to use sentry auth login with the device flow. See the Self-Hosted guide for how to create one.

Terminal window
export SENTRY_CLIENT_ID=your-oauth-client-id

SENTRY_CONFIG_DIR

Override the directory where the CLI stores its database (credentials, caches, defaults). Defaults to ~/.sentry/.

Terminal window
export SENTRY_CONFIG_DIR=/path/to/config

SENTRY_PLAIN_OUTPUT

Force plain text output (no colors or ANSI formatting). Takes precedence over NO_COLOR.

Terminal window
export SENTRY_PLAIN_OUTPUT=1

NO_COLOR

Standard convention to disable color output. See no-color.org. Respected when SENTRY_PLAIN_OUTPUT is not set.

Terminal window
export NO_COLOR=1

SENTRY_CLI_NO_TELEMETRY

Disable CLI telemetry (error tracking for the CLI itself). The CLI sends anonymized error reports to help improve reliability — set this to opt out.

Terminal window
export SENTRY_CLI_NO_TELEMETRY=1

SENTRY_CLI_NO_UPDATE_CHECK

Disable the automatic update check that runs periodically in the background.

Terminal window
export SENTRY_CLI_NO_UPDATE_CHECK=1

Credential Storage

Credentials are stored in a SQLite database at ~/.sentry/ (or the path set by SENTRY_CONFIG_DIR) with restricted file permissions (mode 600) for security. The database also caches:

  • Organization and project defaults
  • DSN resolution results
  • Region URL mappings
  • Project aliases (for monorepo support)