1 | <p align="center">
|
2 | <a href="https://sentry.io/?utm_source=github&utm_medium=logo" target="_blank">
|
3 | <picture>
|
4 | <source srcset="https://sentry-brand.storage.googleapis.com/sentry-logo-white.png" media="(prefers-color-scheme: dark)" />
|
5 | <source srcset="https://sentry-brand.storage.googleapis.com/sentry-logo-black.png" media="(prefers-color-scheme: light), (prefers-color-scheme: no-preference)" />
|
6 | <img src="https://sentry-brand.storage.googleapis.com/sentry-logo-black.png" alt="Sentry" width="280">
|
7 | </picture>
|
8 | </a>
|
9 | </p>
|
10 |
|
11 | # Official Sentry Command Line Interface
|
12 |
|
13 | [![Build Status](https://github.com/getsentry/sentry-cli/workflows/CI/badge.svg?branch=master)](https://github.com/getsentry/sentry-cli/actions?query=workflow%3ACI)
|
14 | [![GitHub release](https://img.shields.io/github/release/getsentry/sentry-cli.svg)](https://github.com/getsentry/sentry-cli/releases/latest)
|
15 | [![npm version](https://img.shields.io/npm/v/@sentry/cli.svg)](https://www.npmjs.com/package/@sentry/cli)
|
16 | [![license](https://img.shields.io/github/license/getsentry/sentry-cli.svg)](https://github.com/getsentry/sentry-cli/blob/master/LICENSE)
|
17 |
|
18 | This is a Sentry command line client for some generic tasks. Right now this is
|
19 | primarily used to upload debug symbols to Sentry if you are not using the
|
20 | fastlane tools.
|
21 |
|
22 | * Downloads can be found under
|
23 | [Releases](https://github.com/getsentry/sentry-cli/releases/)
|
24 | * Documentation can be found [here](https://docs.sentry.io/hosted/learn/cli/)
|
25 |
|
26 | ## Installation
|
27 |
|
28 | 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:
|
29 |
|
30 | curl -sL https://sentry.io/get-cli/ | bash
|
31 |
|
32 | We do however, encourage you to pin the specific version of the CLI, so your builds are always reproducible.
|
33 | To do that, you can use the exact same method, with an additional version specifier:
|
34 |
|
35 | curl -sL https://sentry.io/get-cli/ | SENTRY_CLI_VERSION=2.0.4 bash
|
36 |
|
37 | 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.
|
38 |
|
39 | To verify it’s installed correctly you can bring up the help:
|
40 |
|
41 | sentry-cli --help
|
42 |
|
43 | ### Node
|
44 |
|
45 | Additionally you can also install this binary via npm:
|
46 |
|
47 | npm install @sentry/cli
|
48 |
|
49 | When installing globally, make sure to have set
|
50 | [correct permissions on the global node_modules directory](https://docs.npmjs.com/getting-started/fixing-npm-permissions).
|
51 | If this is not possible in your environment or still produces an EACCESS error,
|
52 | install as root:
|
53 |
|
54 | sudo npm install -g @sentry/cli --unsafe-perm
|
55 |
|
56 | By default, this package will download sentry-cli from the CDN managed by [Fastly](https://www.fastly.com/).
|
57 | To use a custom CDN, set the npm config property `sentrycli_cdnurl`. The downloader will append
|
58 | `"/<version>/sentry-cli-<dist>"`.
|
59 |
|
60 | ```sh
|
61 | npm install @sentry/cli --sentrycli_cdnurl=https://mymirror.local/path
|
62 | ```
|
63 |
|
64 | Or add property into your `.npmrc` file (https://www.npmjs.org/doc/files/npmrc.html)
|
65 |
|
66 | ```rc
|
67 | sentrycli_cdnurl=https://mymirror.local/path
|
68 | ```
|
69 |
|
70 | Another option is to use the environment variable `SENTRYCLI_CDNURL`.
|
71 |
|
72 | ```sh
|
73 | SENTRYCLI_CDNURL=https://mymirror.local/path npm install @sentry/cli
|
74 | ```
|
75 |
|
76 | If you're installing the CLI with NPM from behind a proxy, the install script will
|
77 | use either NPM's configured HTTPS proxy server, or the value from your `HTTPS_PROXY`
|
78 | environment variable.
|
79 |
|
80 | ### Homebrew
|
81 |
|
82 | A homebrew recipe is provided in the `getsentry/tools` tap:
|
83 |
|
84 | brew install getsentry/tools/sentry-cli
|
85 |
|
86 | ### Docker
|
87 |
|
88 | As of version _1.25.0_, there is an official Docker image that comes with
|
89 | `sentry-cli` preinstalled. If you prefer a specific version, specify it as tag.
|
90 | The latest development version is published under the `edge` tag. In production,
|
91 | we recommend you to use the `latest` tag. To use it, run:
|
92 |
|
93 | ```sh
|
94 | docker pull getsentry/sentry-cli
|
95 | docker run --rm -v $(pwd):/work getsentry/sentry-cli --help
|
96 | ```
|
97 |
|
98 | ## Compiling
|
99 |
|
100 | In case you want to compile this yourself, you need to install at minimum the
|
101 | following dependencies:
|
102 |
|
103 | * Rust stable and Cargo
|
104 | * Make, CMake and a C compiler
|
105 |
|
106 | Use cargo to compile:
|
107 |
|
108 | $ cargo build
|
109 |
|
110 | Also, there is a Dockerfile that builds an Alpine-based Docker image with
|
111 | `sentry-cli` in the PATH. To build and use it, run:
|
112 |
|
113 | ```sh
|
114 | docker build -t sentry-cli .
|
115 | docker run --rm -v $(pwd):/work sentry-cli --help
|
116 | ```
|