@@ -83,15 +83,18 @@ Usage: install [options]
8383Options:
8484 -h, --help Display this help message
8585 -v, --version <version> Install a specific version (e.g., 0.2.0) or "nightly"
86+ --init Run \` sentry init\` after installing
8687 --no-modify-path Don't modify shell config files (.zshrc, .bashrc, etc.)
8788 --no-completions Don't install shell completions
8889
8990Environment Variables:
9091 SENTRY_INSTALL_DIR Override the installation directory
9192 SENTRY_VERSION Install a specific version (e.g., 0.19.0, nightly)
93+ SENTRY_INIT Same as --init
9294
9395Examples:
9496 curl -fsSL https://cli.sentry.dev/install | bash
97+ curl -fsSL https://cli.sentry.dev/install | bash -s -- --init
9598 curl -fsSL https://cli.sentry.dev/install | bash -s -- --version nightly
9699 curl -fsSL https://cli.sentry.dev/install | bash -s -- --version 0.19.0
97100 SENTRY_VERSION=nightly curl -fsSL https://cli.sentry.dev/install | bash
102105requested_version=" ${SENTRY_VERSION:- } "
103106no_modify_path=false
104107no_completions=false
108+ run_init=" ${SENTRY_INIT:- false} "
105109while [[ $# -gt 0 ]]; do
106110 case " $1 " in
107111 -h|--help) usage; exit 0 ;;
@@ -113,6 +117,10 @@ while [[ $# -gt 0 ]]; do
113117 die " Error: --version requires a version argument" " args"
114118 fi
115119 ;;
120+ --init)
121+ run_init=true
122+ shift
123+ ;;
116124 --no-modify-path)
117125 no_modify_path=true
118126 shift
@@ -276,3 +284,21 @@ trap - EXIT
276284
277285# shellcheck disable=SC2086
278286" $tmp_binary " cli setup $setup_args
287+
288+ # Optionally launch the setup wizard after install.
289+ # Resolve the installed binary path using the same logic as the TS code:
290+ # SENTRY_INSTALL_DIR > ~/.local/bin > ~/bin > ~/.sentry/bin
291+ # </dev/tty reopens stdin from the terminal since `curl | bash` consumes it.
292+ if [[ " $run_init " == " true" || " $run_init " == " 1" ]]; then
293+ sentry_bin=" "
294+ for dir in " ${SENTRY_INSTALL_DIR:- } " " $HOME /.local/bin" " $HOME /bin" " $HOME /.sentry/bin" ; do
295+ if [[ -x " ${dir} /sentry" ]]; then
296+ sentry_bin=" ${dir} /sentry"
297+ break
298+ fi
299+ done
300+ if [[ -z " $sentry_bin " ]]; then
301+ die " Cannot find installed sentry binary" " init"
302+ fi
303+ " $sentry_bin " init < /dev/tty
304+ fi
0 commit comments