Dashboard › cli › Distillation
a1f8fc88-a31d-4a9e-9bc4-2c4e9a457ade["lore_tm_v1_y1pAAtJepj6GgoDatu2P2_0Uk1SZ6RzaXJN5q7dCYZo","lore_tm_v1_Jz5Z5p0IQuZO2fKykghT_bB_yLANAK_CvKrjtDuESrs","lore_tm_v1_O1C6DEfMofIm3rf-DHOQt6UohDGUsezioJXGGqqNOBA","lore_tm_v1__Y_bsSkPKsuZlWJSv2oqc-hni7yIgefTsLVwhUFFIIE","lore_tm_v1_sKqiRTQyIEHJGu_wtdJA6ZKlyroPNlKZMJgKzawyD1o","lore_tm_v1_lYe274aqlX3lVofT9Qcp-aqYUirJyMG1E8qNd57QYRk","lore_tm_v1_hBlfsPOYASvS-KhJJtLZtovt3suHsJvQ1xX7sySss5g"]
packages/cli/src/lib/binary.ts lines 130-142 defines getPlatformBinaryName() using the release/GHCR naming convention sentry-<os>-<arch>[-musl][.exe]: macOS maps to darwin, Windows to windows, all other platforms to linux; arm64 remains arm64, other architectures map to x64; musl adds -musl, and Windows adds .exe.packages/cli/src/lib/binary.ts lines 151-157 defines getBinaryDownloadUrl(version) as https://github.com/getsentry/cli/releases/download/${version}/${getPlatformBinaryName()} and GITHUB_RELEASES_URL as https://api.github.com/repos/getsentry/cli/releases.packages/cli/src/lib/binary.ts lines 168-182 defines isNightlyVersion(version) by checking for "-dev." and compareVersions(a, b) via semverCompare; nightly format is X.Y.Z-dev.<unix-seconds>, whose numeric prerelease identifier is compared numerically under SemVer.packages/cli/src/lib/binary.ts lines 190-222 defines isDowngrade(current, target) as compareVersions(current, target) === 1, getBinaryFilename() as sentry.exe on Windows and sentry elsewhere, and getBinaryPaths(installPath) with sibling paths ${installPath}.download, ${installPath}.old, and ${installPath}.lock.determineInstallDir() in packages/cli/src/lib/binary.ts lines 238-260 uses this priority: 1. SENTRY_INSTALL_DIR; 2. ~/.local/bin if it exists and is in PATH; 3. ~/bin if it exists and is in PATH; 4. ~/.sentry/bin as fallback.fetchWithUpgradeError() in packages/cli/src/lib/binary.ts lines 283-303 rethrows AbortError unchanged, converts TLS certificate failures into UpgradeError("network_error", buildTlsErrorDetail(error)), and converts other connection failures into UpgradeError("network_error", \Failed to connect to ${serviceName}: ${msg}`)`.replaceBinarySync() in packages/cli/src/lib/binary.ts is intentionally synchronous so its rename sequence cannot be interrupted: Unix atomically renames over the target; Windows first renames the running executable to ${installPath}.old, then moves the temporary binary into place, with cleanupOldBinary() handling .old on the next startup.packages/cli/src/lib/binary.ts exposes additional upgrade/install symbols: KNOWN_CURL_DIRS, InstallationMethod, parseInstallationMethod(), isMusl(), isDowngrade(), getBinaryFilename(), determineInstallDir(), getGitHubHeaders(), cleanupOldBinary(), acquireLock(), releaseLock(), and installBinary(); internal symbols include VALID_METHODS and handleExistingLock().packages/cli/test/lib/install-script.test.ts runs the packages/cli/install shell installer without network access by substituting fake curl and gunzip executables in a temporary PATH.bash packages/cli/install --version 0.31.0 --no-modify-path --no-completions --no-agent-skills, expects exit code 0, and verifies exact setup arguments in order: cli, setup, --install, --method, curl, --channel, stable, --no-modify-path, --no-completions, --no-agent-skills.packages/cli/install must be fire-and-forget, run in a background subshell, never block installation, never propagate failures, and βnever fail the script.βpackages/cli/install implements error telemetry through report_error(), respects SENTRY_CLI_NO_TELEMETRY=1, generates an event UUID using /proc/sys/kernel/random/uuid, then uuidgen, then an awk fallback, escapes JSON values, and sends a Sentry envelope with curl -sf --max-time 2; the public write-only DSN credential value was present in the file but is omitted from observations.die() in packages/cli/install prints the error, calls report_error(), executes wait 2>/dev/null || true to let background telemetry finish while ignoring its status, and exits 1; an ERR trap reports Unexpected failure at line $LINENO with step trap.packages/cli/install supports -h/--help, -v/--version <version>, --no-modify-path, --no-completions, and --no-agent-skills; environment controls include SENTRY_INSTALL_DIR, SENTRY_VERSION, SENTRY_INIT=1, and SENTRY_CLI_NO_TELEMETRY=1.Darwin* to darwin, Linux* to linux, and MINGW*|MSYS*|CYGWIN* to windows; architecture detection maps x86_64 to x64 and aarch64|arm64 to arm64, rejects other architectures, and supports only windows-x64.packages/cli/install first checks /lib/ld-musl-${musl_arch}.so.1, then checks whether ldd --version contains musl; on Alpine, missing libstdc++/libgcc are installed with apk add --no-cache libstdc++ libgcc when running as root, while non-root users receive manual installation instructions and the installer exits.packages/cli/install uses six GHCR OCI steps: 1. acquire an anonymous token from https://ghcr.io/token?scope=repository:getsentry/cli:pull; 2. fetch https://ghcr.io/v2/getsentry/cli/manifests/nightly with OCI manifest media type; 3. extract version via awk; 4. locate the digest for sentry-${os}-${arch}${libc_suffix}${suffix}.gz; 5. obtain the blob redirect URL without following it with authorization; 6. download the redirected blob without the authorization header and pipe it through gunzip.packages/cli/install resolves an unspecified version from https://api.github.com/repos/getsentry/cli/releases/latest, strips a leading v, downloads from https://github.com/getsentry/cli/releases/download/${version}/${filename}, first attempts the gzip asset (documented as about 60% smaller, approximately 37 MB versus 99 MB), and falls back to the raw binary.packages/cli/install delegates placement and configuration to "$tmp_binary" cli setup --install --method curl --channel $channel, where channel is nightly only for a nightly request and otherwise stable; it conditionally appends --no-modify-path, --no-completions, and --no-agent-skills.SENTRY_INIT=1, packages/cli/install searches in order through SENTRY_INSTALL_DIR, $HOME/.local/bin, $HOME/bin, and $HOME/.sentry/bin; it requires /dev/tty and then runs exec "$sentry_bin" init </dev/tty.packages/cli/src/lib/upgrade.ts, packages/cli/src/lib/delta-upgrade.ts, packages/cli/src/lib/version-check.ts, packages/cli/src/lib/release-notes.ts, packages/cli/src/lib/binary.ts, and packages/cli/src/lib/ghcr.ts: stable GitHub releases use GITHUB_RELEASES_URL, package-manager lookups use NPM_REGISTRY_URL = "https://registry.npmjs.org/sentry", and nightly artifacts use GHCR_REPO = "getsentry/cli" with GHCR_TAG = "nightly".