Repository navigation
feat(cli): Install Sentry CLI v4 from sentry.io/get-cli - #132672
Draft
sentry-junior[bot] wants to merge 4 commits into
Draft
sentry-junior[bot] wants to merge 4 commits into
sentry-junior[bot] wants to merge 4 commits into
Conversation
get-cli/ now serves a POSIX sh shim that runs the v4 installer from cli.sentry.dev/install. It maps the v3 variables (SENTRY_CLI_VERSION, INSTALL_DIR, INSTALL_PATH) to the v4 ones, and a SENTRY_CLI_VERSION below 4 still installs the legacy sentry-cli binary. get-cli/<platform>/<arch>/ redirects to the v4 build from the release registry (app:sentry), and to sentry-cli 3.8.2 for platforms v4 has no build for. Refs getsentry/toolkit#1965 Co-Authored-By: BYK <126780+BYK@users.noreply.github.com>
With no install variables set, the get-cli shim installs v4 to /usr/local/bin, as v3's get-cli did, when that directory is writable or the script runs as root. Otherwise the v4 installer's default applies. Refs getsentry/toolkit#1965 Co-Authored-By: BYK <126780+BYK@users.noreply.github.com>
SENTRY_CLI_VERSION=3 (or 2, v3) fell through to the v4 installer as SENTRY_VERSION=3. Match bare majors below 4 too, so they install the legacy sentry-cli, which the release registry resolves (apps/sentry-cli/3 is 3.8.2). Refs getsentry/toolkit#1965 Co-Authored-By: BYK <126780+BYK@users.noreply.github.com>
The legacy get-cli path only installed Oh My Zsh completions for 2.22+ when the major was exactly 2, so pinned 3.x installs skipped them. The completions command exists from 2.22 on, 3.x included. Refs getsentry/toolkit#1965
This was referenced Nov 26, 2026
Merged
BYK
added a commit
to getsentry/sentry-wizard
that referenced
this pull request
Nov 27, 2026
* fix(apple): support the v4 sentry CLI in iOS and snapshots flows When sentry.io/get-cli/ starts installing the Sentry CLI v4 (`sentry`) instead of `sentry-cli` (getsentry/sentry#132672), the iOS and Apple Snapshots flows break: the wizard installs the CLI but only looks for `sentry-cli`, the Xcode build phase skips dSYM uploads, and the snapshots preflight checks and prints `sentry-cli` commands. Detect either CLI, preferring v4 `sentry` and falling back to `sentry-cli`. `sentry debug-files --help` must succeed, which skips unrelated `sentry` binaries. Detection also checks `~/.local/bin`, where the v4 installer puts `sentry` when `/usr/local/bin` is not writable. After the installer runs, the wizard detects the CLI again instead of assuming success. The generated Xcode build phase now runs `sentry debug-files upload` when v4 is installed, falls back to `sentry-cli debug-files upload`, and otherwise warns with the v4 install instructions. It adds `~/.local/bin` to PATH and is POSIX sh. Re-runs still find existing phases, including ones that only call `sentry debug-files upload`. The snapshots preflight checks `snapshots upload --help` with the detected CLI and prints the matching command. Co-Authored-By: BYK <126780+BYK@users.noreply.github.com> * docs(changelog): add entry for the v4 sentry CLI support in Apple flows Co-Authored-By: BYK <126780+BYK@users.noreply.github.com> * fix(apple): give v4 sentry its org and project without flags The Sentry CLI v4 takes the org and project from `.sentryclirc` `[defaults]` or from SENTRY_ORG and SENTRY_PROJECT, so the commands the wizard writes for v4 do not pass `--org` or `--project`. The iOS wizard now writes `[defaults] org` and `project` to the `.sentryclirc` it already creates, next to the auth token. Xcode runs the build phase in the project directory, and both CLIs walk up from there to that file. The build phase still exports SENTRY_ORG and SENTRY_PROJECT, which CI needs because `.sentryclirc` is gitignored. The snapshots instructions for v4 set SENTRY_ORG and SENTRY_PROJECT instead of passing flags. The `sentry-cli` instructions are unchanged. The CI hints now name SENTRY_AUTH_TOKEN, SENTRY_ORG, SENTRY_PROJECT, and SENTRY_URL for self-hosted Sentry. Co-Authored-By: BYK <126780+BYK@users.noreply.github.com> * fix(apple): use the detected sentry path in the build phase and snapshot guidance The wizard accepts ~/.local/bin/sentry when sentry on PATH is missing or is an unrelated binary, but two places still ran bare `sentry`: - The Xcode build phase only appended ~/.local/bin to PATH, so an unrelated `sentry` earlier on PATH still won and dSYM uploads were skipped. The phase now checks `sentry` and then `$HOME/.local/bin/sentry` with `debug-files --help`, and uploads with whichever passed. Existing-phase detection also matches the new "$SENTRY_BIN" debug-files upload line. - The snapshots upload guidance printed `sentry snapshots upload`, which fails with "command not found" right after an install into ~/.local/bin. It now prints the detected command, shell-quoted. --------- Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com> Co-authored-by: BYK <126780+BYK@users.noreply.github.com>
github-actions Bot
pushed a commit
to Fields-Education/sentry-mcp
that referenced
this pull request
Nov 28, 2026
…getsentry#2544) Part of getsentry#2511. Stacked on getsentry#2520. This ports the `ios`, `appleSnapshots` and `reactNative` flows of `@sentry/wizard` 9.1.0 (`src/apple/`, `src/apple/snapshots/`, `src/react-native/`) and their tests to `packages/cli/src/lib/wizard/` and `packages/cli/test/lib/wizard/`. All three are registered in `WIZARD_RUNNERS` and run as `sentry wizard [<org>/<project>] ios|appleSnapshots|reactNative`. They add no flags. The upstream Apple flags (`--app-target`, `--hosted-test-target`, `--non-interactive`, `--xcode-project-dir`) are not carried over. The wizards look for the Xcode project in the current directory and prompt for the project, app target and hosted XCTest target. When stdin is not a terminal (`isatty(0)`, the same check as auto-login), Apple Snapshots picks the only target or fails with the choices instead of prompting. **No `sentry-cli` binary.** After v4, sentry.io/get-cli installs `sentry` (getsentry/sentry#132672), so these flows use only v4 commands: - The Xcode build phase follows getsentry/sentry-wizard#1403: - It exports PATH (installer and Homebrew dirs), SENTRY_ORG and SENTRY_PROJECT. - It checks for a v4 `sentry` with `sentry debug-files --help`, then runs `sentry debug-files upload [--include-sources] "$DWARF_DSYM_FOLDER_PATH"`. - Without an installed `sentry`, it runs `npx --yes sentry debug-files upload`. Failures show up as Xcode warnings, and it warns with the v4 install command only when neither `sentry` nor `npx` is found. There is no `sentry-cli` fallback. - `installSentryCLI`/`hasSentryCLI` are not ported. `check-installed-cli.ts` only checks that `sentry` is on the PATH that Xcode build phases see. If it isn't but `npx` is, the wizard notes that builds will use `npx sentry`. If neither is, it prints the Homebrew, curl (`cli.sentry.dev/install`) and npm install commands. - `.sentryclirc` stays, because v4 reads it. It now gets `[defaults] org/project` next to `[auth] token`. The CI hint names SENTRY_AUTH_TOKEN, SENTRY_ORG, SENTRY_PROJECT and SENTRY_URL. - The Apple Snapshots preflight and hint use `sentry snapshots upload … --app-id`. v4 has no `--org`/`--project` flags there, so the hint uses env vars. - Detection of existing upload scripts (Apple `xcode-manager`, React Native `xcode.ts`) recognizes both the v2 and the v4 command forms. - The React Native issues link uses `buildProjectIssuesUrl`, so it points at the host you're logged in to. **Dependencies.** - xml-js is gone. `apple/snapshots/xml-scan.ts` is a small scanner, with tests, for the two shapes the Snapshots flow reads: scheme `TestAction` `BlueprintName`s and `xcschememanagement.plist` keys. - `xcode` stays as a devDependency, with local typings in `src/lib/wizard/xcode.d.ts`. It goes away with the post-v4 `init`/`wizard` unification (getsentry#2510). - recast and magicast also stay. **Overlap with sibling ports.** These shared helpers are ported at upstream's paths, since other flows may port them too: - `utils/files.ts` and `utils/find-files-with-extension.ts`. Upstream has two `findFilesWithExtension`s, and both are kept as they are. - `utils/abort-if-sportlight-not-supported.ts`. - `utils/bash.ts`, with only `execute`, which `pod install` needs. React Native needs nothing from `src/android/` or `src/sourcemaps/`. **Fixtures.** The Xcode project fixtures are in `test/fixtures/wizard/apple/`. **Not ported, or different from sentry-wizard.** - No CLI flags for the project dir or the targets; the wizard prompts for them instead. - No `sentry-cli` fallback in the build phase. getsentry#1403 keeps one. - The fastlane `sentry_debug_files_upload` / `sentry_upload_snapshots` actions are left as they are. They come from fastlane-plugin-sentry, which still runs sentry-cli. - React Native still writes `sentry.properties` and uses the SDK's bundled `@sentry/cli` scripts for Xcode and Gradle uploads. Those scripts belong to the SDK. - Spotlight (`SENTRY_SPOTLIGHT`) is still not supported for iOS or React Native, same as upstream. **Resolved in review:** v4 already prefers a stored `sentry auth login` over the `.sentryclirc` token; the build phase falls back to `npx sentry`; fastlane and RN SDK v4 follow-ups get their own issues; the fixtures stay in `test/fixtures/wizard/apple/`. <!-- junior-request-attribution:start --> via @BYK. <!-- junior-request-attribution:end --> <!-- junior-session-footer:start --> <!-- junior-conversation-id:agent%3A875cd8525be461c20f1b8e42904f69e6 --> -- [View Session](https://junior-prod.sentry.dev/conversations/agent%3A875cd8525be461c20f1b8e42904f69e6) [[Sentry]](https://sentry.sentry.io/explore/conversations/agent%3A875cd8525be461c20f1b8e42904f69e6/?project=4510944073809921) <!-- junior-session-footer:end --> --------- Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com> Co-authored-by: BYK <126780+BYK@users.noreply.github.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Important
Merge at the Sentry CLI v4 launch. Do not merge before. Tracker: getsentry/toolkit#1965
Sentry CLI v4 (
sentry, from getsentry/toolkit) replaces getsentry/sentry-cli 3.x. This switchessentry.io/get-cli/to v4.get-cli/get-cli/still serves a script. It does not redirect to https://cli.sentry.dev/install, for two reasons:sh. The v4 installer is bash, and dash (/bin/shon Debian and Ubuntu) can't run it.src/utils/bash.tsfetches it withhttps.getand runs the body withbash, so a 302 would give it an empty script. Port sentry-wizard into the CLI assentry wizardtoolkit#2511 replaces that code path.The script is now a POSIX
shshim. It downloads the v4 installer to a temp file and runs it withbash. It maps the variables people pass today:SENTRY_CLI_VERSIONunset orlatestSENTRY_CLI_VERSION=4.x,v4.x, ornightlySENTRY_VERSIONSENTRY_CLI_VERSIONbelow 4, such as2.42.1,3, orv3sentry-clibinary, as before, so pinned CI installs keep workingINSTALL_DIRSENTRY_INSTALL_DIR, unless that is already setINSTALL_PATHSENTRY_INSTALL_DIR. v4 always names the binarysentry.SENTRY_INSTALL_DIR=/usr/local/bin, v3's default, when that directory is writable or the script runs as root. Otherwise the v4 installer's default applies (~/.local/binwith a shell rc update, and$GITHUB_PATHin GitHub Actions).After a v4 install, the shim prints a line saying
sentry-cliis nowsentry, with a link to the migration guide. Without bash, it fails and suggestsnpm install -g sentry. The legacy branch is the old script, cleaned up so it passes ShellCheck. It also fixes thearmv64case, which used to matcharmv6*first.get-cli/<platform>/<arch>/release-registry.../apps/sentry/latest?response=download&platform=<p>&arch=<a>&package=sentry. The v4 builds are darwin x64/arm64, linux x64/arm64, and windows x64. v3 names (Linux/x86_64,aarch64) and v4 names (linux/x64) both work.Darwin/universal,Linux/i686,Linux/armv7,Windows/aarch64) gets sentry-cli 3.8.2, the last v3 release. It is pinned becauseapp:sentry-clilatestis moving to v4.Decided
sentry-clialias. The shim installs onlysentry. Scripts that callsentry-clican use the shim in the migration guide, pinSENTRY_CLI_VERSION=3.8.2, or switch tosentry.via @BYK.
--
View Session [Sentry]