Skip to content

feat(cli-docs): Serve /install/<handoff code> with SENTRY_HANDOFF set - #2354

Merged
MathurAditya724 merged 1 commit into
mainfrom
feat/cli-site-install-handoff
Nov 18, 2026
Merged

MathurAditya724 merged 1 commit into
mainfrom
feat/cli-site-install-handoff

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

Lets Sentry's setup page show one command that installs the CLI and claims the agent handoff: curl -fsSL https://cli.sentry.dev/install/sntryh_… | bash.

/install/<code> returns the normal install script with export SENTRY_HANDOFF='<code>' added after the shebang. sentry cli setup --install then claims the handoff (#2320). Plain /install doesn't change.

The site is deployed as static Vercel build output, so the new route goes to a small Edge Function. At packaging time, the function gets the same install script the release ships. It only accepts codes that match Sentry's format: sntryh_ followed by 43 base64url chars, the same regex as sentry/agent_handoff/views.py. That keeps anything shell-unsafe out of the script. Any other code returns 404, and responses are sent with Cache-Control: no-store.

To add a function, packaging had to move out of the inline printf/zip in cli-build.yml and into apps/cli-docs/vercel/build-output.mjs. The existing /install routes are byte-for-byte unchanged.

Open questions

  • Vercel's routing to the function hasn't been tried on a real deployment yet. The function reads the code from either the rewritten ?code= or the original /install/<code> path, so it works whichever URL Vercel passes it. Worth trying on a preview deploy before merging.
  • The handoff code now appears in request URLs, so it shows up in Vercel request logs. That seems acceptable for a short-lived, single-use code.
  • Only bash for now. install.ps1/<code> would be a small follow-up if we want a Windows one-liner.

via @evanpurkhiser.

--

View Session [Sentry]

`curl -fsSL https://cli.sentry.dev/install/<code> | bash` now runs the install
script with SENTRY_HANDOFF exported, so Sentry can show one command that
installs the CLI and claims the agent handoff during setup.

The site is static, so the route goes to a small Vercel Edge Function that
embeds the release's install script and adds the export after the shebang. It
only accepts well-formed `sntryh_` codes and sends `Cache-Control: no-store`.
Packaging moves out of inline workflow shell into build-output.mjs; the
existing /install routes are unchanged.

Co-Authored-By: Evan Purkhiser <1421724+evanpurkhiser@users.noreply.github.com>
@vercel

vercel Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
sentry-local Ready Ready Preview Nov 17, 2026 11:57pm UTC

Request Review

@MathurAditya724 MathurAditya724 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed script embedding, code validation, cache headers, and build-output packaging. All 22 CLI docs tests pass, including executing the emitted handoff script through bash, malformed-code rejection, and the packaged function. No blocking issues found. Hosted checks pass; production Vercel routing was not exercised locally.

@MathurAditya724
MathurAditya724 marked this pull request as ready for review November 18, 2026 18:27
@MathurAditya724
MathurAditya724 merged commit e28c7ce into main Nov 18, 2026
36 checks passed
@MathurAditya724
MathurAditya724 deleted the feat/cli-site-install-handoff branch November 18, 2026 18:27

This branch was successfully deployed

1 active deployment
Preview — db0ab100 Deployed Nov 17, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants