Dashboard › cli › Distillation
52d37a25-9b8a-4b1d-a08f-cfe8473f1898["lore_tm_v1_DrZXY4QiqZuzNm9-fLe01BZsO4tJeR6ke6O6BsoFrWY","lore_tm_v1_IHxw9Ul9lfXxtdYt1HUozg0m2A96xNIFYBRNSVDF-5Y","lore_tm_v1_pj_J8tan_XicPfAQ9QkZcAtHl_1eE6ysp61jq-43_bE","lore_tm_v1_Ux2ZcBLX3Y1vwVeoTwYoA-OXIqD-SCzpheXVtbh4u2w","lore_tm_v1_Xo2dit0EQkdl7Jyrt7MsJX9--8dYUbttWGodVL7E5N0","lore_tm_v1_lyHDWaHH3AAKcBaDVqCgzUn44IwFkFq8qTFt61bpdow"]
packages/cli/install “never blocks installation or propagates failures” and telemetry must “never fail the script.” report_error() runs in a background subshell with set +e; die() waits with wait 2>/dev/null || true and ignores telemetry’s exit status.packages/cli/install is a Bash installer using set -euo pipefail. It installs an ERR trap: trap 'die "Unexpected failure at line $LINENO" "trap"' ERR; die(message, step) prints the error in red, calls report_error(), waits for the background report without propagating its status, and exits 1.packages/cli/install uses Sentry’s envelope API, collects no PII, and supports opt-out with SENTRY_CLI_NO_TELEMETRY=1. It reports tags os, arch, libc, channel, step, and install.version, plus Bash runtime version; delivery uses curl -sf --max-time 2 to https://o1.ingest.us.sentry.io/api/4510776311808000/envelope/ with output discarded.gen_uuid() in packages/cli/install tries UUID sources in order: 1. /proc/sys/kernel/random/uuid; 2. uuidgen, lowercased; 3. an awk fallback generating 32 hexadecimal characters.packages/cli/install exposes options: -h|--help; -v|--version <version> including "nightly"; --no-modify-path; --no-completions; and --no-agent-skills. Environment variables documented are SENTRY_INSTALL_DIR, SENTRY_VERSION, and SENTRY_INIT=1.Darwin* → darwin, Linux* → linux, and MINGW*|MSYS*|CYGWIN* → windows; unsupported systems fail at step "detect-os". Architecture detection maps x86_64 → x64 and aarch64|arm64 → arm64; unsupported architectures fail at "detect-arch". Windows supports only windows-x64 and uses suffix .exe.packages/cli/install uses two ordered heuristics: 1. presence of /lib/ld-musl-${musl_arch}.so.1; 2. ldd --version 2>&1 | grep -qi musl. Detected musl builds use libc_suffix="-musl" and libc_variant="musl".libstdc++ and libgcc_s. On Alpine, when libstdc++ is absent and the installer is root, it runs apk add --no-cache libstdc++ libgcc; when non-root, it prints apk add libstdc++ libgcc instructions and fails with step "deps".packages/cli/install stages downloads at tmp_binary="${TMPDIR:-${TMP:-${TEMP:-/tmp}}}/sentry-install-$$${suffix}" and installs an EXIT trap to run rm -f "$tmp_binary"; successful cleanup is otherwise handled by setup.packages/cli/install follows six steps: 1. obtain 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 accept headers; 3. extract the version annotation with awk; 4. find the digest for sentry-${os}-${arch}${libc_suffix}${suffix}.gz; 5. obtain the blob redirect from https://ghcr.io/v2/getsentry/cli/blobs/${digest}; 6. download the redirect target without the authorization header and pipe it through gunzip into $tmp_binary.curl -L for GHCR blobs because forwarding the Authorization header to Azure Blob Storage produces HTTP 404; it extracts %{redirect_url} and follows the redirect without authentication.https://api.github.com/repos/getsentry/cli/releases/latest unless a version was requested, strips a leading v, and downloads https://github.com/getsentry/cli/releases/download/${version}/sentry-${os}-${arch}${libc_suffix}${suffix}.curl -fsSL "${url}.gz" 2>/dev/null | gunzip > "$tmp_binary" 2>/dev/null; if unavailable, it falls back to curl -fsSL --progress-bar "$url" -o "$tmp_binary". The comment states compressed downloads are approximately 60% smaller: approximately 37 MB versus 99 MB.packages/cli/install runs chmod +x "$tmp_binary" and delegates installation/configuration to the binary’s cli setup; setup is responsible for directory selection, binary placement, PATH, completions, agent skills, and the welcome message.setup_args="--install --method curl --channel $channel", where channel="nightly" only when requested_version == "nightly" and otherwise channel="stable"; the persisted channel controls future sentry cli upgrade behavior.packages/cli/test/lib/install-script.test.ts creates fake curl and gunzip executables in a temporary bin directory so installer argument parsing and setup delegation can be tested without network access.packages/cli/test/lib/install-script.test.ts tests invocation with --version 0.31.0 --no-modify-path --no-completions --no-agent-skills; it expects exit code 0 and exact delegated arguments in order: 1. cli; 2. setup; 3. --install; 4. --method; 5. curl; 6. --channel; 7. stable; 8. --no-modify-path; 9. --no-completions; 10. --no-agent-skills.packages/cli/src/lib/binary.ts line 152 constructs GitHub binary downloads and lines 156–157 define GITHUB_RELEASES_URL = "https://api.github.com/repos/getsentry/cli/releases"; packages/cli/src/lib/upgrade.ts defines NPM_REGISTRY_URL = "https://registry.npmjs.org/sentry".GHCR_REPO = "getsentry/cli" in packages/cli/src/lib/ghcr.ts line 134; consumers include packages/cli/src/lib/delta-upgrade.ts, which imports GHCR_REPO rather than duplicating the repository literal.packages/cli/src/lib/ghcr.ts configures GHCR_BLOB_TIMEOUT = 30_000 and documents GHCR cold-start latency spikes from 126ms to 30s for identical requests. Its request path includes fetchWithRetry() and distinguishes external aborts using externalSignal?.aborted && error.name === "AbortError".packages/cli/src/lib/upgrade.ts uses getAnonymousToken(), fetchNightlyManifest(), fetchManifest(), and downloadNightlyBlob() for nightly resolution/download; it uses getBinaryDownloadUrl(version) for stable downloads. Versioned nightly manifests use tag nightly-${version}, while the rolling nightly path uses fetchNightlyManifest(token).packages/cli/src/lib/ghcr.ts exports GHCR_TAG = "nightly" alongside GHCR_REPO = "getsentry/cli". fetchNightlyManifest(token) delegates to fetchManifest(token, GHCR_TAG), and downloadLayerBlob() delegates to downloadNightlyBlob(token, digest, signal).packages/cli/test/lib/version-check.test.ts, packages/cli/test/lib/scan/binary.test.ts, packages/cli/test/lib/scan/binary.property.test.ts, packages/cli/test/lib/release-notes.test.ts, packages/cli/test/lib/release-notes.property.test.ts, packages/cli/test/lib/patch-cache.test.ts, packages/cli/test/lib/binary.test.ts, and packages/cli/test/lib/binary.mocked.test.ts.