A command-line interface for Rollbar for reading, listing, and managing items and occurrences. Optimized for both AI coding agents and human users.
yay -S rollbar-clibrew install robzolkos/tap/rollbar-cli# Download the .deb for your architecture (amd64 or arm64)
curl -LO https://github.com/robzolkos/rollbar-cli/releases/latest/download/rollbar-cli_VERSION_amd64.deb
sudo dpkg -i rollbar-cli_VERSION_amd64.deb# Download the .rpm for your architecture (x86_64 or aarch64)
curl -LO https://github.com/robzolkos/rollbar-cli/releases/latest/download/rollbar-cli-VERSION-1.x86_64.rpm
sudo rpm -i rollbar-cli-VERSION-1.x86_64.rpmDownload rollbar-windows-amd64.exe from GitHub Releases, rename it to rollbar.exe, and add it to your PATH.
go install github.com/robzolkos/rollbar-cli/cmd/rollbar@latestgit clone https://github.com/robzolkos/rollbar-cli.git
cd rollbar-cli
make build
./bin/rollbar --help-
Get an access token from Rollbar:
- Go to your project's Settings → Access Tokens
- For read-only access: create a token with "read" scope
- For full access (including resolve): create a token with "write" scope
-
Configure the CLI:
# Option 1: Environment variable export ROLLBAR_ACCESS_TOKEN="your-token" # Option 2: Create a config file rollbar init rollbar config set access_token your-token
-
Test your setup:
rollbar whoami
-
List recent errors:
rollbar items --since "8 hours ago" --level error,critical
# List active items
rollbar items
# Filter by status, level, environment
rollbar items --status active --level error,critical --env production
# Time-based filtering
rollbar items --since "8 hours ago"
rollbar items --since 24h
rollbar items --from "2026-01-30T09:00:00" --to "2026-01-30T17:00:00"
# Search by title
rollbar items --query "TypeError"
# Sort by occurrence count
rollbar items --sort occurrences --limit 10# Get by project counter
rollbar item 123
# Include recent occurrences
rollbar item 123 --occurrences 5Mark items as resolved (requires a token with "write" scope):
# Resolve a single item
rollbar resolve 123
# Resolve multiple items at once
rollbar resolve 123 456 789
# Resolve by internal UUID
rollbar resolve --uuid 8675309The context command generates comprehensive markdown with everything needed to fix a bug:
# Output to stdout
rollbar context 123
# Write to file
rollbar context 123 --out bug-context.md
# Copy to clipboard (macOS)
rollbar context 123 | pbcopyThe context output includes (when available):
- Exception details and stack trace
- Request URL, method, and user's browser (User-Agent)
- Logged-in user email and ID
- Server and environment information
# List occurrences for an item
rollbar occurrences --item 123
# Get single occurrence details (includes browser, user email, request info)
rollbar occurrence 453568801204| Format | Flag | Use Case |
|---|---|---|
| Table | --output table (default) |
Human-readable in terminal |
| JSON | --output json |
Scripting and piping to jq |
| Compact | --output compact |
Token-efficient for AI agents |
| Markdown | --output markdown |
Documentation and context files |
Use --ai as shorthand for --output compact --no-color.
The CLI looks for configuration in this order:
--configflag (explicit path).rollbar.yamlin current directory- Walk up directory tree looking for
.rollbar.yaml ~/.config/rollbar/config.yaml(global)- Environment variables
# .rollbar.yaml
access_token: "your-read-token"
project_id: 12345
default_environment: "production"
output:
format: "table"
color: "auto"ROLLBAR_ACCESS_TOKEN- Your read tokenROLLBAR_ENVIRONMENT- Default environment filter
This CLI is designed for AI coding agents. Key features:
- Token-efficient output: Use
--aiflag for compact output - Structured context:
rollbar contextgenerates comprehensive bug reports - Time-based queries: Natural language durations like "8 hours ago"
- Exit codes: Proper exit codes for scripting (0=success, 1=error, 2=auth error, 3=not found, 4=rate limited)
# "What errors happened overnight?"
rollbar items --since "12 hours ago" --level error,critical --env production --ai
# "Get context for the most frequent error"
rollbar items --sort occurrences --limit 1 --output json | jq -r '.[0].counter' | xargs rollbar context
# "Find all TypeError issues"
rollbar items --query "TypeError" --level error --ai
# "Resolve items 93 and 95"
rollbar resolve 93 95This CLI includes an agent skill for Claude Code. When installed, Claude can automatically investigate Rollbar errors when you ask about production issues.
npx skills add robzolkos/rollbar-cliOr manually copy to your skills directory:
# Personal (all projects)
cp -r skills/rollbar ~/.claude/skills/
# Project-specific
mkdir -p .claude/skills
cp -r skills/rollbar .claude/skills/Once installed, Claude will automatically use the Rollbar CLI when you ask:
- "What errors happened overnight?"
- "Investigate error #123"
- "What's breaking in production?"
- "Get me context to fix this Rollbar issue"
Claude will query Rollbar, analyze the errors, and provide context for bug fixes—all without you needing to run commands manually.
Generate completions for your shell:
# Bash
rollbar completion bash > /etc/bash_completion.d/rollbar
# Zsh
rollbar completion zsh > "${fpath[1]}/_rollbar"
# Fish
rollbar completion fish > ~/.config/fish/completions/rollbar.fish# Run tests
make test
# Run with coverage
make test-cover
# Lint
make lint
# Build
make build
# Run E2E tests (requires ROLLBAR_E2E_TOKEN)
make test-e2eMIT