@ahmadforhat/sentry-cli
v0.0.4
Published
Simple CLI for Sentry issue management
Readme
Sentry CLI
A simple command-line tool for managing and monitoring Sentry issues. Perfect for integrating Sentry into your workflows or AI-powered debugging assistants.
Features
- 🔐 Secure credential storage
- 📊 Fetch detailed issue information with latest events
- 🎯 Get prioritized unresolved issues sorted by frequency
Installation
Global Installation (Recommended)
npm install -g @ahmadforhat/sentry-cliFrom Source
git clone <repository-url>
cd sentry-cli
npm install
npm run build
npm install -g .Quick Start
1. Login
Save your Sentry credentials (you'll be prompted):
sentry-cli loginYou'll need:
- API Token: Generate from Sentry → Settings → Account → API → Auth Tokens
- Organization Slug: Found in your Sentry URL (e.g.,
my-orgfromhttps://sentry.io/organizations/my-org/)
2. Get Issue Details
Fetch a specific issue by ID with its latest event:
sentry-cli get-issue 123456Output includes:
- Issue metadata (title, status, counts, etc.)
- Latest event details (stack trace, context, breadcrumbs)
3. Get Recent Issues
Fetch unresolved issues that occurred in the last N hours, sorted by frequency:
sentry-cli get-last-issues --24Examples:
sentry-cli get-last-issues --1 # Last hour (quick check)
sentry-cli get-last-issues --24 # Last 24 hours (daily review)
sentry-cli get-last-issues --168 # Last weekReturns:
- Up to 50 unresolved issues
- Sorted by event frequency (most critical first)
- Includes 24h statistics
- Perfect for AI prioritization and grouping
Commands
| Command | Description |
|---------|-------------|
| sentry-cli login | Configure API credentials |
| sentry-cli get-issue <id> | Get issue details + latest event |
| sentry-cli get-last-issues --<hours> | Get recent issues by frequency |
| sentry-cli --help | Show help information |
| sentry-cli --version | Show version number |
Configuration
Credentials are securely stored in ~/.sentry-cli/config.json
To update credentials, simply run sentry-cli login again.
Use Cases
- AI Debugging: Feed issue data to Claude or other AI assistants for analysis
- Daily Standups: Quickly review top issues from the last 24 hours
- CI/CD: Automate issue monitoring in your pipelines
- Scripting: Parse JSON output for custom workflows
Development
npm run dev # Watch mode for development
npm run build # Build TypeScript to JavaScriptPublishing
npm run build
npm publishLicense
ISC
