Skip to content
Merged
189 changes: 0 additions & 189 deletions docs/public/install

This file was deleted.

1 change: 1 addition & 0 deletions docs/public/install
62 changes: 57 additions & 5 deletions install
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,22 @@ Usage: install [options]
Options:
-h, --help Display this help message
-v, --version <version> Install a specific version (e.g., 0.2.0)
--no-modify-path Don't modify shell config files (.zshrc, .bashrc, etc.)
--no-completions Don't install shell completions

Environment Variables:
SENTRY_INSTALL_DIR Override the installation directory

Examples:
curl -fsSL https://cli.sentry.dev/install | bash
curl -fsSL https://cli.sentry.dev/install | bash -s -- --version 0.2.0
SENTRY_INSTALL_DIR=~/.local/bin curl -fsSL https://cli.sentry.dev/install | bash
EOF
}

requested_version=""
no_modify_path=false
no_completions=false
while [[ $# -gt 0 ]]; do
case "$1" in
-h|--help) usage; exit 0 ;;
Expand All @@ -34,6 +42,14 @@ while [[ $# -gt 0 ]]; do
exit 1
fi
;;
--no-modify-path)
no_modify_path=true
shift
;;
--no-completions)
no_completions=true
shift
;;
*) shift ;;
esac
done
Expand Down Expand Up @@ -80,22 +96,58 @@ version="${version#v}"
filename="sentry-${os}-${arch}${suffix}"
url="https://github.com/getsentry/cli/releases/download/${version}/${filename}"

# Install
install_dir="$HOME/.sentry/bin"
# Determine install directory
# Priority:
# 1. SENTRY_INSTALL_DIR environment variable (if set and writable)
# 2. ~/.local/bin (if exists AND in $PATH)
# 3. ~/bin (if exists AND in $PATH)
# 4. ~/.sentry/bin (fallback, setup command will handle PATH)
install_dir=""

if [[ -n "${SENTRY_INSTALL_DIR:-}" ]]; then
install_dir="$SENTRY_INSTALL_DIR"
if [[ ! -d "$install_dir" ]]; then
mkdir -p "$install_dir" 2>/dev/null || true
fi
if [[ ! -w "$install_dir" ]]; then
echo -e "${RED}Error: Cannot write to $install_dir${NC}"
echo -e "${MUTED}Try running with sudo or choose a different directory.${NC}"
exit 1
fi
elif [[ -d "$HOME/.local/bin" ]] && echo "$PATH" | tr ':' '\n' | grep -Fxq "$HOME/.local/bin"; then
install_dir="$HOME/.local/bin"
elif [[ -d "$HOME/bin" ]] && echo "$PATH" | tr ':' '\n' | grep -Fxq "$HOME/bin"; then
install_dir="$HOME/bin"
else
install_dir="$HOME/.sentry/bin"
fi

install_path="${install_dir}/sentry${suffix}"

# Create directory if needed
mkdir -p "$install_dir"

# Download binary
echo -e "${MUTED}Downloading sentry v${version}...${NC}"
curl -fsSL --progress-bar "$url" -o "$install_path"
chmod +x "$install_path"

# Run setup command to configure PATH, completions, and record install info
setup_args="--method curl"
if [[ "$no_modify_path" == "true" ]]; then
setup_args="$setup_args --no-modify-path"
fi
if [[ "$no_completions" == "true" ]]; then
setup_args="$setup_args --no-completions"
fi

# shellcheck disable=SC2086
"$install_path" cli setup $setup_args 2>/dev/null || true

# Success message
echo ""
echo -e "Installed ${NC}sentry v${version}${MUTED} to ${NC}${install_path}"
echo ""
echo -e "${MUTED}Add to PATH (add to ~/.zshrc or ~/.bashrc):${NC}"
echo " export PATH=\"\$HOME/.sentry/bin:\$PATH\""
echo ""
echo -e "${MUTED}Get started:${NC}"
echo " sentry --help"
echo ""
Expand Down
10 changes: 10 additions & 0 deletions plugins/sentry-cli/skills/sentry-cli/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,16 @@ Diagnose and repair CLI database issues
**Flags:**
- `--dry-run - Show what would be fixed without making changes`

#### `sentry cli setup`

Configure shell integration

**Flags:**
- `--method <value> - Installation method (curl, npm, pnpm, bun, yarn)`
- `--noModifyPath - Skip PATH modification`
- `--noCompletions - Skip shell completion installation`
- `--quiet - Suppress output (for scripted usage)`

#### `sentry cli upgrade <version>`

Update the Sentry CLI to the latest version
Expand Down
3 changes: 3 additions & 0 deletions src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ export const app = buildApplication(routes, {
versionInfo: {
currentVersion: CLI_VERSION,
},
scanner: {
caseStyle: "allow-kebab-for-camel",
},
determineExitCode: getExitCode,
localization: {
loadText: () => customText,
Expand Down
2 changes: 1 addition & 1 deletion src/commands/auth/login.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { buildCommand, numberParser } from "@stricli/core";
import type { SentryContext } from "../../context.js";
import { getCurrentUser, getUserRegions } from "../../lib/api-client.js";
import { buildCommand, numberParser } from "../../lib/command.js";
import { clearAuth, isAuthenticated, setAuthToken } from "../../lib/db/auth.js";
import { getDbPath } from "../../lib/db/index.js";
import { setUserInfo } from "../../lib/db/user.js";
Expand Down
2 changes: 1 addition & 1 deletion src/commands/auth/logout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
* Clear stored authentication credentials.
*/

import { buildCommand } from "@stricli/core";
import type { SentryContext } from "../../context.js";
import { buildCommand } from "../../lib/command.js";
import { clearAuth, isAuthenticated } from "../../lib/db/auth.js";
import { getDbPath } from "../../lib/db/index.js";
import { success } from "../../lib/formatters/colors.js";
Expand Down
2 changes: 1 addition & 1 deletion src/commands/auth/refresh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
* Manually refresh the authentication token.
*/

import { buildCommand } from "@stricli/core";
import type { SentryContext } from "../../context.js";
import { buildCommand } from "../../lib/command.js";
import { getAuthConfig, refreshToken } from "../../lib/db/auth.js";
import { AuthError } from "../../lib/errors.js";
import { success } from "../../lib/formatters/colors.js";
Expand Down
2 changes: 1 addition & 1 deletion src/commands/auth/status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
* Display authentication status and verify credentials.
*/

import { buildCommand } from "@stricli/core";
import type { SentryContext } from "../../context.js";
import { listOrganizations } from "../../lib/api-client.js";
import { buildCommand } from "../../lib/command.js";
import {
type AuthConfig,
getAuthConfig,
Expand Down
2 changes: 1 addition & 1 deletion src/commands/auth/token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
* Useful for piping to other commands or scripts.
*/

import { buildCommand } from "@stricli/core";
import type { SentryContext } from "../../context.js";
import { buildCommand } from "../../lib/command.js";
import { getAuthToken } from "../../lib/db/auth.js";
import { AuthError } from "../../lib/errors.js";

Expand Down
2 changes: 1 addition & 1 deletion src/commands/cli/feedback.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@

// biome-ignore lint/performance/noNamespaceImport: Sentry SDK recommends namespace import
import * as Sentry from "@sentry/bun";
import { buildCommand } from "@stricli/core";
import type { SentryContext } from "../../context.js";
import { buildCommand } from "../../lib/command.js";
import { ValidationError } from "../../lib/errors.js";

export const feedbackCommand = buildCommand({
Expand Down
2 changes: 1 addition & 1 deletion src/commands/cli/fix.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
* Diagnose and repair CLI database issues.
*/

import { buildCommand } from "@stricli/core";
import type { SentryContext } from "../../context.js";
import { buildCommand } from "../../lib/command.js";
import { getDbPath, getRawDatabase } from "../../lib/db/index.js";
import {
CURRENT_SCHEMA_VERSION,
Expand Down
Loading
Loading