sincecutoff.com
← all changes

sentry-cli code-mappings upload bulk uploads repository code mappings

Introduced 2026-03-25 · score 0.93

HOW TO USE IT

When configuring repository code mappings, create a nonempty JSON array of mappings with nonempty `stackRoot` and `sourceRoot` values, then run `sentry-cli code-mappings upload <PATH>` for the target organization. Repository and default branch can be inferred from local Git; set `--repo` and `--default-branch` explicitly when needed.

sentry-cli code-mappings upload <PATH> --org <ORG>
sentry-cli code-mappings upload <PATH> --org <ORG> --repo <OWNER/REPO> --default-branch <BRANCH>
[{"stackRoot":"com/example/module","sourceRoot":"src/main/java/com/example/module"}]

WHY THIS HELPS

Configure Sentry code mappings for a repository so error stack traces can show source context and link to code.

REQUIREMENTS AND LIMITATIONS

  • Version: 3.3.4
  • PATH (required): Path to a JSON file containing a nonempty array of code mappings; each mapping requires nonempty `stackRoot` and `sourceRoot`.
  • --org (required): Organization ID or slug.
  • --repo: Repository name, e.g. `owner/repo`; defaults to the Git remote.
  • --default-branch: Default branch name; shown with default `main`.
  • stackRoot (required): Stack trace path root to map; must not be empty.
  • sourceRoot (required): Corresponding source path in the repository; must not be empty.
  • Prerequisite: Use an authenticated Sentry CLI invocation; the command accepts `--auth-token <AUTH_TOKEN>`.
  • Prerequisite: When repo and branch are inferred, the CLI uses the configured VCS remote first, then best-effort remote detection: upstream, origin, then first remote.
  • Mappings link stack trace paths to source paths in the repository.
  • Large mapping files are automatically split into batches for upload.

FIRST-PARTY EVIDENCE

Check the installed version and the source before using it. Entry JSON

Report a problem with this card