Skip to content

activerabbit-ai/activerabbit-cli

Repository files navigation

activerabbit-cli

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 --json output for scripts and automation
  • CI/CD--md output for Slack/GitHub comments

Installation

gem install activerabbit-cli

This installs the activerabbit command.

From source

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

Quick start

# 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 status

Or use environment variables:

export ACTIVERABBIT_API_KEY=your_token
export ACTIVERABBIT_APP=your-app-slug
activerabbit incidents

Commands

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

Output formats

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 5

JSON shape

All 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": "..."
  }
}

CI / script example

# 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 Slack

Configuration

Config priority (highest to lowest):

  1. CLI flags (--app, --base-url)
  2. Environment variables
  3. 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)

CI/CD example

#!/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"

Roadmap (v2)

  • 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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages