Skip to content

feat(install): add SENTRY_INIT env var to run wizard after install#685

Open
betegon wants to merge 1 commit intomainfrom
feat/ephemeral-init-script
Open

feat(install): add SENTRY_INIT env var to run wizard after install#685
betegon wants to merge 1 commit intomainfrom
feat/ephemeral-init-script

Conversation

@betegon
Copy link
Copy Markdown
Member

@betegon betegon commented Apr 7, 2026

Summary

Lets users install the CLI and launch the setup wizard in one command:

SENTRY_INIT=1 curl -fsSL https://cli.sentry.dev/install | bash

After the normal install completes, runs sentry init </dev/tty. The </dev/tty reopens stdin from the terminal since curl | bash consumes it for the pipe.

Also adds install to the docs-preview workflow path filter — changes to the install script weren't triggering preview builds because the symlink in docs/public/ doesn't match the docs/** glob.

Test plan

  • SENTRY_INIT=1 curl -fsSL .../install | bash — installs CLI, then launches wizard with working interactive prompts
  • curl -fsSL .../install | bash (without env var) — normal install, no wizard
  • Docs preview triggers on this PR

Closes #682

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 7, 2026

Semver Impact of This PR

🟡 Minor (new features)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


New Features ✨

  • (install) Add SENTRY_INIT env var to run wizard after install by betegon in #685

Internal Changes 🔧

  • (eval) Replace OpenAI with Anthropic SDK in init-eval judge by betegon in #683
  • Regenerate skill files and command docs by github-actions[bot] in 584ec0e0

🤖 This preview updates automatically when you update the PR.

@betegon betegon changed the title feat: add ephemeral init bootstrapper script feat(install): add --init flag for ephemeral wizard runs Apr 7, 2026
@betegon betegon force-pushed the feat/ephemeral-init-script branch from 5245bcd to 67e56c8 Compare April 7, 2026 19:06
@betegon betegon marked this pull request as ready for review April 7, 2026 19:08
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 7, 2026

PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://cli.sentry.dev/pr-preview/pr-685/

Built to branch gh-pages at 2026-04-07 19:53 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

Lets users install the CLI and launch the setup wizard in one command:

    SENTRY_INIT=1 curl -fsSL https://cli.sentry.dev/install | bash

Uses </dev/tty to reopen stdin from the terminal since curl | bash
consumes it for the pipe.

Also adds `install` to the docs-preview workflow path filter so changes
to the install script trigger a preview build.

Closes #682

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@betegon betegon force-pushed the feat/ephemeral-init-script branch from 6b6df40 to 8b97caa Compare April 7, 2026 19:53
@betegon betegon changed the title feat(install): add --init flag for ephemeral wizard runs feat(install): add SENTRY_INIT env var to run wizard after install Apr 7, 2026
# Optionally launch the setup wizard after install.
# </dev/tty reopens stdin from the terminal since `curl | bash` consumes it.
if [[ "${SENTRY_INIT:-}" == "1" ]]; then
sentry init </dev/tty
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: The install script calls sentry init before the new binary's location (~/.sentry/bin) is added to the current shell's PATH, causing a "command not found" error on some systems.
Severity: MEDIUM

Suggested Fix

Instead of relying on the PATH, call sentry init using the absolute path to the newly installed binary. The installation directory path could be stored in a variable and used to construct the full command path. Alternatively, source the modified shell configuration file before calling sentry init to update the current session's PATH.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: install#L285

Potential issue: The install script attempts to run `sentry init` immediately after
installation. The installation logic in `determineInstallDir()` prioritizes directories
already in the shell's `PATH` (e.g., `~/.local/bin`). However, on systems where these
common directories are not in the `PATH`, it falls back to installing in
`~/.sentry/bin`. While the script updates shell configuration files to add this new
directory to the `PATH`, these changes only apply to future shell sessions.
Consequently, the immediate call to `sentry init` in the current session fails with a
"command not found" error, confusing the user. This primarily affects older or minimal
Linux installations.

Copy link
Copy Markdown
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 8b97caa. Configure here.

# Optionally launch the setup wizard after install.
# </dev/tty reopens stdin from the terminal since `curl | bash` consumes it.
if [[ "${SENTRY_INIT:-}" == "1" ]]; then
sentry init </dev/tty
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

sentry not in PATH after fresh install

High Severity

After a fresh install, sentry init on line 285 calls sentry by bare name, but the binary may not be in the current shell's PATH. The cli setup command installs the binary (e.g., to ~/.sentry/bin) and adds the directory to shell config files, but that only takes effect in new shell sessions. The temp binary ($tmp_binary) has already been deleted by setup. This means for first-time users — the exact target audience of SENTRY_INIT — the command will fail with "command not found," and the ERR trap will fire with a confusing "Unexpected failure" message despite the install itself succeeding.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 8b97caa. Configure here.

# Optionally launch the setup wizard after install.
# </dev/tty reopens stdin from the terminal since `curl | bash` consumes it.
if [[ "${SENTRY_INIT:-}" == "1" ]]; then
sentry init </dev/tty
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ERR trap misreports wizard failure as install failure

Medium Severity

The ERR trap (line 75) is still active when sentry init </dev/tty runs. Since set -e is in effect, any failure of the wizard — missing TTY, user cancellation, network error — triggers die "Unexpected failure at line $LINENO", printing a scary red error and sending a false-positive telemetry event to Sentry. The install already succeeded at that point, so the optional wizard step's failure gets misreported as a catastrophic install failure.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 8b97caa. Configure here.

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.

Offer sentry init as an ephemeral one-liner for users without the CLI installed

1 participant