feat(install): add install script served from docs site#95
Conversation
Adds a bash script that downloads and installs the Sentry CLI binary. Supports macOS, Linux, and Windows (via MINGW/MSYS/Cygwin) on x64 and arm64. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
GitHub releases for this repo use version tags without the 'v' prefix (e.g., `0.2.0` not `v0.2.0`). The script was generating URLs like `.../download/v0.2.0/...` which 404'd. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Move install script to docs/public/ so Astro serves it as a static asset at cli.sentry.dev/install, enabling: curl -fsSL https://cli.sentry.dev/install | bash Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Semver Impact of This PR🟡 Minor (new features) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨Issue
Other
Bug Fixes 🐛Issue
Other
Documentation 📚
Internal Changes 🔧
Other
🤖 This preview updates automatically when you update the PR. |
|
| exit 1 | ||
| fi | ||
| ;; | ||
| *) shift ;; |
There was a problem hiding this comment.
Bug: The argument parsing loop silently ignores unknown flags instead of reporting an error, which can mask user typos and lead to installing the wrong version.
Severity: MEDIUM
Suggested Fix
Modify the case statement's default branch (*) to print an error message and exit with a non-zero status code. For example, change *) shift ;; to *) echo "Error: Unknown option: $1"; usage; exit 1 ;;. This will ensure the script fails loudly when given invalid input, providing immediate feedback to the user.
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: docs/public/install#L37
Potential issue: The `while` loop for argument parsing uses a `*) shift ;;` case. This
causes any unrecognized command-line arguments to be silently discarded. For example, if
a user makes a typo like `bash install.sh --verison 1.2.3` instead of `--version 1.2.3`,
the script will ignore the flag and proceed to install the latest version instead of the
specified one. This behavior is inconsistent with the script's explicit error handling
for other argument-related issues and can lead to users unknowingly installing an
incorrect version of the software.
Did we get this right? 👍 / 👎 to inform future reviews.
| exit 1 | ||
| fi | ||
| ;; | ||
| *) shift ;; |
There was a problem hiding this comment.
Bug: The install script silently ignores unknown command-line arguments, which can cause it to install the wrong version if a user makes a typo.
Severity: MEDIUM
Suggested Fix
Modify the argument parsing loop to treat unknown arguments as an error. Replace the *) shift ;; case with a pattern that prints an error message to stderr, displays the usage information, and exits with a non-zero status code, for example: *) echo "Error: Unknown option: $1"; usage; exit 1 ;;.
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: docs/public/install#L37
Potential issue: The install script's argument parsing logic includes a catch-all case
`*) shift ;;` which silently consumes and ignores any unrecognized command-line
arguments. This behavior contradicts the script's `set -euo pipefail` declaration, which
implies a fail-fast approach. If a user makes a typo in an argument, such as `--verison`
instead of `--version`, the script will not report an error. Instead, it will ignore the
intended version pin and proceed to install the latest version of the CLI, leading to an
unexpected and incorrect installation for the user.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| exit 1 | ||
| fi | ||
| ;; | ||
| *) shift ;; |
There was a problem hiding this comment.
Unknown arguments silently ignored causing wrong version
Medium Severity
The *) shift ;; case silently discards unrecognized arguments. If a user typos the version flag (e.g., --versoin instead of --version), both the misspelled flag and the version number are discarded without warning. The script then proceeds to install the latest version instead of the requested one, giving no indication that the user's arguments were ignored. This could cause users to unknowingly install an incompatible version.
Summary
Adds an install script so users can install the CLI with a single command:
curl -fsSL https://cli.sentry.dev/install | bashThe script detects the user's OS/arch, downloads the appropriate binary from GitHub releases, and installs it to
~/.local/bin.Changes
docs/public/installso Astro serves it at the root URLTest plan
After merging and deploying:
curl -fsSL https://cli.sentry.dev/install | bashFor PR previews:
curl -fsSL https://getsentry.github.io/pr-preview/pr-XX/install | bash🤖 Generated with Claude Code