← 返回 Skills 市场
hitman86r

Copilot Usage

作者 Hitman86R · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
87
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install copilot-usage
功能描述
Display GitHub Copilot premium request usage, quota, billing stats, and per-model multipliers for the authenticated user. Use when the user asks about their...
使用说明 (SKILL.md)

Copilot Usage Skill

Fetch and display GitHub Copilot premium request usage via the GitHub REST API.

Important API Limitations

The GitHub Billing API does not expose the plan quota (e.g., 50, 300, or 1500 requests/month). This information is not available in any endpoint. Therefore:

  1. The user must configure their plan once — stored in ~/.config/copilot-usage/config.json
  2. On first run, the script detects missing config and prompts the user to set their plan

Explain this limitation clearly to the user when asking for their plan. Reference: https://docs.github.com/en/rest/billing/usage

Auth Requirements

  • Requires gh CLI authenticated with scopes: manage_billing:copilot + user
  • Fine-grained tokens are not supported by GitHub billing endpoints — classic PAT required
  • Check: gh auth status
  • Fix: gh auth login then gh auth refresh -s manage_billing:copilot

Usage

bash scripts/copilot-usage.sh                        # current month
bash scripts/copilot-usage.sh --month 3 --year 2026  # specific month
bash scripts/copilot-usage.sh --model claude          # filter by model
bash scripts/copilot-usage.sh --json                  # raw JSON output
bash scripts/copilot-usage.sh --set-plan pro+         # configure plan
bash scripts/copilot-alert.sh --threshold 80          # quota alert check

Model Multipliers

The grossQuantity returned by the API already includes the multiplier. The script reverse-calculates the actual number of prompts sent and shows both values. See references/multipliers.md for the full table.

Key insight: actual_prompts = grossQuantity / multiplier

What the Dashboard Shows

  • Monthly quota used vs. remaining (requires plan config)
  • Progress bar with percentage
  • Overage count and cost
  • Per-model breakdown with multiplier, gross requests, and estimated actual prompts
  • Days until monthly reset
  • Warning if plan config is missing or stale

Config File

Stored at ~/.config/copilot-usage/config.json:

{
  "plan": "pro+",
  "quota": 1500,
  "set_at": "2026-04-08"
}

Handling Errors

  • 403 Forbidden — token lacks billing scope: gh auth refresh -s manage_billing:copilot
  • 404 Not Found — verify endpoint path or plan eligibility (org/enterprise users must use org-level endpoints)
  • Config missing — run bash scripts/copilot-usage.sh --set-plan \x3Cplan>

API Endpoints

See references/api.md for full endpoint documentation and response schemas.

安全使用建议
This skill appears to do exactly what it says: call GitHub's Copilot billing API via the official gh CLI and show a local dashboard. Before installing or running: (1) review the scripts yourself — they will run locally and create ~/.config/copilot-usage/config.json; (2) understand you must authenticate gh with a classic PAT granting manage_billing:copilot and user scopes (billing scopes are sensitive — only grant to tokens you control); (3) gh stores auth state locally, so avoid running if you cannot protect that credential; (4) the plan quota is stored locally because the GitHub API doesn't provide it — keep that config private; and (5) if you don't want to grant billing scopes, do not run the scripts. Otherwise the skill is coherent and limited to the expected billing queries.
功能分析
Type: OpenClaw Skill Name: copilot-usage Version: 1.0.0 The skill bundle is a legitimate utility for monitoring GitHub Copilot usage and quotas via the GitHub CLI (`gh`). It fetches data from official GitHub Billing API endpoints, processes it using local Python scripts, and provides a dashboard and alerting mechanism. No evidence of data exfiltration, malicious execution, or prompt injection was found; the code logic is transparent and aligns with the stated purpose in `SKILL.md` and `scripts/copilot-usage.sh`.
能力标签
cryptocan-make-purchasesrequires-oauth-token
能力评估
Purpose & Capability
Name/description (Copilot usage, quota, billing, per-model multipliers) align with the included scripts and docs. The scripts call the GitHub REST billing endpoints via the gh CLI and require the manage_billing:copilot and user scopes — exactly what billing queries need. No unrelated binaries, env vars, or config paths are requested.
Instruction Scope
SKILL.md and the scripts only read/write a single local config (~/.config/copilot-usage/config.json), call gh api endpoints, and render a dashboard. They do not reference other system files, other skills' configs, or external endpoints beyond GitHub (no obfuscated endpoints or unexpected network sinks). The instructions are scoped and explicit about authentication and the manual plan configuration requirement.
Install Mechanism
There is no install spec — the skill is instruction+script-based and does not download or install remote code. Scripts rely on standard user tools (gh, python3, bash) already present on developer systems; nothing writes or extracts arbitrary archives.
Credentials
No declared environment variables, which is consistent. The only credential requirement is a GitHub classic Personal Access Token (via gh) with manage_billing:copilot and user scopes — this is necessary for billing endpoints but is a sensitive scope (billing access). The SKILL.md correctly warns fine-grained tokens aren't supported. Users should be aware this requires granting billing privileges to gh.
Persistence & Privilege
The skill does persist a small config file in ~/.config/copilot-usage/config.json to store the user's plan and quota; this is reasonable and documented. always:false and no changes to other skills or global settings are performed.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install copilot-usage
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /copilot-usage 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release: GitHub Copilot premium request dashboard with quota tracking, per-model multiplier breakdown, and configurable plan alerts.
元数据
Slug copilot-usage
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Copilot Usage 是什么?

Display GitHub Copilot premium request usage, quota, billing stats, and per-model multipliers for the authenticated user. Use when the user asks about their... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 87 次。

如何安装 Copilot Usage?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install copilot-usage」即可一键安装,无需额外配置。

Copilot Usage 是免费的吗?

是的,Copilot Usage 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Copilot Usage 支持哪些平台?

Copilot Usage 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Copilot Usage?

由 Hitman86R(@hitman86r)开发并维护,当前版本 v1.0.0。

💬 留言讨论