What is @sentry/cli?
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.
sentry-cli releases files <release_name> upload-sourcemaps /path/to/sourcemaps
Listing projects
This command lists all Sentry projects available to the user. It's useful for managing multiple projects or getting an overview of existing projects.
sentry-cli projects list
Other packages similar to @sentry/cli
bugsnag-sourcemaps
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
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.
- Binaries can be found under
Releases
- Documentation can be found here
Installation
The recommended way to install is with everybody's favorite curl to bash:
curl -sL https://sentry.io/get-cli/ | bash
Additionally you can also install this binary via npm:
npm install @sentry/cli
When installing globally, make sure to have set
correct permissions on the global node_modules directory.
If this is not possible in your environment or still produces an EACCESS error,
install as root:
sudo npm install -g @sentry/cli --unsafe-perm
Or homebrew:
brew install getsentry/tools/sentry-cli
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 -it -v $(pwd):/work getsentry/sentry-cli sentry-cli --help
Compiling
In case you want to compile this yourself, you need to install at minimum the
following dependencies:
- C and C++ 11 compiler
- Make and CMake
- OpenSSL 1.0.2j with development headers
- Curl 7.50 with development headers
- Rust 1.20 and Cargo
Use cargo to compile:
$ cargo build
In case you get OpenSSL errors you need to compile with the path to the OpenSSL
headers. For instance:
$ CFLAGS=-I/usr/local/opt/openssl/include/ cargo build
Also, there is a Dockerfile that builds an Alpine-based Docker image with
sentry-cli
in the PATH. Note that this image is not minimal yet, as we are not
able to compail against musl just yet. To build and use it, run:
docker build -t sentry-cli .
docker run --rm -it -v $(pwd):/work sentry-cli sentry-cli --help