mt-analytics
v1.1.0
Published
CLI for MetalTorque Agent Analytics — track AI agent performance, costs, anomalies, and trends across your fleet.
Maintainers
Readme
mt-analytics
CLI for MetalTorque Agent Analytics — track AI agent performance, costs, anomalies, and trends across your fleet.
Install
npx mt-analytics dashboard # Run without installing
npm i -g mt-analytics # Or install globallyQuick Start
# Fleet-wide dashboard (free, no key needed for public instance)
mt-analytics dashboard
# Last 7 days only
mt-analytics dashboard --days=7
# Deep dive on a specific agent
mt-analytics insights my-agent
# Check for anomalies
mt-analytics anomaliesCommands
Fleet Overview
| Command | Description |
|---------|-------------|
| dashboard | Fleet-wide analytics — events, agents, success rate, tokens, cost, volume sparkline |
| agents | List all registered agents with events, success rate, last seen |
| anomalies | Current anomaly alerts (error spikes, latency degradation) |
Agent Analysis
| Command | Description |
|---------|-------------|
| insights <agent_id> | Deep insights — top queries, unhandled intents, latency (avg + P95), tokens, cost, feedback |
| events [--agent=X] | Query stored events with filters |
Data Ingestion
| Command | Description |
|---------|-------------|
| ingest <agent_id> | Track an agent event (--type, --query, --latency, --tokens, --error) |
Configuration
| Command | Description |
|---------|-------------|
| config | View current configuration |
| config set <key> <value> | Set config value (keys: url, apiKey) |
Agent / CI Usage
Every command supports --json:
# JSON output for scripting
mt-analytics dashboard --json | jq '.total_events'
# GitHub Actions
- name: Agent Health Check
run: |
ANOMALIES=$(npx mt-analytics anomalies --json)
echo "$ANOMALIES" | jq '.alerts | length'
env:
MT_ANALYTICS_API_KEY: ${{ secrets.MT_ANALYTICS_KEY }}
# Track events from shell scripts
mt-analytics ingest my-agent --query="summarize doc" --latency=2300 --tokens=500Options
| Flag | Description |
|------|-------------|
| --json | Output raw JSON (for piping/agents) |
| --days=N | Time range in days (default: 30) |
| --agent=ID | Filter by agent ID |
| --type=TYPE | Filter by event type |
| --limit=N | Max events to return |
| --success=BOOL | Filter by success status |
| --version | Print version |
Environment Variables
| Variable | Description |
|----------|-------------|
| MT_ANALYTICS_API_KEY | API key (overrides saved config) |
| MT_ANALYTICS_URL | Server URL (default: https://analytics.metaltorque.dev) |
| NO_COLOR | Disable colored output |
Configuration is stored in ~/.mt-analytics/config.json.
