From 203ee4587eacdfcc4b64e246de6b4b41e93e0675 Mon Sep 17 00:00:00 2001 From: "sentry-junior[bot]" <264270552+sentry-junior[bot]@users.noreply.github.com> Date: Mon, 9 Nov 2026 13:06:57 +0000 Subject: [PATCH 1/2] docs(cli): Document setup-code installs and email:server logins --- apps/cli-docs/src/content/docs/getting-started.mdx | 14 ++++++++++++++ apps/cli-docs/src/content/docs/self-hosted.md | 4 ++-- apps/cli-docs/src/fragments/commands/auth.md | 6 +++--- apps/cli-docs/src/fragments/configuration.md | 2 +- .../plugins/sentry-cli/skills/sentry-cli/SKILL.md | 1 + 5 files changed, 21 insertions(+), 6 deletions(-) diff --git a/apps/cli-docs/src/content/docs/getting-started.mdx b/apps/cli-docs/src/content/docs/getting-started.mdx index 7e4e61ae5..2476d98fc 100644 --- a/apps/cli-docs/src/content/docs/getting-started.mdx +++ b/apps/cli-docs/src/content/docs/getting-started.mdx @@ -197,6 +197,20 @@ Sentry CLI configuration directory (`$XDG_CONFIG_HOME/sentry/`, defaulting to `~/.config/sentry/`, overridable with `SENTRY_CONFIG_DIR`) across runs to keep automatic refresh working. +### Setup Code + +To log in without a browser, for example on a headless machine, set +`SENTRY_SETUP_CODE` to a setup code from Sentry. The install script redeems it +when no login is stored yet: + +```bash +curl https://cli.sentry.dev/install -fsS | SENTRY_SETUP_CODE=... bash +``` + +With the CLI already installed, run `SENTRY_SETUP_CODE=... sentry auth bootstrap`. +Each code is short-lived and works once. See +[Setup codes](../commands/auth/#setup-codes) for details. + ### API Token Alternatively, you can use an API token directly: diff --git a/apps/cli-docs/src/content/docs/self-hosted.md b/apps/cli-docs/src/content/docs/self-hosted.md index 83fbc498b..e7857373d 100644 --- a/apps/cli-docs/src/content/docs/self-hosted.md +++ b/apps/cli-docs/src/content/docs/self-hosted.md @@ -32,7 +32,7 @@ Pass your instance URL with the `--url` flag. It registers the host as trusted: SENTRY_CLIENT_ID=your-client-id sentry auth login --url https://sentry.example.com ``` -`--url` is required even when `SENTRY_HOST` or `SENTRY_URL` is already set. Without it, `sentry auth login` refuses to log in to a self-hosted host. +`--url` is required even when `SENTRY_HOST` or `SENTRY_URL` is already set. Without it, `sentry auth login` refuses to log in to a self-hosted host. An `:` argument, such as `sentry auth login jane@example.com:sentry.example.com`, sets `--url` the same way. :::tip You can export both variables in your shell profile so every CLI invocation picks them up: @@ -44,7 +44,7 @@ export SENTRY_CLIENT_ID=your-client-id ::: :::note -The `--url` flag is the only way to register a trust anchor for a new host. Without it, the CLI refuses to log in to any self-hosted instance URL, including one picked up from an environment variable or a `.sentryclirc` file. This protects you from credential leaks and OAuth phishing. +For `sentry auth login`, the `--url` flag (or the server in an `:` argument) is the only way to register a trust anchor for a new host. Without it, the CLI refuses to log in to any self-hosted instance URL, including one picked up from an environment variable or a `.sentryclirc` file. This protects you from credential leaks and OAuth phishing. ::: ### With an API Token diff --git a/apps/cli-docs/src/fragments/commands/auth.md b/apps/cli-docs/src/fragments/commands/auth.md index f63fe4d18..a5ce003da 100644 --- a/apps/cli-docs/src/fragments/commands/auth.md +++ b/apps/cli-docs/src/fragments/commands/auth.md @@ -24,9 +24,9 @@ HTTP instance and `--force` to replace the stored login for the issuing server. ## Self-hosted Sentry -Pass `--url` to log in to a self-hosted instance. Setting `SENTRY_HOST` or -`SENTRY_URL` alone is not enough: the CLI refuses to log in to a self-hosted -host unless `--url` confirms it. +Pass `--url` (or an `:` argument) to log in to a self-hosted +instance. Setting `SENTRY_HOST` or `SENTRY_URL` alone is not enough: the CLI +refuses to log in to a self-hosted host unless `--url` confirms it. See [Self-Hosted Sentry](../../self-hosted/) for details. diff --git a/apps/cli-docs/src/fragments/configuration.md b/apps/cli-docs/src/fragments/configuration.md index 19bdc04ed..57b553b83 100644 --- a/apps/cli-docs/src/fragments/configuration.md +++ b/apps/cli-docs/src/fragments/configuration.md @@ -47,7 +47,7 @@ When you run a command from `packages/frontend/`, the CLI resolves `org = my-com When the CLI needs to determine your org and project, it checks these sources in order: 1. **Explicit CLI arguments** — `sentry issue list my-org/my-project` -2. **Environment variables** — `SENTRY_ORG` / `SENTRY_PROJECT` +2. **Environment variables** — `SENTRY_ORG` / `SENTRY_PROJECT`. Without `SENTRY_ORG`, an organization auth token (`sntrys_…`) supplies its own organization 3. **`.sentryclirc` config file** — walked up from CWD, merged with `~/.sentryclirc` 4. **Persistent defaults** — set via `sentry cli defaults` 5. **DSN auto-detection** — scans source code and `.env` files diff --git a/packages/cli/plugins/sentry-cli/skills/sentry-cli/SKILL.md b/packages/cli/plugins/sentry-cli/skills/sentry-cli/SKILL.md index 5212f1152..fc79cd338 100644 --- a/packages/cli/plugins/sentry-cli/skills/sentry-cli/SKILL.md +++ b/packages/cli/plugins/sentry-cli/skills/sentry-cli/SKILL.md @@ -389,6 +389,7 @@ npm install -g sentry ```bash sentry auth +curl https://cli.sentry.dev/install -fsS | SENTRY_SETUP_CODE=... bash sentry auth --token YOUR_SENTRY_API_TOKEN sentry auth status sentry auth logout From 293c1ceba301aaa372e22d6a26fbbad81645c81b Mon Sep 17 00:00:00 2001 From: "sentry-junior[bot]" <264270552+sentry-junior[bot]@users.noreply.github.com> Date: Mon, 9 Nov 2026 13:09:40 +0000 Subject: [PATCH 2/2] docs(cli): Correct log ID, selector, sourcemap, and set-commits details --- apps/cli-docs/src/content/docs/features.md | 2 +- apps/cli-docs/src/fragments/commands/debug-files.md | 3 ++- apps/cli-docs/src/fragments/commands/log.md | 6 ++++-- apps/cli-docs/src/fragments/commands/org.md | 3 ++- apps/cli-docs/src/fragments/commands/release.md | 2 +- apps/cli-docs/src/fragments/commands/sourcemap.md | 9 ++++++++- 6 files changed, 18 insertions(+), 7 deletions(-) diff --git a/apps/cli-docs/src/content/docs/features.md b/apps/cli-docs/src/content/docs/features.md index 370808da9..850ebd237 100644 --- a/apps/cli-docs/src/content/docs/features.md +++ b/apps/cli-docs/src/content/docs/features.md @@ -9,7 +9,7 @@ The Sentry CLI includes several features designed to streamline your workflow, e 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`. +Selectors also match letters in order, even when they're apart: `fw` finds `frontend-web`. From four characters on, selectors tolerate a typo at a word start: `frone` can find `frontend-web`. ## DSN Auto-Detection diff --git a/apps/cli-docs/src/fragments/commands/debug-files.md b/apps/cli-docs/src/fragments/commands/debug-files.md index 898975730..3b8849856 100644 --- a/apps/cli-docs/src/fragments/commands/debug-files.md +++ b/apps/cli-docs/src/fragments/commands/debug-files.md @@ -7,7 +7,8 @@ `--no-well-known`), the current directory (unless `--no-cwd`), and any `--path`/`-p` directories, recursively. - Restrict the search with `--type`/`-t` (repeatable): `dsym`, `elf`, `pe`, - `pdb`, `portablepdb`, `sourcebundle`, `breakpad`, `proguard`, `jvm`. + `pdb`, `portablepdb`, `sourcebundle`, `breakpad`, `proguard`, `jvm`, + `wasm`. - A debug identifier must match exactly, including any PE/PDB age suffix. A Breakpad symbol file is listed when it matches, but does **not** satisfy the request (the id is still reported as missing). diff --git a/apps/cli-docs/src/fragments/commands/log.md b/apps/cli-docs/src/fragments/commands/log.md index 1d7d5048f..a1f128e4b 100644 --- a/apps/cli-docs/src/fragments/commands/log.md +++ b/apps/cli-docs/src/fragments/commands/log.md @@ -3,8 +3,10 @@ ## Log IDs Copy the full ID from the `ID` column in `sentry log list` or `sentry trace logs` -into `sentry log view`. An abbreviated prefix can match multiple logs and cannot -be expanded into a unique full ID by itself. +into `sentry log view`. A partial ID of at least 8 hex characters is looked up +among the project's logs from the last 30 days: a single match is used with a +warning, and several matches fail with a list of candidates. Pass the full +32-character ID for older logs. Log IDs can be found: diff --git a/apps/cli-docs/src/fragments/commands/org.md b/apps/cli-docs/src/fragments/commands/org.md index 595aa050a..b86f7d298 100644 --- a/apps/cli-docs/src/fragments/commands/org.md +++ b/apps/cli-docs/src/fragments/commands/org.md @@ -4,7 +4,8 @@ Pass a filter to `sentry org list` to only list organizations whose slug or name matches it, best matches first. Matching ignores case and accepts exact -matches, prefixes, substrings, small typos, or a glob such as `'acme-*'`. +matches, prefixes, substrings, letters in order (`fw` finds `frontend-web`), +small typos, or a glob such as `'acme-*'`. ## Multiple accounts diff --git a/apps/cli-docs/src/fragments/commands/release.md b/apps/cli-docs/src/fragments/commands/release.md index ef54f842d..d987cca93 100644 --- a/apps/cli-docs/src/fragments/commands/release.md +++ b/apps/cli-docs/src/fragments/commands/release.md @@ -12,4 +12,4 @@ sequence. - **The `org/` prefix is the org slug**: In `sentry release create sentry/1.0.0`, `sentry` is the org slug and `1.0.0` is the version. The `/` separates org from version — it is not part of the version string. - **`--auto` needs a git checkout or CI variables**: The `--auto` flag lists repos from the Sentry API and matches against your local `origin` remote URL. Without one (for example, Docker builds that exclude `.git`), it uses the repository and commit from the CI provider: GitHub Actions, GitLab CI, Bitbucket Pipelines, Vercel production builds, Render, Railway, CircleCI, Buildkite, Netlify, and Azure Pipelines. Otherwise, pass `--commit owner/repo@`. - **Commits need a repository in Sentry**: `--auto` and `--commit` only work for repositories that a source code integration (GitHub, GitLab, Bitbucket, Azure DevOps) added to your Sentry org. `--commit` takes the name that `sentry repo list` shows. When a name only differs from Sentry's (for example in case), the CLI uses Sentry's name and prints a warning. If your org has no repositories, connect an integration in Sentry under **Settings → Integrations**; the CLI cannot install integrations yet. Until then, `--local` reads commits from local git history. -- **Default mode tries `--auto` first**: When neither `--auto` nor `--local` is specified, `set-commits` tries auto-discovery first and falls back to local git history if the integration isn't configured. +- **Default mode tries `--auto` first**: When neither `--auto` nor `--local` is specified, `set-commits` tries auto-discovery first. It falls back to local git history when the org has no repository integration, or, inside a git checkout, when auto-discovery can't determine or match the repository. Without a git checkout, that repository error is shown instead. diff --git a/apps/cli-docs/src/fragments/commands/sourcemap.md b/apps/cli-docs/src/fragments/commands/sourcemap.md index 54adde5e4..de1546ee1 100644 --- a/apps/cli-docs/src/fragments/commands/sourcemap.md +++ b/apps/cli-docs/src/fragments/commands/sourcemap.md @@ -23,7 +23,8 @@ For each JavaScript file, it reports whether the companion `.map` was located Both `sentry sourcemap inject` and `sentry sourcemap upload` exit with an error if zero JS + sourcemap pairs are discovered in the target -directory. This catches silent bundler misconfigurations — the most +directory. The `upload` target can also be a glob such as `'.next/static/**'`; +a path that exists as a directory is used as-is. This catches silent bundler misconfigurations — the most common cause is a bundler that isn't emitting `.map` files: ``` @@ -33,6 +34,12 @@ common cause is a bundler that isn't emitting `.map` files: # webpack: set `devtool: "hidden-source-map"`. # esbuild: set `sourcemap: true` or `sourcemap: "linked"`. + +# Next.js: remove `productionBrowserSourceMaps: false` from next.config +# (`withSentryConfig` turns it on), or set `sourcemaps.disable: true` in +# `withSentryConfig` to skip the upload. For `.next/server`, check that a +# custom `webpack()` doesn't set `config.devtool` and that +# `experimental.serverSourceMaps` isn't `false`. ``` For CI steps that may run against legitimately-empty directories (e.g.,