Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .github/dependency-review-config.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
# React Router's advisory only affects applications using its unstable RSC APIs.
# This application uses the stable browser router and has no RSC integration.
# provider-utils 2.2.8 retains APIs required by ui-utils 1.2.11. Its checked-in
# pnpm patch backports the upstream bounded-response fix, and check:patches
# exercises oversized-body rejection and cancellation against the nested copy.
allow-ghsas:
- GHSA-qwww-vcr4-c8h2
- GHSA-866g-f22w-33x8
3 changes: 1 addition & 2 deletions .oxlintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
"**/worker-configuration.d.ts",
"**/tsconfig*.json",
"packages/mcp-server-mocks/src/fixtures/**",
"packages/codemod-cli3to4/tests/**",
"packages/cli/test/init-eval/templates/sveltekit-app/**"
"packages/codemod-cli3to4/tests/**"
],
"rules": {
"no-unused-vars": "off",
Expand Down
1 change: 1 addition & 0 deletions apps/cli-docs/public/get-started-with-sentry.md
1 change: 1 addition & 0 deletions apps/cli-docs/src/content/docs/agent-guidance.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Best practices and operational guidance for AI coding agents using the Sentry CL

- **Just run the command** — the CLI handles authentication and org/project detection automatically. Don't pre-authenticate or look up org/project before running commands. The CLI prompts for login if needed.
- **Prefer CLI commands over raw API calls** — the CLI has dedicated commands for most tasks. Reach for `sentry issue view`, `sentry issue list`, `sentry trace view`, etc. before constructing API calls manually or fetching external documentation.
- **Use `sentry init` to add Sentry to a project** — it prints step-by-step setup instructions for you to follow: log in, pick a Sentry project, choose features with the user, install the SDK, and verify that a test error arrives. It also covers upgrading an existing setup.
- **Use `sentry docs` for setup questions** — if you need to know how to configure a Sentry SDK or feature, run `sentry docs "your question"` to query the documentation directly. This is faster and more accurate than fetching docs externally.
- **Use `sentry schema` to explore the API** — run `sentry schema` to list API resources or `sentry schema <query...>` to search by API concepts or CLI command paths. Use `sentry help <command>` for CLI flags and usage examples.
- **Use `sentry issue view` to investigate issues** — when asked about a specific issue (e.g., `CLI-G5`, `PROJECT-123`), use `sentry issue view` directly. Multiple IDs can be passed in one invocation: `sentry issue view A B C --json` returns an array of the same objects.
Expand Down
2 changes: 1 addition & 1 deletion apps/cli-docs/src/content/docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ toolkit/
│ │ │ ├── explore.ts # Query aggregate event data (Explore)
│ │ │ ├── help.ts # Help command
│ │ │ ├── info.ts # Print configuration and verify authentication
│ │ │ ├── init.ts # Initialize Sentry in your project (experimental)
│ │ │ ├── init.ts # Print instructions for a coding agent to set up Sentry
│ │ │ ├── mcp.ts # Start a local Sentry MCP server
│ │ │ ├── schema.ts # Browse the Sentry API schema
│ │ │ └── wasm-split.ts# Add build ids to WebAssembly modules and split out debug data
Expand Down
9 changes: 1 addition & 8 deletions apps/cli-docs/src/content/docs/exit-codes.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,7 @@ react to failure categories without parsing stderr.
| 50 | Upgrade Error | CLI upgrade operation failed |
| 51 | Device Flow Error | OAuth device authorization flow failed |
| 60 | Output Error | Command produced output but the operation failed |
| 61 | Wizard Error | Interactive setup wizard encountered an error |
| 62 | Wizard Deps | Wizard dependency installation failed |
| 63 | Wizard Codemod | Wizard codemod plan or apply failed |
| 64 | Wizard Verify | User stopped wizard after verification step |
| 64 | Verify Failed | `sentry local run --verify` received no events from the SDK |
| 252 | Invalid Argument | An argument could not be parsed — see [Argument errors](#argument-errors) |

## Scripting Examples
Expand Down Expand Up @@ -105,10 +102,6 @@ Run the command with `--help` to see the arguments it accepts.
convention — the error response body is useful output. Parse the HTTP status
from `--verbose` output or the JSON error body if you need to distinguish
API error categories.
- The `sentry init` wizard maps its internal workflow exit codes to CLI
exit codes: platform not detected → 20 (Config), dependency install
failed → 62 (Wizard Deps), codemod failed → 63 (Wizard Codemod),
verification stopped → 64 (Wizard Verify), other → 61 (Wizard).
- [Stricli](https://bloomberg.github.io/stricli/) (the CLI framework) uses
negative exit codes (-5 to -1) for framework-level errors like unknown
commands (251) or [invalid arguments](#argument-errors) (252). These
Expand Down
2 changes: 1 addition & 1 deletion apps/cli-docs/src/content/docs/features.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ The Sentry CLI includes several features designed to streamline your workflow, e

## Interactive Selection

When the CLI asks you to choose an organization or project, type to filter the loaded options by name or slug. The filter appears as `/text` below the list. Matching ignores case and tolerates small typos. Use arrow keys to navigate, Enter to select, and Backspace to edit. Esc clears the filter before cancelling; Ctrl+C cancels immediately. The same controls work in the organization, team, and monorepo app selectors in `sentry init`.
When the CLI asks you to choose an organization or project, type to filter the loaded options by name or slug. The filter appears as `/text` below the list. Matching ignores case and tolerates small typos. Use arrow keys to navigate, Enter to select, and Backspace to edit. Esc clears the filter before cancelling; Ctrl+C cancels immediately.

Selectors tolerate typos in unfinished prefixes: `frone` can find `frontend-web`. Queries with one or two characters match literal text only, so `ap` finds `api` but `zz` does not find `ui`.

Expand Down
4 changes: 2 additions & 2 deletions apps/cli-docs/src/content/docs/getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ You can also set `SENTRY_INSTALL_DIR` to override the binary installation direct
curl https://cli.sentry.dev/install -fsS | SENTRY_INSTALL_DIR="$HOME/.local/bin" bash
```

Set `SENTRY_INIT=1` to run [`sentry init`](../commands/init/) right after installing. This requires an interactive terminal:
Set `SENTRY_INIT=1` to run [`sentry init`](../commands/init/) right after installing, which prints the guide a coding agent follows to add Sentry to your project:

```bash
curl https://cli.sentry.dev/install -fsS | SENTRY_INIT=1 bash
Expand Down Expand Up @@ -245,7 +245,7 @@ Credentials are stored in a SQLite database under `$XDG_CONFIG_HOME/sentry/` (de

Once authenticated, you can start using the CLI:

- [Initialize Sentry](../commands/init/) - Set up Sentry in your project with the guided wizard
- [Initialize Sentry](../commands/init/) - Print the guide a coding agent follows to set up Sentry in your project
- [Organization commands](../commands/org/) - List and view organizations
- [Project commands](../commands/project/) - Manage projects
- [Issue commands](../commands/issue/) - Track and manage issues
Expand Down
58 changes: 23 additions & 35 deletions apps/cli-docs/src/fragments/commands/init.md
Original file line number Diff line number Diff line change
@@ -1,44 +1,32 @@


> **Experimental:** `sentry init` is experimental and may modify your source files. Always review changes before committing.
## Setting up Sentry with an agent

**Authentication:** Interactive runs start the OAuth login flow automatically when credentials are missing or the stored session has expired. Non-interactive and CI runs must authenticate before running `sentry init`.
`sentry init` prints a guide for a coding agent to follow; it changes nothing
itself. Ask your agent to run it:

In organization, team, and monorepo app selectors, type to filter the loaded choices by name or slug. The filter appears as `/text` below the list. Matching ignores case and tolerates small typos, including in unfinished prefixes such as `frone` for `frontend-web`. Queries with one or two characters match literal text only. Use arrow keys to navigate, Enter to select, and Backspace to edit. Esc clears an active filter; with no filter, Esc cancels. Ctrl+C always cancels.
> Set up Sentry for me. Run `sentry init` and follow the steps.

## Target Syntax
If the CLI isn't installed yet, point the agent at the published copy, which
starts by installing it:

| 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` | Use the existing project `my-app` from any accessible org. If there is none, use org `my-app` when one exists; otherwise create a new project named `my-app` |
> Set up Sentry for me. Fetch https://cli.sentry.dev/get-started-with-sentry.md and follow it.

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.
When the output is piped, as it is for agents, the command prints the guide's
Markdown source. In a terminal it renders the guide.

## Available Features
## What the guide covers

| Feature | Description |
|---------|-------------|
| `errors` | Error monitoring |
| `tracing` | Performance tracing |
| `logs` | Log integration |
| `replay` | Session replay |
| `profiling` | Profiling |
| `crons` | Cron job monitoring |
| `agent-tracing` | Agent tracing for AI/LLM apps |
| `mcp-observability` | MCP (Model Context Protocol) observability |

## What the Wizard Does

1. **Detects your framework** — scans your project files to identify the platform and framework
2. **Installs the SDK** — adds the appropriate Sentry SDK package to your project
3. **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.
1. Install the CLI and log in with `sentry auth login`
2. Map the project: which apps to set up, which SDKs each one needs (a
framework on a specific runtime, such as TanStack Start on Cloudflare,
needs both SDKs), and whether Sentry is already there. If it is, upgrade
the SDKs or turn on more features instead
3. Pick or create a Sentry project and read its DSN
4. Choose features: errors, tracing, logs, metrics, Session Replay, profiling,
crons, User Feedback, AI agent monitoring, and MCP monitoring
5. Install and configure the SDKs from the current docs (`sentry docs`), never
from remembered versions or APIs
6. Verify that a test error reaches Sentry with `sentry local run --verify`
and `sentry issue list`
7. Report what changed and what is left for you to do
4 changes: 2 additions & 2 deletions docs/releases/stdio.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ The package is a single file with no runtime dependencies.
Cloudflare worker; mcp-core no longer ships SDK v1's server. `zod/v3` is
stubbed in this bundle and the CLI's
(`packages/cli/script/lib/zod-v3-stub-plugin.ts`): only Zod 3 code paths in
`@ai-sdk/provider-utils` and `@mastra/schema-compat` use it, and everything
bundled builds Zod 4 schemas. Zod keeps only its English locale
`@ai-sdk/provider-utils` use it, and everything bundled builds Zod 4
schemas. Zod keeps only its English locale
(`packages/cli/script/lib/zod-locales-plugin.ts`).
- CLI-only code stays out: the other commands, agent skills, completions,
syntax highlighting, the Ink UI, and debug-file processing. Help and `auth`
Expand Down
Loading
Loading