tkoenig

sentry

0
0
# Install this skill:
npx skills add tkoenig/agent-skills --skill "sentry"

Install specific skill from multi-skill repository

# Description

Manage Sentry issues using sentry-cli and the Sentry API. List, resolve, mute, and unresolve issues. Get detailed issue information. Use for error tracking, issue triage, and managing application errors in Sentry.

# SKILL.md


name: sentry
description: "Manage Sentry issues using sentry-cli and the Sentry API. List, resolve, mute, and unresolve issues. Get detailed issue information. Use for error tracking, issue triage, and managing application errors in Sentry."


Sentry CLI

Manage Sentry issues via the sentry wrapper script and the REST API.

Important: Script Location

The sentry wrapper script is located in this skill's directory at scripts/sentry.

First, locate this skill directory by finding where this SKILL.md file is loaded from (check the path shown when reading this file), then use the script relative to that location.

For example, if this skill is at /path/to/skills/sentry/SKILL.md, run:

/path/to/skills/sentry/scripts/sentry <command>

Quick Reference

<skill-dir>/scripts/sentry config                              # Show current config
<skill-dir>/scripts/sentry projects                            # List available projects
<skill-dir>/scripts/sentry issues list --query "is:unresolved" # List open issues
<skill-dir>/scripts/sentry issues resolve --id <ID>            # Resolve an issue
<skill-dir>/scripts/sentry issues mute --id <ID>               # Mute an issue

Replace <skill-dir> with the actual path to this skill's directory.

Setup

The wrapper script wraps sentry-cli and finds .sentryclirc in parent directories, enabling per-org/project tokens.

Directory-Based Config

Place .sentryclirc files in parent directories for different orgs. Configs are merged from root to current directory, so you can set org-wide defaults and override per-project:

~/Development/
├── org-a/
│   ├── .sentryclirc          # org-a token + org name
│   ├── project-1/
│   │   └── .sentryclirc      # just: project=project-1
│   └── project-2/
│       └── .sentryclirc      # just: project=project-2
└── org-b/
    ├── .sentryclirc          # org-b token + org name
    └── project-3/

Parent config (e.g., ~/Development/org-a/.sentryclirc):

[auth]
token=sntryu_xxx

[defaults]
org=my-org

Project-specific override (e.g., project-1/.sentryclirc):

[defaults]
project=project-1

Verify Setup

In the examples below, sentry refers to <skill-dir>/scripts/sentry.

# Show current configuration (wrapper command)
sentry config

# Verify token works with Sentry
sentry info

# List available projects in your org
sentry projects

List Issues

# List all issues (default: up to 5 pages of 100 issues)
sentry issues list

# List only unresolved issues
sentry issues list --query "is:unresolved"

# List resolved issues
sentry issues list --query "is:resolved"

# Limit output rows
sentry issues list --query "is:unresolved" --max-rows 10

# Filter by status flag (alternative to query)
sentry issues list --status unresolved

Resolve Issues

# Resolve a specific issue by ID
sentry issues resolve --id 7055684245

# Resolve multiple issues
sentry issues resolve --id 123456 --id 789012

# Resolve all unresolved issues (use with caution)
sentry issues resolve --status unresolved

# Resolve in next release only
sentry issues resolve --id 123456 --next-release

Mute Issues

# Mute a specific issue
sentry issues mute --id 123456

# Mute all issues with a specific status
sentry issues mute --status unresolved

Unresolve Issues

# Re-open a resolved issue
sentry issues unresolve --id 123456

Search Query Syntax

The --query flag supports Sentry's search syntax:

Query Description
is:unresolved Unresolved issues
is:resolved Resolved issues
is:ignored Ignored/muted issues
level:error Error level only
level:warning Warning level only
firstSeen:-24h First seen in last 24 hours
lastSeen:-7d Last seen in last 7 days
assigned:me Assigned to you
assigned:none Unassigned

Combine filters: is:unresolved level:error lastSeen:-24h

Full syntax: https://docs.sentry.io/concepts/search/

Sentry API

The CLI doesn't support fetching detailed issue information. Use the REST API instead.

Get the auth token (walks up directory tree like the wrapper):

find_sentryclirc() {
  local dir="$PWD"
  while [[ "$dir" != "/" ]]; do
    [[ -f "$dir/.sentryclirc" ]] && echo "$dir/.sentryclirc" && return
    dir="$(dirname "$dir")"
  done
  echo ~/.sentryclirc
}
SENTRY_AUTH_TOKEN=$(grep -A1 '^\[auth\]' "$(find_sentryclirc)" | grep token | cut -d'=' -f2 | tr -d ' ')

Get Issue Details

# Get full issue details by numeric ID (not short ID like PROJECT-1Q)
curl -s -H "Authorization: Bearer $SENTRY_AUTH_TOKEN" \
  "https://sentry.io/api/0/issues/<ISSUE_ID>/" | jq

# Get specific fields
curl -s -H "Authorization: Bearer $SENTRY_AUTH_TOKEN" \
  "https://sentry.io/api/0/issues/<ISSUE_ID>/" | jq -r '{
    shortId,
    title,
    culprit,
    count,
    firstSeen,
    lastSeen,
    query: .metadata.value
  }'

API Reference

Global Options

These work with all commands:

Option Description
-o, --org <ORG> Override organization (default from config)
-p, --project <PROJECT> Override project (default from config)
--auth-token <TOKEN> Override auth token
--quiet Suppress output (for scripts)
--log-level <LEVEL> Set verbosity: trace, debug, info, warn, error

Common Workflows

After Deploying a Fix

# List unresolved issues
sentry issues list --query "is:unresolved"

# Resolve the specific issue you fixed
sentry issues resolve --id <ISSUE_ID>

Weekly Triage

# See all unresolved errors from the past week
sentry issues list --query "is:unresolved lastSeen:-7d"

# Mute noisy issues you can't fix right now
sentry issues mute --id <ISSUE_ID>

Help

sentry --help
sentry issues --help
sentry issues list --help
sentry issues resolve --help

Troubleshooting

"Invalid token" or 401 Errors

Check your configuration:

sentry config

Verify the token works:

sentry info

If this fails, your token may be expired or invalid. Generate a new one at:
https://sentry.io/settings/account/api/auth-tokens/

"Project does not exist" Errors

The project slug in your .sentryclirc may not match the actual Sentry project.

List available projects:

sentry projects

Then update your .sentryclirc with the correct project slug.

Config Not Being Found

The wrapper walks up from your current directory looking for .sentryclirc. Make sure:

  1. You're in a subdirectory of where .sentryclirc is located
  2. The file is named exactly .sentryclirc (not .sentrycli.rc etc.)
  3. The INI format is correct:
[auth]
token=sntryu_xxx

[defaults]
org=my-org
project=my-project

Debug Mode

For verbose output, add --log-level=debug:

sentry --log-level=debug issues list

# Supported AI Coding Agents

This skill is compatible with the SKILL.md standard and works with all major AI coding agents:

Learn more about the SKILL.md standard and how to use these skills with your preferred AI coding agent.