Production CLI for ActiveRabbit.ai: Rails/JS monitoring and AI-powered issue analysis.
Optimized for:
- Developers — fast terminal output with colors, relative times, visual bars
- AI agents — deterministic
--jsonoutput for scripts and automation - CI/CD —
--mdoutput for Slack/GitHub comments
gem install activerabbit-cliThis installs the activerabbit command.
git clone https://github.com/activerabbit/activerabbit-cli.git
cd activerabbit-cli
gem build activerabbit-cli.gemspec
gem install activerabbit-cli-1.0.0.gem# 1. Login with your API key (from app.activerabbit.ai → Settings → API)
activerabbit login --api-key YOUR_API_KEY
# 2. List your apps
activerabbit apps
# 3. Select default app
activerabbit use-app jobsgpt-prod
# 4. Check status
activerabbit statusOr use environment variables:
export ACTIVERABBIT_API_KEY=your_token
export ACTIVERABBIT_APP=your-app-slug
activerabbit incidents| Command | Description |
|---|---|
activerabbit login |
Authenticate with API key |
activerabbit apps |
List available apps |
activerabbit use-app <slug> |
Set default app |
activerabbit status |
App health: errors (24h), p95 latency, deploy status, top issue |
activerabbit incidents [--limit N] |
List incidents with severity, endpoint, count, relative time |
activerabbit show <id> |
Incident details: stack trace, affected users, recent events |
activerabbit explain <id> |
AI analysis: root cause, suggested fix, regression risk, tests |
activerabbit trace <endpoint|id> |
Trace analysis with visual span bars and bottlenecks |
activerabbit deploy-check |
Pre-deploy safety check |
activerabbit doctor |
Verify config and API connectivity |
Every command supports three output modes:
| Flag | Use case |
|---|---|
| (default) | Human-readable with colors, relative times, visual bars |
--json |
Deterministic JSON for scripts, CI, AI agents |
--md |
Markdown for Slack, GitHub comments, reports |
Note: Global options must come before the command:
# Correct
activerabbit --json incidents
# Also works (command-specific flags after)
activerabbit --json incidents --limit 5All commands return an envelope like:
{
"project": "project_id",
"generated_at": "2025-01-15T12:00:00Z",
"command": "explain",
"data": { ... }
}Example for explain:
{
"project": "42",
"generated_at": "2025-01-15T12:00:00Z",
"command": "explain",
"data": {
"incident_id": "inc_123",
"severity": "high",
"title": "NoMethodError in JobsController#show",
"root_cause": "...",
"confidence_score": 0.87,
"affected_endpoints": ["/jobs", "/jobs/:id"],
"suggested_fix": "...",
"regression_risk": "medium",
"tests_to_run": ["spec/requests/jobs_spec.rb"],
"estimated_impact": "..."
}
}# Fail deploy if project not healthy
activerabbit status --json | jq -e '.data.health == "ok"' || exit 1
# Post incident summary to Slack (e.g. from GitHub Actions)
activerabbit explain "$INCIDENT_ID" --md > summary.md
# Then upload summary.md to SlackConfig priority (highest to lowest):
- CLI flags (
--app,--base-url) - Environment variables
- Config file (
~/.config/activerabbit/config.yml)
| Env var | Description |
|---|---|
ACTIVERABBIT_API_KEY |
API token (required) |
ACTIVERABBIT_APP |
Default app slug |
ACTIVERABBIT_BASE_URL |
API URL (default: https://app.activerabbit.ai) |
#!/bin/bash
# Deploy gate: fail if app has critical errors
status=$(activerabbit --json status)
health=$(echo "$status" | jq -r '.data.health')
if [ "$health" != "ok" ]; then
echo "Deploy blocked: app health is $health"
activerabbit incidents --limit 3
exit 1
fi
echo "App healthy, proceeding with deploy"- GitHub PR integration — auto-comment with explain/deploy-check
- Deploy diff — compare errors before/after deploy
- MCP server — expose CLI to AI agents via Model Context Protocol
activerabbit watch— stream incidents in real-time- Webhook triggers — run CLI commands on new incidents