org/project) and automatic inference from your environment.
Resolution Priority
The CLI resolves org and project in this order (highest to lowest):- Explicit CLI arguments -
sentry issue list acme/frontend - Environment variables -
SENTRY_ORG/SENTRY_PROJECT - Config defaults -
sentry config set org acme - DSN auto-detection - Scans source code and
.envfiles - Directory name inference - Matches project slugs using word boundaries
Explicit CLI Arguments
Org/Project Format
Most commands accept an org/project argument in the format<org>/<project>:
Positional vs Flag Arguments
Some commands use positional arguments, others use flags:When using flags, both
--org and --project must be provided together. Providing only one will result in an error.Environment Variables
Set organization and project via environment variables:Combo Notation
SENTRY_PROJECT supports the <org>/<project> combo notation:
SENTRY_ORG is ignored.
Resolution Logic
Config Defaults
Set default org and project that persist across commands:DSN Auto-Detection
When no explicit target is provided, the CLI automatically detects the project from DSN:Resolution via DSN
The CLI resolves DSN to org/project using cached project info:Project Cache Schema
Project info is cached to avoid repeated API calls. Cache entries are keyed by either
org_id:project_id or dsn_key depending on the DSN format.Directory Name Inference
As a last resort, the CLI infers the project from the current directory name:Word Boundary Matching
The inference uses bidirectional word boundary matching (\b):
Inference Rules
- Minimum directory name length: 2 characters
- Hidden directories (starting with
.) are skipped - Matches are cached for 24 hours
Multiple Project Resolution
In monorepo scenarios, the CLI may detect multiple projects:issue list) will process all detected targets.
Org Prefix Normalization
DSN hosts encode org IDs with ano prefix (e.g., o1081365). The API rejects this form, so the CLI strips it:
The regex
/^o(\d+)$/ is safe for slugs like “organic” because it requires the entire string to match the pattern.Resolved Target Type
All resolution functions return aResolvedTarget:
Display Names
The CLI displays friendly names when available:Error Handling
Missing Context
When no target can be resolved:Ambiguous Projects
When a project slug exists in multiple organizations:Resolution Failures
Numeric Project IDs
The CLI supports numeric project IDs for API queries:When a numeric project ID is successfully resolved, the CLI hints about using the slug form for faster lookups.