The command-line interface for Sentry. Built for developers and AI agents.
Documentation | Getting Started | Commands
curl -fsSL https://cli.sentry.dev/install | bashbrew install getsentry/tools/sentrynpm install -g sentry
pnpm add -g sentry
bun add -g sentrynpx sentry@latest# Authenticate with Sentry
sentry auth login
# List issues (auto-detects project from your codebase)
sentry issue list
# Get AI-powered root cause analysis
sentry issue explain PROJ-ABC
# Generate a fix plan
sentry issue plan PROJ-ABC- DSN Auto-Detection - Automatically detects your project from
.envfiles or source code. No flags needed. - Seer AI Integration - Get root cause analysis and fix plans directly in your terminal.
- Monorepo Support - Works with multiple projects, generates short aliases for easy navigation.
- JSON Output - All commands support
--jsonfor scripting and pipelines. - Open in Browser - Use
-wflag to open any resource in your browser.
| Command | Description |
|---|---|
sentry auth |
Login, logout, check authentication status |
sentry org |
List and view organizations |
sentry project |
List and view projects |
sentry issue |
List, view, explain, and plan issues |
sentry event |
View event details |
sentry api |
Make direct API requests |
For detailed documentation, visit cli.sentry.dev.
Credentials are stored in ~/.sentry/ with restricted permissions (mode 600).
Use Sentry CLI programmatically in Node.js (≥22) or Bun without spawning a subprocess:
import createSentrySDK from "sentry";
const sdk = createSentrySDK({ token: "sntrys_..." });
// Typed methods for every CLI command
const orgs = await sdk.org.list();
const issues = await sdk.issue.list({ orgProject: "acme/frontend", limit: 5 });
const issue = await sdk.issue.view({ issue: "ACME-123" });
// Nested commands
await sdk.dashboard.widget.add({ display: "line", query: "count" }, "my-org/my-dashboard");
// Escape hatch for any CLI command
const version = await sdk.run("--version");
const text = await sdk.run("issue", "list", "-l", "5");Options (all optional):
token— Auth token. Falls back toSENTRY_AUTH_TOKEN/SENTRY_TOKENenv vars.url— Sentry instance URL for self-hosted (e.g.,"sentry.example.com").org— Default organization slug (avoids passing it on every call).project— Default project slug.text— Return human-readable string instead of parsed JSON (affectsrun()only).cwd— Working directory for DSN auto-detection. Defaults toprocess.cwd().
Errors are thrown as SentryError with .exitCode and .stderr.
- Bun v1.0+
git clone https://github.com/getsentry/cli.git
cd cli
bun install# Run CLI in development mode
bun run dev --help
# With environment variables
bun run --env-file=.env.local src/bin.ts --helpbun run build # Build for current platform
bun run typecheck # Type checking
bun run lint # Check for issues
bun run lint:fix # Auto-fix issues
bun test # Run testsSee DEVELOPMENT.md for detailed setup and CONTRIBUTING.md for contribution guidelines.
