|
8 | 8 | </a> |
9 | 9 | </p> |
10 | 10 |
|
11 | | -# Official Sentry Command Line Interface |
| 11 | +# Sentry CLI |
12 | 12 |
|
13 | | -[](https://github.com/getsentry/sentry-cli/actions?query=workflow%3ACI) |
14 | | -[](https://github.com/getsentry/sentry-cli/releases/latest) |
15 | | -[](https://www.npmjs.com/package/@sentry/cli) |
16 | | -[](https://github.com/getsentry/sentry-cli/blob/master/LICENSE) |
| 13 | +This is the repository for Sentry CLI, the official command line interface for Sentry. |
17 | 14 |
|
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. |
| 15 | +Sentry CLI can be used for many tasks, including uploading debug symbols and source maps to Sentry, managing releases, and viewing Sentry data such as issues and logs. |
21 | 16 |
|
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/) |
| 17 | +## Installation and Usage |
25 | 18 |
|
26 | | -## Installation |
27 | | - |
28 | | -If you are on macOS 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.33.1 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 | | -If you are using `sentry-cli` on Windows environments, [Microsoft Visual C++ Redistributable](https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist) is required. |
40 | | - |
41 | | -To verify it’s installed correctly you can bring up the help: |
42 | | - |
43 | | - sentry-cli --help |
44 | | - |
45 | | -### pip |
46 | | - |
47 | | -_New in 2.14.3_: `sentry-cli` can also be installed using `pip`: |
48 | | - |
49 | | -```bash |
50 | | -pip install sentry-cli |
51 | | -``` |
52 | | - |
53 | | -### Node |
54 | | - |
55 | | -Additionally, you can also install this binary via npm: |
56 | | - |
57 | | - npm install @sentry/cli |
58 | | - |
59 | | -When installing globally, make sure to have set |
60 | | -[correct permissions on the global node_modules directory](https://docs.npmjs.com/getting-started/fixing-npm-permissions). |
61 | | -If this is not possible in your environment or still produces an EACCESS error, |
62 | | -install as root: |
63 | | - |
64 | | - sudo npm install -g @sentry/cli --unsafe-perm |
65 | | - |
66 | | -By default, this package will download sentry-cli from the CDN managed by [Fastly](https://www.fastly.com/). |
67 | | -To use a custom CDN, set the npm config property `sentrycli_cdnurl`. The downloader will append |
68 | | -`"/<version>/sentry-cli-<dist>"`. |
69 | | - |
70 | | -```sh |
71 | | -npm install @sentry/cli --sentrycli_cdnurl=https://mymirror.local/path |
72 | | -``` |
73 | | - |
74 | | -Or add property into your `.npmrc` file (https://www.npmjs.org/doc/files/npmrc.html) |
75 | | - |
76 | | -```rc |
77 | | -sentrycli_cdnurl=https://mymirror.local/path |
78 | | -``` |
79 | | - |
80 | | -There are a few environment variables that you can provide to control the npm installation: |
81 | | - |
82 | | -``` |
83 | | -SENTRYCLI_CDNURL=<url> # Use alternative cdn url for downloading binary |
84 | | -SENTRYCLI_USE_LOCAL=1 # Use local instance of sentry-cli binary (looked up via $PATH environment) |
85 | | -SENTRYCLI_SKIP_DOWNLOAD=1 # Skip downloading binary entirely |
86 | | -SENTRYCLI_NO_PROGRESS_BAR=1 # Do not print the progress bar when downloading binary (default for non-TTY environments like CI) |
87 | | -SENTRYCLI_LOG_STREAM=<stdout|stderr> # Changes where to redirect install script output |
88 | | -``` |
89 | | - |
90 | | -When using `sentry-cli` via JavaScript API or any 3rd party plugin that is consuming said API, |
91 | | -you can also use `SENTRY_BINARY_PATH=<path>` alongside `SENTRYCLI_SKIP_DOWNLOAD=1` to completely |
92 | | -control what binaries are downloaded and used throughout the whole process. |
93 | | - |
94 | | -If you're installing the CLI with NPM from behind a proxy, the install script will |
95 | | -use either NPM's configured HTTPS proxy server or the value from your `HTTPS_PROXY` |
96 | | -environment variable. |
97 | | - |
98 | | -### Homebrew |
99 | | - |
100 | | -A homebrew recipe is provided in the `getsentry/tools` tap: |
101 | | - |
102 | | - brew install getsentry/tools/sentry-cli |
103 | | - |
104 | | -### Docker |
105 | | - |
106 | | -As of version _1.25.0_, there is an official Docker image that comes with |
107 | | -`sentry-cli` preinstalled. If you prefer a specific version, specify it as tag. |
108 | | -The latest development version is published under the `edge` tag. In production, |
109 | | -we recommend you to use the `latest` tag. To use it, run: |
110 | | - |
111 | | -```sh |
112 | | -docker pull getsentry/sentry-cli |
113 | | -docker run --rm -v $(pwd):/work getsentry/sentry-cli --help |
114 | | -``` |
115 | | - |
116 | | -Starting version _`2.8.0`_, in case you see `"error: config value 'safe.directory' was not found;"` message, |
117 | | -you also need to correctly set UID and GID of mounted volumes like so: |
118 | | - |
119 | | -```sh |
120 | | -docker run --rm -u "$(id -u):$(id -g)" -v $(pwd):/work getsentry/sentry-cli --help |
121 | | -``` |
122 | | - |
123 | | -This is required due to security issue in older `git` implementations. See [here](https://github.blog/2022-04-12-git-security-vulnerability-announced/) for more details. |
124 | | - |
125 | | -## Update |
126 | | - |
127 | | -To update sentry-cli to the latest version run: |
128 | | - |
129 | | -```sh |
130 | | -sentry-cli update |
131 | | -``` |
| 19 | +Please refer to [Sentry CLI's documentation page](https://docs.sentry.io/cli/). |
132 | 20 |
|
133 | 21 | ## Compiling |
134 | 22 |
|
|
0 commit comments