Skip to content

docs(cli): Correct self-hosted login, upgrade, and dev setup docs - #1541

Merged
betegon merged 1 commit into
mainfrom
docs/cli-docs-accuracy-2026-10-12
Oct 19, 2026
Merged

betegon merged 1 commit into
mainfrom
docs/cli-docs-accuracy-2026-10-12

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Summary

This fixes CLI docs that no longer match how the CLI behaves. Every change was checked against the implementation in packages/cli.

What changed

  • Self-hosted login: the docs said setting SENTRY_HOST or SENTRY_URL was enough for sentry auth login. In fact the CLI only trusts a self-hosted host when --url is passed, because that's the only thing that registers a login trust anchor. Without it, login is refused. The self-hosted page, the auth fragment and the generated skill reference now say this, and the env-only example is removed. Also fixed the numbering of the OAuth app setup steps.
  • Upgrade and install methods: added yarn to the install-method table and corrected the bun command to bun add -g. Also noted that switching to nightly from a Homebrew install also moves you to a standalone binary. The --method help for sentry cli setup now lists brew, which it already accepted.
  • Installer: documented SENTRY_INIT=1, which runs sentry init right after installing.
  • Agent skills: the --no-agent-skills choice is saved and applies to later upgrades. sentry cli defaults agent-skills on turns installation back on.
  • Configuration: sentry upgrade is now sentry cli upgrade, and the persistent-defaults intro lists every key sentry cli defaults accepts.
  • Contributor docs: the test commands in contributing.md now match the package scripts. DEVELOPMENT.md now describes SENTRY_CLIENT_ID and the packages/cli/.env.local setup correctly. packages/cli/AGENTS.md now has the right relative link, the full generate:docs steps and an up-to-date command directory list.

Validation

  • Ran generate:schema, generate:docs and the sentry-cli-docs build.
  • ci:policy, lint, typecheck and the repo-wide docs:check passed.
  • The test/commands/cli and test/script tests passed.

via bete.

--

View Junior Session [Sentry]

Co-Authored-By: Miguel Betegon <miguel.betegon@sentry.io>
@vercel

vercel Bot commented Oct 19, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
sentry-local Skipped Skipped Oct 19, 2026 11:09am UTC

Request Review

@sentry-junior sentry-junior Bot added the CLI Sentry CLI and CLI documentation label Oct 19, 2026
@betegon
betegon marked this pull request as ready for review October 19, 2026 11:14
@github-actions github-actions Bot added the risk: low PR risk score: low label Oct 19, 2026
@betegon
betegon merged commit 233a5cf into main Oct 19, 2026
32 checks passed
@betegon
betegon deleted the docs/cli-docs-accuracy-2026-10-12 branch October 19, 2026 11:22
BYK added a commit that referenced this pull request Oct 23, 2026
#1541 fixed most of the CLI docs drift found in getsentry/cli#1644, but
the remaining gaps were all the same kind of problem: hand-written docs
that copy facts out of the code. Fixing each one by hand would just
bring the drift back later, so this PR makes the docs come from the
code, and adds CI checks for what can't be generated.

**Generated from code** (via `generate-docs-sections.ts` markers,
checked by `check:docs-sections`):
- **Destructive commands in the agent Safety Rules.** A new
`destructive` flag on `buildCommand` drives this list, and
`buildDeleteCommand` sets it automatically. `issue merge` and `trial
start` set it explicitly. The list grows from 2 commands to 10, and the
generated skill picks it up. It now also covers `cli uninstall`,
`integration delete` and `issue unlink`, which #1644's hand-made list
missed.
- **Detected agents in agentic-usage.** These come from a new
`AGENT_DISPLAY_NAMES` map. A unit test fails if `detectAgent()` can
return an agent with no display name. This adds Antigravity, which the
docs were missing.
- **Target syntax table** in the commands overview and
`CONTRIBUTING.md`. It comes from `TARGET_FORMS`, and a test runs every
documented example through `parseOrgProjectArg()`. The test also fails
if a parse type has no documented form.
- **Skill file layout in `plugins/README.md`.** Generation fails if a
listed path no longer exists.

**New checks** (added to `ci:policy`):
- **`check:doc-examples`** checks about 1,400 `sentry …` invocations
against the live route tree. It covers fenced shell blocks and inline
code in hand-written docs, plus command `--help` examples. An example
fails if the command doesn't exist (aliases count), if it uses a flag
the command doesn't define, or if it passes a bare `my-org` where the
CLI looks up projects first. The last rule found ambiguous examples in
the dashboard help, `alert metrics create`, `project list` and
`agent-conversation list`, which now use `my-org/`.
- **`check:installer-docs`** checks the install scripts:
- Every `SENTRY_*` variable or flag an install script reads must appear
in its own help text.
- Everything in either installer's help must appear in the installation
guide.
- It caught `SENTRY_CLI_NO_TELEMETRY`, which the bash installer and the
guide didn't mention.
- **`check:stale-refs`** now flags `pnpm run cli -- <args>`. pnpm passes
the literal `--` through, so `pnpm run cli -- --help` fails with
"Command not found: --help".

**Dev setup:** `pnpm run cli` and `generate:docs` now create missing
`src/generated/` files on a fresh checkout through
`script/ensure-generated.mjs`. That removes the `generate:schema`
bootstrap step instead of documenting it. Before this, `pnpm run cli`
and `pnpm run test:unit` failed on a fresh clone.

**Docs-only fixes:**
- The bare-name row in the `sentry init` target table now matches
`resolveTarget`: existing project, then org, then a new project.
- The `--keep-config` help text now uses the XDG config dir constant
instead of `~/.sentry`.
- The package README tells Homebrew and package-manager users to run
`sentry cli setup` for agent skills; package managers also skip
completions.

Not ported from #1644: its claim that Homebrew runs `cli setup`
automatically. The formula in `.craft.yml` doesn't run it, and its
caveats tell users to run it themselves.

<!-- junior-request-attribution:start -->
via **BYK**.
<!-- junior-request-attribution:end -->

<!-- junior-session-footer:start -->
<!-- junior-conversation-id:local%3Aweb%3A7fce60d3964134b1dfb66d55 -->

--

[View Junior Session in
Sentry](https://sentry.sentry.io/explore/conversations/local%3Aweb%3A7fce60d3964134b1dfb66d55/?project=4510944073809921)

<!-- junior-session-footer:end -->

---------

Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
Co-authored-by: Claude Opus <noreply@anthropic.com>
Co-authored-by: BYK <burak.kaya@sentry.io>

This branch was previously deployed

1 inactive deployment
Preview — f5703db8 Deployed Oct 19, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLI Sentry CLI and CLI documentation risk: low PR risk score: low

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants