Commands
init
Initialize Sentry in your project (experimental)
Usage
sentry init <target> <directory>
Initialize Sentry in your project (experimental)
Arguments:
| Argument | Description |
|---|---|
<target> | <org>/<project>, <org>/, <project>, or a directory path |
<directory> | Project directory (default: current directory) |
Options:
| Option | Description |
|---|---|
-y, --yes | Non-interactive mode (accept defaults) |
--dry-run | Preview changes without applying them |
--features <features>... | Features to enable: errors,tracing,logs,replay,metrics,profiling,sourcemaps,crons,ai-monitoring,user-feedback |
-t, --team <team> | Team slug to create the project under |
All commands support --json for machine-readable output and --fields to select specific JSON fields.
Experimental:
sentry initis experimental and may modify your source files. Always review changes before committing.
Prerequisites: You must be authenticated first. Run sentry auth login if you haven't already.
Examples
# Interactive setupsentry init
# Non-interactive with auto-yessentry init -y
# Dry run to preview changessentry init --dry-run
# Target a subdirectorysentry init ./my-app
# Use a specific org (auto-detect project)sentry init acme/
# Use a specific org and projectsentry init acme/my-app
# Assign a team when creating a new projectsentry init acme/ --team backend
# Enable specific featuressentry init --features profiling,replayTarget Syntax
| Syntax | Meaning |
|---|---|
| (omitted) | Auto-detect org and project |
acme/ | Use org acme, auto-detect or create project |
acme/my-app | Use org acme and project my-app |
my-app | Search for project my-app across all accessible orgs |
Path-like arguments (starting with ., /, or ~) are always treated as the directory. The order of target and directory can be swapped — the CLI will auto-correct with a warning.
Available Features
| Feature | Description |
|---|---|
errors | Error monitoring |
tracing | Performance tracing |
logs | Log integration |
replay | Session replay |
metrics | Custom metrics |
profiling | Profiling |
sourcemaps | Source map uploads |
crons | Cron job monitoring |
ai-monitoring | AI/LLM monitoring |
user-feedback | User feedback widget |
What the Wizard Does
- Detects your framework — scans your project files to identify the platform and framework
- Installs the SDK — adds the appropriate Sentry SDK package to your project
- Instruments your code — configures error monitoring, tracing, and any selected features
Supported Platforms
- JavaScript / TypeScript — Next.js, Express, SvelteKit, React
- Python — Flask, FastAPI
More platforms and frameworks are coming soon.