AGENT SKILL

usage-export

Export OpenClaw usage data to CSV for analytics tools like Power BI. Hourly aggregates by activity type, model, and channel.

适用职业数据分析师
使用场景分析与可视化
License 许可
MIT
最近更新
2026-08-23
Stars
★ 1
Forks
0

01 前言 Front Matter

name
usage-export
version
1.0.0
homepage
https://clawdhub.com/skills/usage-export
metadata
{ "openclaw": { "emoji": "?", "category": "analytics", "requires": { "bins": [ "python3" ] } } }
description
Export OpenClaw usage data to CSV for analytics tools like Power BI. Hourly aggregates by activity type, model, and channel.

02 资源文件 4

03 SKILL.md 正文

Usage Export

Export your OpenClaw usage data to CSV files for analytics in Power BI, Excel, or any BI tool.

What It Does

  • Scans session JSONL files for usage data
  • Aggregates by hour and activity type
  • Outputs one CSV per day
  • Tracks tokens, costs, and tool usage
  • Includes main session + subagent sessions

Output Format

CSV files are written to ~/.clawdbot/exports/usage/YYYY-MM-DD.csv:

timestamp_hour,date,hour,session_key,channel,model,provider,activity_type,request_count,input_tokens,output_tokens,cache_read_tokens,cache_write_tokens,total_tokens,cost_usd
2026-01-30T05:00:00Z,2026-01-30,5,agent:main:main,signal,claude-opus-4-5,anthropic,chat,3,24,892,14209,500,15625,0.12
2026-01-30T05:00:00Z,2026-01-30,5,agent:main:main,signal,claude-opus-4-5,anthropic,tool:exec,8,80,450,0,0,530,0.02

For detailed column definitions, see SCHEMA.md.

Installation

# Via ClawdHub
clawdhub install usage-export

# Or manually
mkdir -p ~/.openclaw/skills/usage-export
# Copy SKILL.md, SCHEMA.md, and scripts/ folder

Usage

Manual Export

# Export today's data
python3 {baseDir}/scripts/export.py --today

# Export specific date
python3 {baseDir}/scripts/export.py --date 2026-01-29

# Export date range
python3 {baseDir}/scripts/export.py --from 2026-01-01 --to 2026-01-31

Cron Setup (recommended)

Run hourly to keep exports fresh:

# System crontab
0 * * * * python3 ~/.openclaw/skills/usage-export/scripts/export.py --today

Or via OpenClaw config:

{
  "cron": {
    "jobs": [{
      "name": "usage-export",
      "schedule": { "kind": "cron", "expr": "0 * * * *" },
      "payload": { 
        "kind": "systemEvent", 
        "text": "Run usage export: python3 ~/.openclaw/skills/usage-export/scripts/export.py --today --quiet" 
      },
      "sessionTarget": "main"
    }]
  }
}

Power BI Integration

  1. Get Data → Text/CSV
  2. Point to ~/.clawdbot/exports/usage/ folder
  3. Combine files using Folder source
  4. Build your dashboard!

Suggested Visualizations

  • Daily cost trend — Line chart by date
  • Model breakdown — Pie chart by model
  • Activity heatmap — Matrix of hour × activity_type
  • Channel comparison — Bar chart by channel
  • Tool usage ranking — Top 10 tools by request count

Configuration

Environment variables (optional):

Variable Default Description
USAGE_EXPORT_DIR ~/.clawdbot/exports/usage Output directory
USAGE_EXPORT_SESSIONS ~/.clawdbot/agents Sessions directory

Notes

  • All timestamps are UTC
  • Cost column is an estimate based on configured pricing (see SCHEMA.md for details)
  • Cache tokens are Anthropic-specific; other providers show 0
  • New sessions are picked up automatically on next export run

04 同仓库更多 Skills

kbarbel640-del
kbarbel640-del/skills

crowd-prompting

A marketplace where AI agents improve prompts, system instructions, tool descriptions, and other text-based content with domain expertise from real-world operations — and earn tokens for valuable contributions.

内容创作者
★ 1
kbarbel640-del
kbarbel640-del/skills

dilemm-ai

Compete in DilemmAI, the prisoner's dilemma AI arena at dilemm.ai. Use when an OpenClaw agent wants to create an account, design and submit strategy prompts for their bot, enter matchmaking, analyze historical matches and leaderboards, and iterate on bot strategy. Requires headless browser automation (no API available yet).

Skill与智能体开发
★ 1
kbarbel640-del
kbarbel640-del/skills

arxiv-paper-reviews

Interact with arXiv Crawler API to fetch papers, read reviews, and submit comments. Use when working with arXiv papers, fetching paper lists by date/category/interest, viewing paper details with comments, or submitting paper reviews via API at http://150.158.152.82:8000.

资料检索与研究
★ 1
kbarbel640-del
kbarbel640-del/skills

arxiv-paper-reviews

Interact with arXiv Crawler API to fetch papers, read reviews, and submit comments. Use when working with arXiv papers, fetching paper lists by date/category/interest, viewing paper details with comments, or submitting paper reviews via API at http://150.158.152.82:8000.

资料检索与研究
★ 1
kbarbel640-del
kbarbel640-del/skills

git-summary

Get a quick summary of the current Git repository including status, recent commits, branches, and contributors.

★ 1
kbarbel640-del
kbarbel640-del/skills

agent-constitution

Interact with AgentConstitution governance contracts on Base Sepolia. Check compliance, read rules, log actions, query governance state.

律师与法务Skill与智能体开发
★ 1