Sentry
Installs sentry-cli (the command line client for Sentry) and configures shell aliases and per-shell account selection.
What it does
- Auto-installs and updates sentry-cli to the latest release (checksum-verified binary from the Sentry release registry on Linux, Homebrew on macOS)
- Keeps Sentry account selection per-shell (
SENTRY_PROPERTIES) so terminals never collide, see Per-shell isolation - Installs bash completion generated by
sentry-cli completions, plus tab completion for the account functions - Shell aliases for day-to-day queries: projects, issues, releases
Variables
| Variable | Default | Description |
|---|---|---|
sentry_cli_version | latest | Pin sentry-cli to an exact version, or track the newest release |
sentry_aliases | See defaults | Shell aliases to generate |
sentry_functions | See defaults | Shell functions to generate |
sentry_completions | See defaults | Completion wiring for the functions |
sentry_cli_version: "3.6.2" # latestAliases
| Alias | Command | Description |
|---|---|---|
sentry | sentry-account | Show / switch the Sentry account |
sentry-info | sentry-cli info | Show the server, auth status, and default org/project |
sentry-projects | sentry-cli projects list | List the projects in the default org |
sentry-issues | sentry-cli issues list | List issues in the default project |
sentry-releases | sentry-cli releases list | List releases in the default project |
Functions
| Function | Description |
|---|---|
sentry-authenticate | Select an account, create a token in the browser, paste it |
sentry-account | Show the current account, or switch to a named one |
Authentication
The role installs the binary but leaves you signed out, so nothing writes credentials during an apply. sentry-authenticate <name> selects the account, prints the token page for its instance, and stores the pasted token in the account's own properties file; pass a URL the first time for a self-hosted instance:
sentry-authenticate personal # sentry.io
sentry-authenticate work https://sentry.example.com # self-hostedSentry tokens are created in the web UI (there is no device flow), which is why the helper prompts for a paste instead of wrapping sentry-cli login; login can only write the shared ~/.sentryclirc, which would defeat the account isolation below.
Set a default organization and project in the account's properties file (~/.config/sentry/accounts/<name>.properties) and the aliases work without flags:
defaults.org=example
defaults.project=example-appFor scripted use (CI, agents) skip the accounts entirely and set SENTRY_AUTH_TOKEN; SENTRY_ORG and SENTRY_PROJECT override the file defaults per shell, and SENTRY_URL points sentry-cli at a self-hosted instance. Environment variables always win over the selected account's file.
Per-shell isolation
sentry-cli reads one global ~/.sentryclirc, so a single shared config can hold only one token: a sentry.io account and a self-hosted instance cannot stay signed in side by side. sentry-account <name> exports SENTRY_PROPERTIES=~/.config/sentry/accounts/<name>.properties instead, scoping the selection to the current shell: picking an account in one terminal cannot change which instance another terminal talks to. Run it with no argument to show the current account and list the ones you have. Only existing accounts can be selected; an unknown name (say, a stray sentry auth) errors and points at sentry-authenticate. The starship prompt shows the selected account (custom.sentry). This is the per-shell context isolation concept the github and gitlab roles apply, brought to Sentry.