Fast, scriptable CLI for querying Sentry issues and events
npm install @iamjoshing/slogFast, scriptable CLI for querying Sentry issues and events. Designed for developers and AI agents.
- Query and filter Sentry issues using native search syntax
- Inspect event details including stacktraces and breadcrumbs
- Tail new events in real-time (polling-based)
- Human-readable tables or machine-friendly JSON output
- Built-in sensitive data redaction for AI safety
- Field allowlisting for controlled output
- Rate limiting and pagination handled automatically
- Bun runtime (recommended) or Node.js 18+
``bashClone the repository
git clone https://github.com/yourusername/slog.git
cd slog
Configuration
$3
Your
SENTRY_ORG is the organization slug from your Sentry URL:`
https://.sentry.io/...
^^^^^^^^^^^^^^
This is your SENTRY_ORG
`For example, if your Sentry URL is
https://acme-corp.sentry.io/issues/, your org slug is acme-corp.$3
1. Go to your Sentry auth tokens page:
`
https://.sentry.io/settings/account/api/auth-tokens/
`
2. Click Create New Token
3. Give it a name (e.g., "slog CLI")
4. Select the required scopes:
- project:read
- event:read
- org:read
5. Click Create Token and copy the token (starts with sntrys_)$3
`bash
export SENTRY_AUTH_TOKEN="sntrys_your_token_here"
export SENTRY_ORG="your-org-slug"Optional: For self-hosted Sentry
export SENTRY_BASE_URL="https://your-sentry.com/api/0"
`You can add these to your shell profile (
~/.bashrc, ~/.zshrc, etc.) or use a .env file.Usage
$3
`bash
List unresolved issues from last 24 hours (default)
slog issuesList errors from production in the last hour
slog issues --query "is:unresolved level:error" --env production --since 1hGet issues as JSON for piping
slog issues --format json --limit 10List issues for a specific project
slog issues --project my-project --since 7d
`$3
`bash
List recent events for an issue
slog events ISSUE-123Get full event details with stacktraces
slog events ISSUE-123 --expandOutput as JSON for processing
slog events ISSUE-123 --format json --expand
`$3
`bash
Watch for new unresolved errors
slog tailTail production errors with custom poll interval
slog tail --env production --interval 5Output new events as JSON (useful for piping to processors)
slog tail --format json --query "level:error"
`AI Agent Safety
$3
Use
--redact to automatically remove sensitive data:`bash
Redact emails, tokens, API keys, and other secrets
slog events ISSUE-123 --format json --redact
`Redacted patterns include:
- Email addresses
- Bearer/Basic auth tokens
- JWT tokens
- API keys (various formats)
- AWS credentials
- Sentry auth tokens
- Passwords in URLs
- Sensitive HTTP headers
$3
Use
--fields to output only specific fields:`bash
Only include specific fields in output
slog issues --format json --fields "id,title,level,lastSeen"Combine with redaction
slog events ISSUE-123 --format json --redact --fields "eventID,title,dateCreated"
`Examples
$3
`bash
slog issues --query "is:unresolved level:error" --env production --since 24h
`$3
`bash
slog events PROJ-1234 --expand --limit 5
`$3
`bash
slog tail --format json | jq '.title'
`$3
`bash
slog issues --format json --redact --limit 50 > issues.json
`$3
`bash
slog issues --format json --fields "shortId,title,count,lastSeen" | jq -r '.[] | "\(.shortId): \(.title)"'
`Command Reference
$3
List issues (error groups) from Sentry.
| Flag | Description | Default |
|------|-------------|---------|
|
-q, --query | Sentry search query | - |
| -e, --env | Filter by environment | - |
| -s, --since