Token导航 LogoToken导航TokenDH.com
研究检索敏感数据clawhub未标认证来源可访问clear审计通过

openclaw-token-usageOpenClaw token 使用

Agent Skill

openclaw-token-usage 用于查找、检索和筛选相关信息,适合在 OpenClaw 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

4,823

周安装

197

GitHub Stars

公开资料未说明

下载量

1,560
OpenClaw

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:openclaw-token-usage(OpenClaw token 使用)
来源仓库:https://github.com/lujohn74/openclaw-token-usage
安装命令:
openclaw skills install openclaw-token-usage
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install openclaw-token-usage

简介

openclaw-token-usage 检查指定时间范围内的本地 Token 消耗记录。

  • 适用于查询历史使用情况、分析会话成本或审计资源开销。
  • 基于本地日志数据生成报告,支持按日与会话维度汇总。
  • 依赖本地数据库完整性,建议定期备份与校验数据一致性。
  • 适用宿主包括 OpenClaw,接入前应确认版本、权限和运行环境要求。

SKILL.md

name
openclaw-token-usage
description
Inspect token usage from local OpenClaw transcripts across a specified time range. Use when the user asks how many tokens were consumed in OpenClaw, GitHub Copilot model usage inside OpenClaw, or wants usage broken down by day, agent, provider, model, session, rankings, CSV exports, or markdown reports.

OpenClaw Token Usage

Use the bundled script to aggregate token usage recorded in local OpenClaw transcript files under ~/.openclaw/agents/*/sessions/.

Quick start

Run:

python3 ~/.openclaw/workspace/skills/openclaw-token-usage/scripts/report_openclaw_token_usage.py \
  --from '2026-03-14' \
  --to '2026-03-16' \
  --tz 'UTC+8'

Default output includes:

  • total usage
  • daily × agent breakdown
  • agent totals
  • model totals

Optional additions:

  • --top-sessions 10 for Top N session ranking
  • --csv-dir ~/.openclaw/workspace/output/token-usage-csv for CSV exports
  • --format json for structured output including session totals
  • --format markdown for a ready-to-share report

Workflow

  1. Confirm the time range.

- Accept natural ranges from the user, but convert them to explicit timestamps before running the script. - Default timezone should match the user's expectation; use UTC+8 unless they ask otherwise.

  1. Decide the scope.

- All agents by default. - Narrow with --agents when the user asks for specific agents. - Narrow with --providers or --models when the user wants only some models.

  1. Decide the output shape.

- Human summary by default. - JSON when another tool/script will consume the result. - CSV when the user wants spreadsheet/report-friendly output. - Markdown when the user wants a report for docs, messages, or status updates. - --top-sessions when the user wants ranking or hotspot analysis.

  1. Run the script.
  2. Report the result in plain language.

- Call out timezone assumptions. - Mention that counts are transcript-based and deduplicated across .reset / .deleted transcript copies. - Clarify that local transcript usage does not cover IDE-side GitHub Copilot usage outside OpenClaw.

Recommended commands

All agents, human-readable summary:

python3 ~/.openclaw/workspace/skills/openclaw-token-usage/scripts/report_openclaw_token_usage.py \
  --from '2026-03-14' \
  --to '2026-03-16' \
  --tz 'UTC+8'

Only GitHub Copilot provider:

python3 ~/.openclaw/workspace/skills/openclaw-token-usage/scripts/report_openclaw_token_usage.py \
  --from '2026-03-14' \
  --to '2026-03-16' \
  --tz 'UTC+8' \
  --providers github-copilot

Specific agents:

python3 ~/.openclaw/workspace/skills/openclaw-token-usage/scripts/report_openclaw_token_usage.py \
  --from '2026-03-14' \
  --to '2026-03-16' \
  --tz 'UTC+8' \
  --agents main,xiaocheng,xiaowen

Top sessions ranking:

python3 ~/.openclaw/workspace/skills/openclaw-token-usage/scripts/report_openclaw_token_usage.py \
  --from '2026-03-14' \
  --to '2026-03-16' \
  --tz 'UTC+8' \
  --top-sessions 10

JSON export:

python3 ~/.openclaw/workspace/skills/openclaw-token-usage/scripts/report_openclaw_token_usage.py \
  --from '2026-03-14' \
  --to '2026-03-16' \
  --tz 'UTC+8' \
  --format json \
  --output ~/.openclaw/workspace/output/token-usage.json

CSV exports:

python3 ~/.openclaw/workspace/skills/openclaw-token-usage/scripts/report_openclaw_token_usage.py \
  --from '2026-03-14' \
  --to '2026-03-16' \
  --tz 'UTC+8' \
  --csv-dir ~/.openclaw/workspace/output/token-usage-csv

Markdown report:

python3 ~/.openclaw/workspace/skills/openclaw-token-usage/scripts/report_openclaw_token_usage.py \
  --from '2026-03-14' \
  --to '2026-03-16' \
  --tz 'UTC+8' \
  --format markdown \
  --output ~/.openclaw/workspace/output/token-usage-report.md

Output notes

The script reports these metrics when present in transcripts:

  • input
  • output
  • cacheRead
  • cacheWrite
  • totalTokens
  • messages

Session notes:

  • Session totals are inferred from transcript files and sessions.json indexes when available.
  • If a transcript file cannot be mapped back to a session key, the script falls back to file:<filename>.

Markdown report notes:

  • Includes scope, summary, by-day table, by-agent table, by-model table, Top sessions, and auto-generated findings.
  • Suitable for sharing in docs or pasting into chat after light editing.

Important:

  • Some transcript entries may show a model/provider but still have zero token usage recorded.
  • This skill measures usage visible in local OpenClaw transcripts. It does not cover IDE-side GitHub Copilot usage outside OpenClaw.
  • If the user asks specifically for GitHub Copilot usage inside OpenClaw, prefer --providers github-copilot.

适合场景

01

OpenClaw 用户查找和安装 Skill 时

02

用户想查找某类 Agent Skill 时

03

需要根据任务场景推荐可安装能力包时

04

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

OpenClaw

73.15%
按下载量换算1,141

安全审计

VirusTotal

通过

ClawScan

通过

Static analysis

通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills