Commands
init
Set up Sentry in your project with an AI-powered wizard. The init command detects your platform and framework, installs the Sentry SDK, and instruments your code for error monitoring, tracing, and more.
Prerequisites: You must be authenticated first. Run sentry auth login if you haven’t already.
Usage
sentry init [directory]Arguments:
| Argument | Description |
|---|---|
[directory] | Project directory (default: current directory) |
Options:
| Option | Description |
|---|---|
--force | Continue even if Sentry is already installed |
-y, --yes | Non-interactive mode (accept defaults) |
--dry-run | Preview changes without applying them |
--features <list> | Comma-separated features: errors, tracing, logs, replay, metrics |
Examples
# Run the wizard in the current directorysentry init
# Target a subdirectorysentry init ./my-app
# Preview what changes would be madesentry init --dry-run
# Select specific featuressentry init --features errors,tracing,logs
# Non-interactive mode (accept all defaults)sentry init --yesWhat 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
The wizard currently supports:
- JavaScript / TypeScript — Next.js, Express, SvelteKit, React
- Python — Flask, FastAPI
More platforms and frameworks are coming soon.