---
title: "Sentry CLI"
description: "A natural-language CLI for developers and AI agents. Investigate issues, use Seer's Autofix, and manage Sentry projects from your terminal."
url: https://docs.sentry.io/ai/sentry-cli/
---

# Sentry CLI

The [Sentry CLI](https://cli.sentry.dev) is a command-line tool built for developers and AI agents. It auto-detects your project from `.env` files and the local codebase, so you don't need config files or flags. Type natural commands, investigate issues, use [Seer's Autofix](https://docs.sentry.io/product/ai-in-sentry/seer/autofix.md), and manage your Sentry projects directly from the terminal.

For full documentation, visit [cli.sentry.dev](https://cli.sentry.dev).

## [Installation](https://docs.sentry.io/ai/sentry-cli.md#installation)

Install the CLI using the install script:

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

Or install globally with a package manager:

```bash
npm install -g sentry
```

You can also run it directly without installing:

```bash
npx sentry --help
```

## [Authentication](https://docs.sentry.io/ai/sentry-cli.md#authentication)

Authenticate using the OAuth device flow:

```bash
sentry auth login
```

You'll receive a URL and code to enter in your browser. Once authorized, the CLI stores your credentials automatically.

You can also authenticate with an API token directly:

```bash
sentry auth login --token YOUR_SENTRY_API_TOKEN
```

Create API tokens in your [Sentry account settings](https://sentry.io/settings/account/api/auth-tokens/).

## [Key Commands](https://docs.sentry.io/ai/sentry-cli.md#key-commands)

The CLI auto-detects your project context, so most commands work without specifying a project or organization.

### [List Issues](https://docs.sentry.io/ai/sentry-cli.md#list-issues)

```bash
sentry issue list
```

### [Investigate an Issue](https://docs.sentry.io/ai/sentry-cli.md#investigate-an-issue)

Use Seer's Autofix to analyze an issue:

```bash
sentry issue explain <short-id>
```

### [Get a Fix Plan](https://docs.sentry.io/ai/sentry-cli.md#get-a-fix-plan)

Generate a step-by-step fix you can apply:

```bash
sentry issue plan <short-id>
```

### [Browse Projects and Organizations](https://docs.sentry.io/ai/sentry-cli.md#browse-projects-and-organizations)

```bash
sentry project list
sentry org list
```

### [Structured Output](https://docs.sentry.io/ai/sentry-cli.md#structured-output)

Every command supports JSON output for scripting and pipelines:

```bash
sentry org list --json | jq '.[0]'
```

## [Agentic Usage](https://docs.sentry.io/ai/sentry-cli.md#agentic-usage)

AI coding agents like Claude Code can use the Sentry CLI through the agent skill system. This allows agents to list issues, inspect events, and interact with Sentry from your development environment.

Add the Sentry CLI skill to your agent:

```bash
npx skills add https://cli.sentry.dev
```

The agent uses your existing CLI authentication, so run `sentry auth login` first.

For more details on agentic usage, see the [Agentic Usage guide on cli.sentry.dev](https://cli.sentry.dev/agentic-usage).

## [Next Steps](https://docs.sentry.io/ai/sentry-cli.md#next-steps)

* [Full CLI documentation](https://cli.sentry.dev/getting-started/) — installation, authentication, and configuration details
* [Commands reference](https://cli.sentry.dev/commands/) — complete list of available commands
* [Agentic usage](https://cli.sentry.dev/agentic-usage) — using the CLI with AI coding agents
* [GitHub repository](https://github.com/getsentry/cli) — source code and issue tracker
