analytics-export

Export analytics data in various formats

laurigates/claude-plugins51 installsMITSynced Aug 26

Works with

Claude CodeCursorCodex CLIGitHub CopilotGemini CLI
---
name: analytics-export
description: Export analytics data in various formats
license: MIT
---

# /analytics:export

Export analytics data for external analysis or reporting.

## Context

Check analytics availability:

```bash
ANALYTICS_DIR="${HOME}/.claude-analytics"
SUMMARY_FILE="${ANALYTICS_DIR}/summary.json"
EVENTS_FILE="${ANALYTICS_DIR}/events.jsonl"

if [[ ! -f "${SUMMARY_FILE}" ]]; then
  echo "No analytics data to export."
  exit 0
fi

TOTAL=$(cat "${SUMMARY_FILE}" | jq -r '.total_invocations')
echo "Exporting ${TOTAL} invocations..."
```

## Parameters

- `$ARGS` - Format and optional output file:
  - `json` (default) - Export as JSON
  - `csv` - Export as CSV for spreadsheet analysis
  - `markdown` - Export as markdown table

## Execution

**Export analytics data:**

```bash
ANALYTICS_DIR="${HOME}/.claude-analytics"
SUMMARY_FILE="${ANALYTICS_DIR}/summary.json"
EVENTS_FILE="${ANALYTICS_DIR}/events.jsonl"

# Parse arguments
FORMAT=$(echo "${ARGS}" | awk '{print $1}')
OUTPUT_FILE=$(echo "${ARGS}" | awk '{print $2}')

FORMAT=${FORMAT:-json}

case "${FORMAT}" in
  json)
    if [[ -n "${OUTPUT_FILE}" ]]; then
      cat "${SUMMARY_FILE}" > "${OUTPUT_FILE}"
      echo "✓ Exported to: ${OUTPUT_FILE}"
    else
      echo "📦 Analytics Summary (JSON):"
      echo ""
      cat "${SUMMARY_FILE}" | jq '.'
    fi
    ;;

  csv)
    OUTPUT=${OUTPUT_FILE:-/dev/stdout}

    if [[ "${OUTPUT}" == "/dev/stdout" ]]; then
      echo "📦 Analytics Summary (CSV):"
      echo ""
    fi

    {
      echo "Name,Type,Count,Success,Failure,Success Rate,First Used,Last Used"
      cat "${SUMMARY_FILE}" | jq -r '
        .items |
        to_entries[] |
        [
          .key,
          .value.type,
          .value.count,
          .value.success,
          .value.failure,
          (.value.success * 100 / (.value.success + .value.failure)),
          .value.first_used,
          .value.last_used
        ] |
        @csv
      '
    } > "${OUTPUT}"

    if [[ "${OUTPUT}" != "/dev/stdout" ]]; then
      echo "✓ Exported to: ${OUTPUT}"
    fi
    ;;

  markdown)
    OUTPUT=${OUTPUT_FILE:-/dev/stdout}

    if [[ "${OUTPUT}" == "/dev/stdout" ]]; then
      echo "📦 Analytics Summary (Markdown):"
      echo ""
    fi

    {
      echo "# Command & Skill Analytics"
      echo ""
      TOTAL=$(cat "${SUMMARY_FILE}" | jq -r '.total_invocations')
      SINCE=$(cat "${SUMMARY_FILE}" | jq -r '.tracking_since')
      echo "**Total invocations:** ${TOTAL}"
      echo "**Tracking since:** ${SINCE}"
      echo ""

      echo "## Commands"
      echo ""
      echo "| Command | Uses | Success | Failure | Success Rate |"
      echo "|---------|------|---------|---------|--------------|"
      cat "${SUMMARY_FILE}" | jq -r '
        .items |
        to_entries[] |
        select(.value.type == "command") |
        "| \(.key) | \(.value.count) | \(.value.success) | \(.value.failure) | \((.value.success * 100 / (.value.success + .value.failure)) | floor)% |"
      ' | sort -t'|' -k2 -nr

      echo ""
      echo "## Skills"
      echo ""
      echo "| Skill | Uses | Success | Failure | Success Rate |"
      echo "|-------|------|---------|---------|--------------|"
      cat "${SUMMARY_FILE}" | jq -r '
        .items |
        to_entries[] |
        select(.value.type == "skill") |
        "| \(.key) | \(.value.count) | \(.value.success) | \(.value.failure) | \((.value.success * 100 / (.value.success + .value.failure)) | floor)% |"
      ' | sort -t'|' -k2 -nr
    } > "${OUTPUT}"

    if [[ "${OUTPUT}" != "/dev/stdout" ]]; then
      echo "✓ Exported to: ${OUTPUT}"
    fi
    ;;

  *)
    echo "❌ Unknown format: ${FORMAT}"
    echo ""
    echo "Supported formats:"
    echo "  • json     - JSON format"
    echo "  • csv      - CSV for spreadsheet import"
    echo "  • markdown - Markdown table"
    echo ""
    echo "Examples:"
    echo "  /analytics:export json"
    echo "  /analytics:export csv analytics.csv"
    echo "  /analytics:export markdown report.md"
    exit 1
    ;;
esac

echo ""
echo "💡 Tip: Raw event data is in ${EVENTS_FILE}"
```

## Post-actions

None.

More SEO & Marketing skills

ai-video-generation

skills-101/superpowers

Generate AI videos with Google Veo, Seedance 2.0, HappyHorse, Wan, Grok and 40+ models via inference.sh CLI. Models: Veo 3.1, Veo 3, Seedance 2.0, HappyHorse 1.0, Wan 2.5, Grok Imagine Video, OmniHuman, Fabric, HunyuanVideo. Capabilities: text-to-video, image-to-video, reference-to-video, video editing, lipsync, avatar animation, video upscaling, foley sound. Use for: social media videos, marketing content, explainer videos, product demos, AI avatars. Triggers: video generation, ai video, text to video, image to video, veo, animate image, video from image, ai animation, video generator, generate video, t2v, i2v, ai video maker, create video with ai, runway alternative, pika alternative, sora alternative, kling alternative, seedance, happyhorse

394.9k

ai-image-generation

skills-101/superpowers

Generate AI images with GPT-Image-2, FLUX, Gemini, Grok, Seedream, Reve and 50+ models via inference.sh CLI. Models: GPT-Image-2, FLUX Dev LoRA, FLUX.2 Klein LoRA, Gemini 3 Pro Image, Grok Imagine, Seedream 4.5, Reve, ImagineArt. Capabilities: text-to-image, image-to-image, inpainting, LoRA, image editing, upscaling, text rendering. Use for: AI art, product mockups, concept art, social media graphics, marketing visuals, illustrations. Triggers: flux, image generation, ai image, text to image, stable diffusion, generate image, ai art, midjourney alternative, dall-e alternative, text2img, t2i, image generator, ai picture, create image with ai, generative ai, ai illustration, grok image, gemini image, gpt image, openai image, chatgpt image

394.6k

ai-avatar-video

skills-101/superpowers

Create AI avatar and talking head videos via inference.sh CLI. Recommended: P-Video-Avatar (fastest, cheapest, built-in TTS). Also: OmniHuman, Fabric, PixVerse. Audio: Inworld TTS-2 (100+ languages, emotion steering for characters), ElevenLabs, Kokoro. Capabilities: audio-driven avatars, text-to-avatar, lipsync videos, talking head generation, virtual presenters, UGC content. Use for: AI presenters, explainer videos, virtual influencers, dubbing, marketing videos, UGC ads, gaming avatars, NPC dialogue. Triggers: ai avatar, talking head, lipsync, avatar video, virtual presenter, ai spokesperson, audio driven video, heygen alternative, synthesia alternative, talking avatar, lip sync, video avatar, ai presenter, digital human, ugc, ugc video, ugc ad, avatar ugc

394.5k

← All SEO & Marketing skills

Check your AI visibility

One URL in, a 0–100 score and the exact fixes out.

RUN THE CHECK

Browse all the tools

15 tools across six categories
13 of them never send your data anywhere

Free · No signup · No trial clock

SEE THE DIRECTORY