quota-reporter

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Quota Reporter

配额报告器

This skill installs and runs local reporters for Codex and Claude CLI usage.
本技能用于安装并运行Codex和Claude CLI使用情况的本地报告器。

What it does

功能介绍

  1. Reads the local
    ~/.codex/auth.json
    when Codex is present
  2. Probes the current Codex
    5H
    and
    1week
    quota windows
  3. Reads local Claude CLI auth and usage metadata when Claude is present
  4. Posts signed reports to the shared dashboard service
  5. Installs a reboot-safe scheduler that reports every hour
  1. 当存在Codex时,读取本地
    ~/.codex/auth.json
    文件
  2. 探测当前Codex的
    5H
    1week
    配额窗口
  3. 当存在Claude时,读取本地Claude CLI的认证信息和使用元数据
  4. 将签名后的报告发送至共享仪表盘服务
  5. 安装支持重启后自动运行的调度器,每小时生成一次报告

Files

文件列表

  • Combined reporter:
    scripts/report_all_usage.py
  • Codex reporter:
    scripts/report_codex_quota.py
  • Claude reporter:
    scripts/report_claude_usage.py
  • Installer:
    scripts/install_hourly_reporter.py
  • 综合报告器:
    scripts/report_all_usage.py
  • Codex报告器:
    scripts/report_codex_quota.py
  • Claude报告器:
    scripts/report_claude_usage.py
  • 安装脚本:
    scripts/install_hourly_reporter.py

Required inputs

所需输入

You need:
  • the shared dashboard URL, for example
    https://quota-report-hub.vercel.app
  • the ingest token for
    POST /api/report
你需要:
  • 共享仪表盘URL,例如
    https://quota-report-hub.vercel.app
  • POST /api/report
    接口的接入令牌(ingest token)

Standard flow

标准流程

One-off report

一次性报告

Run:
bash
python3 scripts/report_all_usage.py \
  --server-url https://your-dashboard.vercel.app \
  --ingest-token YOUR_TOKEN
If you only want one source:
bash
python3 scripts/report_codex_quota.py --server-url https://your-dashboard.vercel.app --ingest-token YOUR_TOKEN
python3 scripts/report_claude_usage.py --server-url https://your-dashboard.vercel.app --ingest-token YOUR_TOKEN
运行以下命令:
bash
python3 scripts/report_all_usage.py \
  --server-url https://your-dashboard.vercel.app \
  --ingest-token YOUR_TOKEN
如果仅需单一来源的报告:
bash
python3 scripts/report_codex_quota.py --server-url https://your-dashboard.vercel.app --ingest-token YOUR_TOKEN
python3 scripts/report_claude_usage.py --server-url https://your-dashboard.vercel.app --ingest-token YOUR_TOKEN

Install hourly reporting

安装每小时报告功能

Run:
bash
python3 scripts/install_hourly_reporter.py \
  --server-url https://your-dashboard.vercel.app \
  --ingest-token YOUR_TOKEN
The installer writes a local config file under
~/.agents/auth/
and installs the local scheduler. On macOS it installs a
launchd
agent with
RunAtLoad
. On Linux it installs
crontab
entries for both
@reboot
and hourly reporting, so the reporter comes back automatically after a restart.
运行以下命令:
bash
python3 scripts/install_hourly_reporter.py \
  --server-url https://your-dashboard.vercel.app \
  --ingest-token YOUR_TOKEN
安装脚本会在
~/.agents/auth/
目录下生成本地配置文件,并安装本地调度器。 在macOS系统中,它会安装一个带有
RunAtLoad
参数的
launchd
代理。 在Linux系统中,它会为
@reboot
和每小时报告添加
crontab
条目,确保重启后报告器能自动恢复运行。

Output expectations

输出预期

  • After a one-off report, show the returned status and the dashboard URL.
  • After installation, show the scheduler type and the config path.
  • If the report fails, include the HTTP status and response body.
  • 生成一次性报告后,显示返回状态和仪表盘URL。
  • 完成安装后,显示调度器类型和配置文件路径。
  • 如果报告失败,需包含HTTP状态码和响应体内容。