|
| 1 | +--- |
| 2 | +title: init |
| 3 | +description: AI-powered project setup wizard for the Sentry CLI |
| 4 | +--- |
| 5 | + |
| 6 | +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. |
| 7 | + |
| 8 | +**Prerequisites:** You must be authenticated first. Run `sentry auth login` if you haven't already. |
| 9 | + |
| 10 | +## Usage |
| 11 | + |
| 12 | +```bash |
| 13 | +sentry init [directory] |
| 14 | +``` |
| 15 | + |
| 16 | +**Arguments:** |
| 17 | + |
| 18 | +| Argument | Description | |
| 19 | +|----------|-------------| |
| 20 | +| `[directory]` | Project directory (default: current directory) | |
| 21 | + |
| 22 | +**Options:** |
| 23 | + |
| 24 | +| Option | Description | |
| 25 | +|--------|-------------| |
| 26 | +| `--force` | Continue even if Sentry is already installed | |
| 27 | +| `-y, --yes` | Non-interactive mode (accept defaults) | |
| 28 | +| `--dry-run` | Preview changes without applying them | |
| 29 | +| `--features <list>` | Comma-separated features: `errors`, `tracing`, `logs`, `replay`, `metrics` | |
| 30 | + |
| 31 | +## Examples |
| 32 | + |
| 33 | +```bash |
| 34 | +# Run the wizard in the current directory |
| 35 | +sentry init |
| 36 | + |
| 37 | +# Target a subdirectory |
| 38 | +sentry init ./my-app |
| 39 | + |
| 40 | +# Preview what changes would be made |
| 41 | +sentry init --dry-run |
| 42 | + |
| 43 | +# Select specific features |
| 44 | +sentry init --features errors,tracing,logs |
| 45 | + |
| 46 | +# Non-interactive mode (accept all defaults) |
| 47 | +sentry init --yes |
| 48 | +``` |
| 49 | + |
| 50 | +## What the wizard does |
| 51 | + |
| 52 | +1. **Detects your framework** — scans your project files to identify the platform and framework |
| 53 | +2. **Installs the SDK** — adds the appropriate Sentry SDK package to your project |
| 54 | +3. **Instruments your code** — configures error monitoring, tracing, and any selected features |
| 55 | + |
| 56 | +## Supported platforms |
| 57 | + |
| 58 | +The wizard currently supports: |
| 59 | + |
| 60 | +- **JavaScript / TypeScript** — Next.js, Express, SvelteKit, React |
| 61 | +- **Python** — Flask, FastAPI |
| 62 | + |
| 63 | +More platforms and frameworks are coming soon. |
0 commit comments