Analytics CLI Reference

Monitor traffic, costs, conversations, and agent performance with the analytics CLI domain. Gain insights into your AI agent operations.

The analytics domain provides insights into your SystemPrompt operations. Monitor traffic, track costs, analyze conversations, and measure agent performance.

Why Analytics Exists

Running AI agents requires visibility into:

  • Traffic - Who's using your system and how
  • Costs - AI provider spending (Anthropic, OpenAI)
  • Conversations - Chat interactions and outcomes
  • Agent performance - Response times and success rates
  • Tool usage - Which MCP tools are being used

The analytics domain surfaces these metrics.

Quick Reference

Subcommand Description
analytics overview Dashboard with all metrics
analytics conversations Conversation analytics
analytics agents Agent performance metrics
analytics tools Tool usage statistics
analytics requests AI request analytics
analytics sessions User session tracking
analytics content Content performance
analytics traffic Traffic and bot detection
analytics costs Cost breakdown by provider

Overview Dashboard

Get a high-level view of all analytics:

# Show overview dashboard
systemprompt analytics overview

# JSON output
systemprompt --json analytics overview

# Specify time range
systemprompt analytics overview --from 2026-01-01 --to 2026-01-31

Output:

┌─────────────────────────────────────────────────────────┐
│                   ANALYTICS OVERVIEW                     │
├─────────────────────────────────────────────────────────┤
│ Period: 2026-01-01 to 2026-01-30                        │
├─────────────────────────────────────────────────────────┤
│ Conversations:    1,234      │ Avg Response:   2.3s     │
│ Messages:         8,456      │ Success Rate:   98.5%    │
│ Users:              342      │ Active Agents:     5     │
├─────────────────────────────────────────────────────────┤
│ Total Cost:       $45.67     │ Anthropic:     $32.10    │
│ Requests:         12,345     │ OpenAI:        $13.57    │
└─────────────────────────────────────────────────────────┘

Conversations

Analyze chat conversations.

Conversation Statistics

# View conversation stats
systemprompt analytics conversations

# Filter by date
systemprompt analytics conversations --from 2026-01-01

# Filter by agent
systemprompt analytics conversations --agent writer

Metrics provided:

  • Total conversations
  • Messages per conversation (average)
  • Conversation duration (average)
  • Completion rate
  • User satisfaction scores

Conversation Details

# List recent conversations
systemprompt analytics conversations list --limit 20

# Show specific conversation
systemprompt analytics conversations show conversation_abc123

Agents

Monitor agent performance.

Agent Statistics

# View agent performance
systemprompt analytics agents

# Specific agent
systemprompt analytics agents --name writer

# JSON output
systemprompt --json analytics agents

Metrics provided:

  • Messages processed
  • Average response time
  • Success/failure rate
  • Token usage
  • Cost per agent

Agent Comparison

# Compare all agents
systemprompt analytics agents compare

# Compare specific agents
systemprompt analytics agents compare --agents writer,analyst

Tools

Track MCP tool usage.

Tool Statistics

# View tool usage
systemprompt analytics tools

# Filter by agent
systemprompt analytics tools --agent writer

Output:

┌────────────────────┬───────┬─────────┬──────────┐
│ Tool               │ Calls │ Success │ Avg Time │
├────────────────────┼───────┼─────────┼──────────┤
│ web_search         │  456  │  98.2%  │  1.2s    │
│ file_read          │  234  │ 100.0%  │  0.1s    │
│ database_query     │  123  │  99.1%  │  0.3s    │
│ code_execute       │   89  │  95.5%  │  2.1s    │
└────────────────────┴───────┴─────────┴──────────┘

Tool Details

# Show tool usage details
systemprompt analytics tools show web_search

Requests

Monitor AI API requests.

Request Statistics

# View request stats
systemprompt analytics requests

# Filter by provider
systemprompt analytics requests --provider anthropic
systemprompt analytics requests --provider openai

Metrics provided:

  • Total requests
  • Tokens (input/output)
  • Average latency
  • Error rate
  • Cost breakdown

Request History

# List recent requests
systemprompt analytics requests list --limit 50

# Filter by model
systemprompt analytics requests list --model claude-3-opus

Sessions

Track user sessions.

Session Statistics

# View session analytics
systemprompt analytics sessions

# Filter by date
systemprompt analytics sessions --from 2026-01-01

Metrics provided:

  • Total sessions
  • Unique users
  • Average session duration
  • Pages per session
  • Bounce rate

Active Sessions

# Show active sessions
systemprompt analytics sessions active

Session Details

# Show session details
systemprompt analytics sessions show session_abc123

Content

Track content performance.

Content Statistics

# View content analytics
systemprompt analytics content

# Filter by source
systemprompt analytics content --source blog

Metrics provided:

  • Page views
  • Unique visitors
  • Time on page (average)
  • Bounce rate
  • Top content

Top Content

# Show top performing content
systemprompt analytics content top --limit 10

Traffic

Monitor traffic patterns and detect bots.

Traffic Overview

# View traffic analytics
systemprompt analytics traffic

# JSON output
systemprompt --json analytics traffic

Metrics provided:

  • Total requests
  • Unique visitors
  • Geographic distribution
  • Device/browser breakdown
  • Referrer sources

Bot Detection

# View bot traffic
systemprompt analytics traffic bots

# Show bot details
systemprompt analytics traffic bots --detailed

Output:

┌────────────────────┬────────┬──────────────┐
│ Category           │ Hits   │ Percentage   │
├────────────────────┼────────┼──────────────┤
│ Human traffic      │ 8,456  │ 82.3%        │
│ Good bots          │ 1,234  │ 12.0%        │
│ Suspicious         │   456  │  4.4%        │
│ Known bad bots     │   134  │  1.3%        │
└────────────────────┴────────┴──────────────┘

Geographic Traffic

# View traffic by country
systemprompt analytics traffic geo

# Top countries
systemprompt analytics traffic geo --top 10

Costs

Track AI provider costs.

Cost Overview

# View cost breakdown
systemprompt analytics costs

# Filter by provider
systemprompt analytics costs --provider anthropic

# Filter by date range
systemprompt analytics costs --from 2026-01-01 --to 2026-01-31

Output:

┌──────────────────────────────────────────────────────────┐
│                    COST BREAKDOWN                         │
├──────────────────────────────────────────────────────────┤
│ Period: 2026-01-01 to 2026-01-30                         │
├──────────────────────────────────────────────────────────┤
│ Provider      │ Requests │ Tokens      │ Cost           │
├───────────────┼──────────┼─────────────┼────────────────┤
│ Anthropic     │   8,234  │ 2,345,678   │ $32.10         │
│ OpenAI        │   4,111  │ 1,234,567   │ $13.57         │
├───────────────┼──────────┼─────────────┼────────────────┤
│ TOTAL         │  12,345  │ 3,580,245   │ $45.67         │
└───────────────┴──────────┴─────────────┴────────────────┘

Cost by Agent

# View costs per agent
systemprompt analytics costs --by agent

Cost Projections

# Project costs based on current usage
systemprompt analytics costs project --days 30

Common Workflows

Daily Monitoring

# Check overall health
systemprompt analytics overview

# Check for errors
systemprompt analytics agents --sort-by error_rate

# Review costs
systemprompt analytics costs

Performance Investigation

# Check agent performance
systemprompt analytics agents

# Find slow tools
systemprompt analytics tools --sort-by avg_time

# Review request latencies
systemprompt analytics requests --sort-by latency

Cost Management

# Current month costs
systemprompt analytics costs --from $(date +%Y-%m-01)

# Cost by agent
systemprompt analytics costs --by agent

# Project end of month costs
systemprompt analytics costs project

Traffic Analysis

# Check traffic patterns
systemprompt analytics traffic

# Identify bot traffic
systemprompt analytics traffic bots --detailed

# Geographic breakdown
systemprompt analytics traffic geo

Export and Reporting

Export Data

# Export analytics to CSV
systemprompt analytics overview --export csv --output analytics.csv

# Export to JSON
systemprompt analytics costs --export json --output costs.json

Generate Report

# Generate monthly report
systemprompt analytics report --period monthly --output report.pdf

Playbooks:

  • systemprompt core playbooks show cli_analytics - Analytics operations

Guides:


Previous Next
Cloud Deployment Web CLI