sentry
Sentry CLI - A command-line interface for using Sentry built by robots and humans for robots and humans
Last updated 8 days ago by sentry-bot .
FSL-1.1-Apache-2.0 · Repository · Bugs · Original npm · Tarball · package.json
$ npm install sentry 
SYNC missed versions from official npm registry.

Sentry CLI

The command-line interface for Sentry. Built for developers and AI agents.

Documentation | Getting Started | Commands


Installation

Install Script (Recommended)

curl https://cli.sentry.dev/install -fsS | bash

Windows (PowerShell)

irm https://cli.sentry.dev/install.ps1 | iex

Homebrew

brew install getsentry/tools/sentry

Package Managers

npm install -g sentry
pnpm add -g sentry
yarn global add sentry
bun add -g sentry

The npm/pnpm/yarn packages require Node.js 20+. On Node.js 22.15+ the CLI uses the built-in node:sqlite; on Node.js 20–22.14 it transparently falls back to a bundled WASM SQLite driver.

Homebrew and package manager installs don't add agent skills (package managers also skip shell completions). Run sentry cli setup once afterwards; see the installation guide.

Run Without Installing

npx sentry@latest
pnpm dlx sentry --help
yarn dlx sentry --help
bunx sentry --help

Quick Start

# Authenticate with Sentry
sentry auth

# 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

Features

  • DSN Auto-Detection - Automatically detects your project from .env files 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 --json for scripting and pipelines.
  • Open in Browser - Use -w flag to open any resource in your browser.

Commands

Run sentry --help to see all available commands, or browse the command reference.

Configuration

Credentials are stored in $XDG_CONFIG_HOME/sentry/ (defaulting to ~/.config/sentry/) with restricted permissions (mode 600). A pre-existing legacy ~/.sentry/ directory is still honored, and the location can be overridden with SENTRY_CONFIG_DIR.

Library Usage

Use Sentry CLI programmatically in Node.js (≥20.0) 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({}, "ACME-123");

// Nested commands
await sdk.dashboard.widget.add(
  { display: "line", query: ["count"] },
  "acme/", "my-dashboard", "Errors over time"
);

// Escape hatch for any CLI command
const version = await sdk.run("--version");
const text = await sdk.run("issue", "list", "-n", "5");

Options (all optional):

  • token — Auth token. Falls back to the stored login from sentry auth login, then SENTRY_AUTH_TOKEN / SENTRY_TOKEN env 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 (affects run() only).
  • cwd — Working directory for DSN auto-detection. Defaults to process.cwd().
  • headers — Extra HTTP headers for self-hosted instances behind a reverse proxy (same as SENTRY_CUSTOM_HEADERS). Ignored for sentry.io.
  • signal — AbortSignal to cancel streaming commands (--follow, --refresh).

Streaming commands return AsyncIterable — use for await...of and break to stop.

Errors are thrown as SentryError with .exitCode and .stderr.


Development

Prerequisites

Setup

git clone https://github.com/getsentry/toolkit.git
cd toolkit
pnpm install
cd packages/cli

Running Locally

# Run CLI in development mode (generates missing build-time files on first run)
pnpm run cli --help

# Loads packages/cli/.env.local automatically when present (see DEVELOPMENT.md)
pnpm run cli auth status

Scripts

pnpm run build         # Build for current platform
pnpm run typecheck     # Type checking
pnpm run lint          # Check for issues
pnpm run lint:fix      # Auto-fix issues
pnpm run test:unit     # Run unit tests
pnpm run test:e2e      # Run end-to-end tests
pnpm run generate:docs # Regenerate command docs and skills

See DEVELOPMENT.md for detailed setup and CONTRIBUTING.md for contribution guidelines.

License

FSL-1.1-Apache-2.0

Current Tags

  • 0.50.0                                ...           latest (8 days ago)

71 Versions

  • 0.50.0                                ...           8 days ago
  • 0.49.0                                ...           20 days ago
  • 0.48.0                                ...           21 days ago
  • 0.47.0                                ...           2 months ago
  • 0.46.0                                ...           2 months ago
  • 0.45.0                                ...           3 months ago
  • 0.44.1                                ...           3 months ago
  • 0.44.0                                ...           3 months ago
  • 0.43.0                                ...           3 months ago
  • 0.42.2                                ...           4 months ago
  • 0.42.1                                ...           4 months ago
  • 0.42.0                                ...           4 months ago
  • 0.41.0                                ...           4 months ago
  • 0.40.0                                ...           4 months ago
  • 0.39.0                                ...           4 months ago
  • 0.38.0                                ...           5 months ago
  • 0.37.0                                ...           5 months ago
  • 0.36.0                                ...           6 months ago
  • 0.35.0                                ...           6 months ago
  • 0.34.0                                ...           6 months ago
  • 0.33.0                                ...           7 months ago
  • 0.32.0                                ...           7 months ago
  • 0.31.0                                ...           7 months ago
  • 0.30.0                                ...           7 months ago
  • 0.29.1                                ...           7 months ago
  • 0.29.0                                ...           7 months ago
  • 0.28.1                                ...           7 months ago
  • 0.28.0                                ...           7 months ago
  • 0.27.0                                ...           7 months ago
  • 0.26.1                                ...           8 months ago
  • 0.26.0                                ...           8 months ago
  • 0.25.0                                ...           8 months ago
  • 0.24.1                                ...           8 months ago
  • 0.24.0                                ...           8 months ago
  • 0.23.0                                ...           8 months ago
  • 0.22.0                                ...           8 months ago
  • 0.21.0                                ...           8 months ago
  • 0.20.0                                ...           8 months ago
  • 0.19.0                                ...           8 months ago
  • 0.18.1                                ...           8 months ago
  • 0.18.0                                ...           8 months ago
  • 0.17.0                                ...           8 months ago
  • 0.16.0                                ...           8 months ago
  • 0.15.0                                ...           9 months ago
  • 0.14.0                                ...           9 months ago
  • 0.13.0                                ...           9 months ago
  • 0.12.0                                ...           9 months ago
  • 0.11.0                                ...           9 months ago
  • 0.10.2                                ...           9 months ago
  • 0.10.1                                ...           9 months ago
  • 0.10.0                                ...           9 months ago
  • 0.9.1                                ...           10 months ago
  • 0.9.0                                ...           10 months ago
  • 0.8.0                                ...           10 months ago
  • 0.7.0                                ...           10 months ago
  • 0.6.0                                ...           10 months ago
  • 0.5.3                                ...           10 months ago
  • 0.5.2                                ...           10 months ago
  • 0.5.1                                ...           10 months ago
  • 0.5.0                                ...           10 months ago
  • 0.4.2                                ...           10 months ago
  • 0.4.1                                ...           10 months ago
  • 0.4.0                                ...           10 months ago
  • 0.3.3                                ...           10 months ago
  • 0.3.2                                ...           10 months ago
  • 0.3.1                                ...           10 months ago
  • 0.3.0                                ...           10 months ago
  • 0.2.0                                ...           10 months ago
  • 0.1.2 [deprecated]           ...           15 years ago
  • 0.1.1 [deprecated]           ...           15 years ago
  • 0.1.0 [deprecated]           ...           15 years ago
Maintainers (2)
Downloads
Total 161
Today 0
This Week 3
This Month 154
Last Day 0
Last Week 18
Last Month 7
Dependencies (0)
None
Dev Dependencies (52)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE