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: 2 additions & 2 deletions apps/cli-docs/src/content/docs/features.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Selectors tolerate typos in unfinished prefixes: `frone` can find `frontend-web`

## DSN Auto-Detection

The CLI automatically detects your Sentry project from your codebase, eliminating the need to specify the target for every command. DSN detection is one part of the [resolution priority chain](./configuration/#resolution-priority) — it runs after checking for explicit arguments, environment variables, and `.sentryclirc` config files.
The CLI automatically detects your Sentry project from your codebase, eliminating the need to specify the target for every command. DSN detection is one part of the [resolution priority chain](../configuration/#resolution-priority) — it runs after checking for explicit arguments, environment variables, and `.sentryclirc` config files.

### How It Works

Expand All @@ -26,7 +26,7 @@ DSN detection follows this priority order (highest first):
When a DSN is found, the CLI resolves it to your organization and project, then caches the result for fast subsequent lookups.

:::tip
For monorepos or when DSN detection picks up the wrong project, use a [`.sentryclirc` config file](./configuration/#configuration-file-sentryclirc) to pin your org/project explicitly.
For monorepos or when DSN detection picks up the wrong project, use a [`.sentryclirc` config file](../configuration/#configuration-file-sentryclirc) to pin your org/project explicitly.
:::

### Supported Languages
Expand Down
4 changes: 2 additions & 2 deletions apps/cli-docs/src/content/docs/library-usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ const sdk = createSentrySDK({ token: "...", text: true, cwd: "/my/project" });
| `project` | `string` | Auto-detected | Default project slug |
| `text` | `boolean` | `false` | Return human-readable text instead of parsed JSON (`run()` only) |
| `cwd` | `string` | `process.cwd()` | Working directory for DSN auto-detection |
| `headers` | `Record<string, string>` | — | Extra HTTP headers for self-hosted instances behind a reverse proxy (same as [`SENTRY_CUSTOM_HEADERS`](./configuration/#sentry_custom_headers)); ignored for sentry.io |
| `headers` | `Record<string, string>` | — | Extra HTTP headers for self-hosted instances behind a reverse proxy (same as [`SENTRY_CUSTOM_HEADERS`](../configuration/#sentry_custom_headers)); ignored for sentry.io |
| `signal` | `AbortSignal` | — | Abort signal for cancelling streaming commands |

## Return Values
Expand Down Expand Up @@ -221,7 +221,7 @@ Calls should be sequential (awaited one at a time).
- **Node.js >= 20**. On Node.js 22.15+ the built-in `node:sqlite` module is used; on Node.js 20–22.14 the CLI transparently falls back to a bundled WASM SQLite driver, so no native module or extra install step is required.

:::caution
The WASM SQLite fallback (Node.js 20–22.14) does not support [WAL mode](https://www.sqlite.org/wal.html), so concurrent access from multiple processes is slower and its local cache reads/writes are less efficient. For the best performance and reliability we **strongly recommend** the [standalone binary](/installation/) (which bundles a modern runtime) or running on **Node.js 22.15+** so the native `node:sqlite` driver is used.
The WASM SQLite fallback (Node.js 20–22.14) does not support [WAL mode](https://www.sqlite.org/wal.html), so concurrent access from multiple processes is slower and its local cache reads/writes are less efficient. For the best performance and reliability we **strongly recommend** the [standalone binary](../getting-started/) (which bundles a modern runtime) or running on **Node.js 22.15+** so the native `node:sqlite` driver is used.
:::

## Streaming Commands
Expand Down
2 changes: 1 addition & 1 deletion apps/cli-docs/src/content/docs/self-hosted.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,4 +108,4 @@ sentry cli defaults headers "X-IAP: token"
| `NODE_EXTRA_CA_CERTS` | Path to PEM file with additional CA certificates (for corporate proxies) |
<!-- GENERATED:END self-hosted-env-vars -->

See [Configuration](./configuration/) for the full environment variable reference.
See [Configuration](../configuration/) for the full environment variable reference.
2 changes: 1 addition & 1 deletion apps/cli-docs/src/fragments/commands/auth.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ For token-based auth with self-hosted:
sentry auth --token YOUR_TOKEN --url https://sentry.example.com
```

See [Self-Hosted Sentry](../self-hosted/) for details.
See [Self-Hosted Sentry](../../self-hosted/) for details.

### Multiple accounts

Expand Down
2 changes: 1 addition & 1 deletion apps/cli-docs/src/fragments/commands/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ sentry cli feedback i love this tool
sentry cli feedback the issue view is confusing
```

Feedback is sent via Sentry's telemetry system. If telemetry is disabled (`SENTRY_CLI_NO_TELEMETRY=1`), feedback cannot be sent.
Feedback is sent via Sentry's telemetry system. If telemetry is disabled (`SENTRY_CLI_NO_TELEMETRY=1`, `DO_NOT_TRACK=1`, or `sentry cli defaults telemetry off`), feedback cannot be sent.

### Fix configuration issues

Expand Down
6 changes: 3 additions & 3 deletions apps/cli-docs/src/fragments/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ The first source that provides both org and project wins. For org-only commands,
Full issue short IDs, such as `sentry issue view FRONT-ABC`, only need the org:
`SENTRY_ORG`, `.sentryclirc`, and persistent defaults scope the lookup in that order.
Use `sentry issue view other-org/FRONT-ABC` to override the configured organization.
Project aliases retain their associated organization. See [View an issue](./commands/issue/#view-an-issue).
Project aliases retain their associated organization. See [View an issue](../commands/issue/#view-an-issue).

### Backward Compatibility

Expand All @@ -78,7 +78,7 @@ sentry cli defaults # Show all current defaults
sentry cli defaults org --clear # Clear a specific default
```

See [`sentry cli defaults`](./commands/cli/#sentry-cli-defaults) for full usage.
See [`sentry cli defaults`](../commands/cli/#sentry-cli-defaults-key-value) for full usage.

### Disabling tips

Expand Down Expand Up @@ -127,7 +127,7 @@ We store credentials and caches in a SQLite database (`cli.db`) inside the confi
- Region URL mappings
- Project aliases (for monorepo support)

See [Credential Storage](./commands/auth/#credential-storage) in the auth command docs for more details.
See [Credential Storage](../commands/auth/#credential-storage) in the auth command docs for more details.

## Binary Install Location

Expand Down
15 changes: 12 additions & 3 deletions packages/cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@
curl https://cli.sentry.dev/install -fsS | bash
```

### Windows (PowerShell)

```powershell
irm https://cli.sentry.dev/install.ps1 | iex
```

### Homebrew

```bash
Expand Down Expand Up @@ -94,18 +100,21 @@ const sdk = createSentrySDK({ token: "sntrys_..." });
// Typed methods for every CLI command
const orgs = await sdk.org.list();
const issues = await sdk.issue.list({ orgProject: "acme/frontend", limit: 5 });
const issue = await sdk.issue.view({ issue: "ACME-123" });
const issue = await sdk.issue.view({}, "ACME-123");

// Nested commands
await sdk.dashboard.widget.add({ display: "line", query: "count" }, "my-org/my-dashboard");
await sdk.dashboard.widget.add(
{ display: "line", query: ["count"] },
"acme/", "my-dashboard", "Errors over time"
);

// Escape hatch for any CLI command
const version = await sdk.run("--version");
const text = await sdk.run("issue", "list", "-l", "5");
```

Options (all optional):
- `token` — Auth token. Falls back to `SENTRY_AUTH_TOKEN` / `SENTRY_TOKEN` env vars.
- `token` — Auth token. Falls back to the stored login from `sentry auth login`, then `SENTRY_AUTH_TOKEN` / `SENTRY_TOKEN` env vars.
- `url` — Sentry instance URL for self-hosted (e.g., `"sentry.example.com"`).
- `org` — Default organization slug (avoids passing it on every call).
- `project` — Default project slug.
Expand Down
14 changes: 7 additions & 7 deletions packages/cli/src/lib/env-registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export const ENV_VAR_REGISTRY: readonly EnvVarEntry[] = [
{
name: "SENTRY_DSN",
description:
"Sentry DSN for project auto-detection. This is the same DSN you use in `Sentry.init()`. The CLI resolves it to determine your organization and project.\n\nThe CLI also detects DSNs from `.env` files and source code automatically — see [DSN Auto-Detection](./features/#dsn-auto-detection).",
"Sentry DSN for project auto-detection. This is the same DSN you use in `Sentry.init()`. The CLI resolves it to determine your organization and project.\n\nThe CLI also detects DSNs from `.env` files and source code automatically — see [DSN Auto-Detection](../features/#dsn-auto-detection).",
example: "https://key@o123.ingest.us.sentry.io/456",
topLevel: true,
briefDescription: "DSN used to auto-detect org + project.",
Expand All @@ -107,7 +107,7 @@ export const ENV_VAR_REGISTRY: readonly EnvVarEntry[] = [
{
name: "SENTRY_HOST",
description:
"Base URL of your Sentry instance. **Only needed for [self-hosted Sentry](./self-hosted/).** SaaS users (sentry.io) should not set this.\n\nWhen set, all API requests (including OAuth login) are directed to this URL instead of `https://sentry.io`. The CLI also sets this automatically when you pass a self-hosted Sentry URL as a command argument.\n\n`SENTRY_HOST` takes precedence over `SENTRY_URL`. Both work identically — use whichever you prefer.",
"Base URL of your Sentry instance. **Only needed for [self-hosted Sentry](../self-hosted/).** SaaS users (sentry.io) should not set this.\n\nWhen set, all API requests are directed to this URL instead of `https://sentry.io`. Logging in to a self-hosted instance still requires `sentry auth login --url <your-url>`: the CLI refuses to log in to a self-hosted host that only comes from this variable. The CLI also sets this automatically when you pass a self-hosted Sentry URL as a command argument.\n\n`SENTRY_HOST` takes precedence over `SENTRY_URL`. Both work identically — use whichever you prefer.",
example: "https://sentry.example.com",
defaultValue: "https://sentry.io",
topLevel: true,
Expand All @@ -126,7 +126,7 @@ export const ENV_VAR_REGISTRY: readonly EnvVarEntry[] = [
{
name: "SENTRY_CLIENT_ID",
description:
"Client ID of a public OAuth application on your Sentry instance. **Required for [self-hosted Sentry](./self-hosted/)** (26.1.0+) to use `sentry auth login` with the device flow. See the [Self-Hosted guide](./self-hosted/#1-create-a-public-oauth-application) for how to create one.",
"Client ID of a public OAuth application on your Sentry instance. **Required for [self-hosted Sentry](../self-hosted/)** (26.1.0+) to use `sentry auth login` with the device flow. See the [Self-Hosted guide](../self-hosted/#1-create-a-public-oauth-application) for how to create one.",
example: "your-oauth-client-id",
selfHosted: true,
devGuide: "Sentry OAuth app client ID",
Expand All @@ -136,7 +136,7 @@ export const ENV_VAR_REGISTRY: readonly EnvVarEntry[] = [
name: "SENTRY_CUSTOM_HEADERS",
description:
"Custom HTTP headers to include in all requests to your Sentry instance. " +
"**Only applies to [self-hosted Sentry](./self-hosted/).** Ignored when targeting sentry.io.\n\n" +
"**Only applies to [self-hosted Sentry](../self-hosted/).** Ignored when targeting sentry.io.\n\n" +
"Use semicolon-separated `Name: Value` pairs. Useful for environments behind " +
"reverse proxies that require additional headers for authentication " +
"(e.g., Google IAP, Cloudflare Access).\n\n" +
Expand Down Expand Up @@ -165,7 +165,7 @@ export const ENV_VAR_REGISTRY: readonly EnvVarEntry[] = [
{
name: "SENTRY_VERSION",
description:
"Pin a specific version for the [install script](./getting-started/#install-script). Accepts a version number (e.g., `0.40.0`) or `nightly`. The `--version` flag takes precedence if both are set.\n\nThis is useful in CI/CD pipelines and Dockerfiles where you want reproducible installations without inline flags.",
"Pin a specific version for the [install script](../getting-started/#install-script). Accepts a version number (e.g., `0.40.0`) or `nightly`. The `--version` flag takes precedence if both are set.\n\nThis is useful in CI/CD pipelines and Dockerfiles where you want reproducible installations without inline flags.",
example: "nightly",
installOnly: true,
},
Expand Down Expand Up @@ -197,7 +197,7 @@ export const ENV_VAR_REGISTRY: readonly EnvVarEntry[] = [
{
name: "SENTRY_PLAIN_OUTPUT",
description:
"Force plain text output (no colors or ANSI formatting). Takes precedence over `NO_COLOR`.",
"Force plain text output (no colors or ANSI formatting). Takes precedence over `NO_COLOR`. Set to `0` or `false` to force formatted output, even when piped.",
example: "1",
},
{
Expand Down Expand Up @@ -235,7 +235,7 @@ export const ENV_VAR_REGISTRY: readonly EnvVarEntry[] = [
{
name: "SENTRY_OUTPUT_FORMAT",
description:
"Force the output format for all commands. Currently only `json` is supported. This is primarily used by the [library API](./library-usage/) (`createSentrySDK()`) to get JSON output without passing `--json` flags.",
"Force the output format for all commands. Currently only `json` is supported. This is primarily used by the [library API](../library-usage/) (`createSentrySDK()`) to get JSON output without passing `--json` flags.",
example: "json",
},
// -- Logging & telemetry --
Expand Down
5 changes: 3 additions & 2 deletions packages/cli/src/lib/sdk-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ import { redactCredentialText } from "./credential-redaction.js";
/** Options for programmatic CLI invocation. */
export type SentryOptions = {
/**
* Auth token override. When omitted, falls back to `SENTRY_AUTH_TOKEN`
* or `SENTRY_TOKEN` environment variables, then stored credentials.
* Auth token override. When omitted, falls back to stored credentials from
* `sentry auth login`, then the `SENTRY_AUTH_TOKEN` or `SENTRY_TOKEN`
* environment variables (set `SENTRY_FORCE_ENV_TOKEN=1` to prefer them).
*/
token?: string;

Expand Down
Loading