The @sentry/cli package is a command line interface tool that allows developers to interact with Sentry, a popular error tracking and monitoring tool. It provides functionalities for managing releases, uploading source maps, and configuring Sentry projects directly from the terminal.
What are @sentry/cli's main functionalities?
Creating new releases
This command creates a new release in Sentry. A release is a version of your code that is deployed to an environment.
sentry-cli releases new <release_name>
Uploading source maps
Source maps allow Sentry to de-minify your JavaScript code, which aids in debugging. This command uploads source maps for a specific release.
Similar to the source map upload feature of @sentry/cli, bugsnag-sourcemaps is a tool for uploading source maps to Bugsnag, another error tracking service. It provides a focused functionality compared to the broader scope of @sentry/cli.
rollbar-cli is a command line tool for interacting with Rollbar, an alternative to Sentry for error monitoring and reporting. It offers functionalities similar to @sentry/cli, such as managing releases and uploading source maps, tailored for Rollbar's platform.
Official Sentry Command Line Interface
This is a Sentry command line client for some generic tasks. Right now this is
primarily used to upload debug symbols to Sentry if you are not using the
Fastlane tools.
If you are on OS X or Linux, you can use the automated downloader which will fetch the latest release version for you and install it:
curl -sL https://sentry.io/get-cli/ | bash
We do, however, encourage you to pin the specific version of the CLI, so your builds are always reproducible.
To do that, you can use the exact same method, with an additional version specifier:
This will automatically download the correct version of sentry-cli for your operating system and install it. If necessary, it will prompt for your admin password for sudo. For a different installation location or for systems without sudo (like Windows), you can export INSTALL_DIR=/custom/installation/path before running this command.
By default, this package will download sentry-cli from the CDN managed by Fastly.
To use a custom CDN, set the npm config property sentrycli_cdnurl. The downloader will append
"/<version>/sentry-cli-<dist>".
There are a few environment variables that you can provide to control the npm installation:
SENTRYCLI_CDNURL=<url> # Use alternative cdn url for downloading binary
SENTRYCLI_USE_LOCAL=1 # Use local instance of sentry-cli binary (looked up via $PATH environment)
SENTRYCLI_SKIP_DOWNLOAD=1 # Skip downloading binary entirely
SENTRYCLI_NO_PROGRESS_BAR=1 # Do not print the progress bar when downloading binary (default for non-TTY environments like CI)
SENTRYCLI_LOG_STREAM=<stdout|stderr> # Changes where to redirect install script output
When using sentry-cli via JavaScript API or any 3rd party plugin that is consuming said API,
you can also use SENTRY_BINARY_PATH=<path> alongside SENTRYCLI_SKIP_DOWNLOAD=1 to completely
control what binaries are downloaded and used throughout the whole process.
If you're installing the CLI with NPM from behind a proxy, the install script will
use either NPM's configured HTTPS proxy server or the value from your HTTPS_PROXY
environment variable.
Homebrew
A homebrew recipe is provided in the getsentry/tools tap:
brew install getsentry/tools/sentry-cli
Docker
As of version 1.25.0, there is an official Docker image that comes with
sentry-cli preinstalled. If you prefer a specific version, specify it as tag.
The latest development version is published under the edge tag. In production,
we recommend you to use the latest tag. To use it, run:
docker pull getsentry/sentry-cli
docker run --rm -v $(pwd):/work getsentry/sentry-cli --help
Starting version 2.8.0, in case you see "error: config value 'safe.directory' was not found;" message,
you also need to correctly set UID and GID of mounted volumes like so:
ref(utils): Remove allow(dead_code) from update utils (#2216)
ref(api): Remove blanket allow(dead_code) (#2215)
ref(api): Only allow dead code where needed (#2213)
<details>
<summary><h3>Changes to tests</h3></summary>
ref(test): Broaden with_header_matcher types (#2261) by @szokeasaurusrex
ref(test): Accept impl Into<Matcher> for with_matcher (#2260) by @szokeasaurusrex
ref(test): Align with_reponse_body parameter to mockito (#2259) by @szokeasaurusrex
ref(test): Make mock builder status default to 200 (#2258) by @szokeasaurusrex
ref(test): Change chunk upload options org (#2257) by @szokeasaurusrex
ref(test): Bump mockito mocking library (#2254) by @szokeasaurusrex
ref(test): Use TestManager in new chunk upload test (#2253) by @szokeasaurusrex
ref(test): Add TestManager struct for uniform test setup (#2252) by @szokeasaurusrex
ref(tests): mock_common_endpoints refactor (#2251) by @szokeasaurusrex
ref(tests): Simplify mock_common_upload_endpoints (#2250) by @szokeasaurusrex
ref(tests): Extract mock_common_upload_endpoints into module (#2249) by @szokeasaurusrex
ref(tests): Rename mocking to mock_endpoint_builder (#2248) by @szokeasaurusrex
ref: Fix typo in tests (#2243) by @szokeasaurusrex
ref(test): Rename EndpointOptions to MockEndpointBuilder (#2247) by @szokeasaurusrex
ref(test): Refactor EndpointOptions (#2246) by @szokeasaurusrex
ref(test): Privatize struct fields of EndpointOptions (#2245) by @szokeasaurusrex
ref(test): Move mock endpoint code to module (#2244) by @szokeasaurusrex
test: batch send-event tests (#2230) by @szokeasaurusrex
test: Run trycmd tests with RUST_BACKTRACE=0 (#2242) by @szokeasaurusrex
test(send-metric): Batch tests together (#2241) by @szokeasaurusrex
test(react_native): Bubble up target_os (#2240) by @szokeasaurusrex
test(projects): Batch tests together (#2239) by @szokeasaurusrex
test(monitors): Batch monitors tests (#2236)
test(monitors): Delete unneeded monitors test (#2237)
test(organizations): Batch tests together (#2238)
test(events): Batch tests together (#2235)
test(debug-files): Batch tests together (#2234)
test: batch token validation tests (#2231)
test: batch upload-proguard tests (#2233)
test: batch update tests (#2232)
test: Batch org token tests together (#2229)
test: Batch bash_hook tests together (#2226)
test: batch login tests (#2228)
test: Batch send envelope tests together (#2227)
test(debug-files): Add test for assemble endpoint call
ref(tests): Decouple test env vars from trycmd code
</details>
FAQs
A command line utility to work with Sentry. https://docs.sentry.io/hosted/learn/cli/
The npm package @sentry/cli receives a total of 4,155,695 weekly downloads. As such, @sentry/cli popularity was classified as popular.
We found that @sentry/cli demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.It has 10 open source maintainers collaborating on the project.
Package last updated on 22 Nov 2024
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.