Skip to content
Draft
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
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 @@ -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

Expand Down
14 changes: 14 additions & 0 deletions apps/cli-docs/src/content/docs/getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions apps/cli-docs/src/content/docs/self-hosted.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 `<email>:<server>` 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:
Expand All @@ -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 `<email>:<server>` 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
Expand Down
6 changes: 3 additions & 3 deletions apps/cli-docs/src/fragments/commands/auth.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 `<email>:<server>` 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.

Expand Down
3 changes: 2 additions & 1 deletion apps/cli-docs/src/fragments/commands/debug-files.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
6 changes: 4 additions & 2 deletions apps/cli-docs/src/fragments/commands/log.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
3 changes: 2 additions & 1 deletion apps/cli-docs/src/fragments/commands/org.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion apps/cli-docs/src/fragments/commands/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -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@<sha>`.
- **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.
9 changes: 8 additions & 1 deletion apps/cli-docs/src/fragments/commands/sourcemap.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

```
Expand All @@ -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.,
Expand Down
2 changes: 1 addition & 1 deletion apps/cli-docs/src/fragments/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions packages/cli/plugins/sentry-cli/skills/sentry-cli/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading