Dashboard › cli › Distillation
363e0a7d-c464-4d94-a6a7-a260736eca68["lore_tm_v1_3RC4mtiqPjIgEBdSauA0GW_IiSSACQwTmXgNTlcN3jQ","lore_tm_v1_Tg6PLfa-EJabqOEW4CMJlAkkXtWdbsF8cb4YHz_dqjw","lore_tm_v1_1kNMqZ8M80f0tZkSdSXbPb1qX6fpTQZMIcoRRHYoeKc","lore_tm_v1_UtXzGjETx0IpIKRNWo0IAoJzwLa4z4SeJhdpRvodVaQ"]
packages/cli/test/lib/install-script.test.ts is a 109-line Vitest shell-installer test suite that runs packages/cli/install via spawn("bash", ...) with fake download utilities, avoiding network access.packages/cli/test/lib/install-script.test.ts creates a temporary sentry-install-test- directory, prepends its bin directory to PATH, sets SENTRY_TEST_ARGS_FILE and TMPDIR, and removes the directory recursively in afterEach().curl emits a shell script that writes every received argument to $SENTRY_TEST_ARGS_FILE; fake gunzip is implemented as cat.packages/cli/install with --version 0.31.0 --no-modify-path --no-completions --no-agent-skills, expects exit code 0, and verifies exact delegated arguments in order: cli, setup, --install, --method, curl, --channel, stable, --no-modify-path, --no-completions, --no-agent-skills.packages/cli/install is a 354-line Bash installer using set -euo pipefail.packages/cli/install implements fire-and-forget Sentry error telemetry through the envelope API using the CLIβs public write-only DSN, states that no PII is collected, and supports opt-out with SENTRY_CLI_NO_TELEMETRY=1; the credential-like DSN key value is omitted from observations.report_error() runs in a background subshell with set +e.https://o1.ingest.us.sentry.io, project ID 4510776311808000, and ${SENTRY_INGEST}/api/${SENTRY_PROJECT_ID}/envelope/; its curl uses -sf --max-time 2, Content-Type: application/x-sentry-envelope, Sentry auth version 7, and discards stdout/stderr.gen_uuid() tries UUID sources in order: 1. /proc/sys/kernel/random/uuid; 2. uuidgen lowercased; 3. an awk fallback generating 32 hexadecimal characters. report_error() removes hyphens from the result.report_error(message, step-name) JSON-escapes backslashes, quotes, and newlines and reports an error event with logger install, server name install-script, UTC timestamp, Bash runtime version, and tags os, arch, libc, channel, step, and install.version.die(message, step-name) prints the message in red to stderr, calls report_error(), executes wait 2>/dev/null || true so telemetry failure status is ignored, and exits 1; an ERR trap reports Unexpected failure at line $LINENO with step trap.-h|--help, -v|--version <version>, --no-modify-path, --no-completions, and --no-agent-skills; environment variables documented are SENTRY_INSTALL_DIR, SENTRY_VERSION, and SENTRY_INIT.--version without a following value calls die "Error: --version requires a version argument" "args"; unknown arguments are skipped.Darwin* β darwin, Linux* β linux, and MINGW*|MSYS*|CYGWIN* β windows; unsupported systems fail with step detect-os.x86_64 β x64 and aarch64|arm64 β arm64; unsupported architectures fail with step detect-arch. Windows additionally requires x64 and uses suffix .exe./lib/ld-musl-${musl_arch}.so.1, with x64 β x86_64 and arm64 β aarch64; 2. ldd --version 2>&1 | grep -qi musl. A detected musl system uses libc_suffix="-musl" and libc_variant="musl".libstdc++ using ldconfig -p or /usr/lib/libstdc++.so.6; when apk exists and the process is root, it runs apk add --no-cache libstdc++ libgcc, while non-root users are told to run apk add libstdc++ libgcc. Dependency failures use step deps.${TMPDIR:-${TMP:-${TEMP:-/tmp}}}/sentry-install-$$${suffix} and initially installs an EXIT trap that removes it on failure.https://ghcr.io/token?scope=repository:getsentry/cli:pull; 2. fetch the OCI manifest at https://ghcr.io/v2/getsentry/cli/manifests/nightly with bearer authorization and Accept: application/vnd.oci.image.manifest.v1+json; 3. extract the version annotation with awk; 4. locate the digest for sentry-${os}-${arch}${libc_suffix}${suffix}.gz; 5. obtain the blob redirect URL from https://ghcr.io/v2/getsentry/cli/blobs/${digest}; 6. download the redirected .gz without authorization and pipe it through gunzip into the temporary binary.jq, parsing JSON with awk; layer selection tracks the last-seen digest and emits it when org.opencontainers.image.title matches the target filename, avoiding GNU/BSD differences in multiline sed.curl -L: forwarding the GHCR Authorization header to the Azure Blob Storage redirect target returns HTTP 404, so the script extracts %{redirect_url} and follows it without the auth header.Failed to get GHCR token / ghcr-token; empty manifest β Failed to fetch nightly manifest from GHCR / ghcr-manifest; absent version β Failed to extract version from nightly manifest / ghcr-version; absent platform layer β No nightly build found for ${gz_filename} / ghcr-digest; absent redirect β Failed to get blob redirect URL from GHCR / ghcr-redirect.https://api.github.com/repos/getsentry/cli/releases/latest, strips a leading v, and downloads https://github.com/getsentry/cli/releases/download/${version}/sentry-${os}-${arch}${libc_suffix}${suffix}.${url}.gz through gunzip; the comment describes this as approximately 60% smaller (~37 MB versus ~99 MB). If the compressed asset is unavailable or decompression fails, it falls back to the raw binary using curl -fsSL --progress-bar "$url" -o "$tmp_binary".chmod +x "$tmp_binary" and delegates installation/configuration to "$tmp_binary" cli setup; setup handles directory selection, binary placement, PATH, completions, agent skills, and the welcome message.nightly only when requested_version == "nightly" and otherwise as stable; base arguments are --install --method curl --channel $channel, followed conditionally by --no-modify-path, --no-completions, and --no-agent-skills.cli setup, the installer removes its EXIT trap because setup handles successful temporary-file cleanup.SENTRY_INIT=1, the installer searches for an executable sentry in order: 1. ${SENTRY_INSTALL_DIR:-}; 2. $HOME/.local/bin; 3. $HOME/bin; 4. $HOME/.sentry/bin. It fails with step init if none is found or /dev/tty is unavailable, otherwise executes "$sentry_bin" init </dev/tty so a piped curl | bash installation can prompt interactively.