Skip to main content

Scripting & Automation

Sentry CLI provides JSON output for all commands, making it easy to build automation scripts in any language.

JSON Output

All list and view commands support the --json flag for machine-readable output.

Basic Usage

JSON Schema

Each command returns a consistent JSON structure:

Issue List

Issue View

Project List

Shell Scripts (Bash)

Issue Monitoring Script

Monitor issues and send alerts when thresholds are exceeded:
monitor-issues.sh
Run the script:

Daily Report Generator

Generate a daily issue summary report:
daily-report.sh

Multi-Project Status Check

Check status across multiple projects:
check-all-projects.sh

Python Scripts

Issue Analyzer

Analyze issue patterns and generate insights:
analyze_issues.py
Run the script:

Automated Triage

Automatically categorize and prioritize issues:
triage_issues.py

Node.js Scripts

Issue Dashboard

Build a simple CLI dashboard:
dashboard.js
Run the script:

Slack Integration

Send issue alerts to Slack:
slack-alert.js

jq Recipes

Powerful one-liners using jq to process JSON output:

Filter by Criteria

Extract Specific Fields

Sort and Limit

Aggregate Statistics

CSV Export

Best Practices

1. Error Handling

Always check command exit codes:

2. Rate Limiting

Implement exponential backoff:

3. Caching Results

Cache API responses to reduce load:

4. Logging

Log script execution for debugging:

Next Steps

CI/CD Integration

Integrate into GitHub Actions, GitLab CI, and more

AI Agents

Use with AI coding assistants like Cursor and Claude