Conversation
A Copilot CLI agent skill that retrieves and displays GitHub Copilot usage metrics for organizations and enterprises via the REST API. Features: - Organization-level aggregated and per-user metrics - Enterprise-level aggregated and per-user metrics - Query metrics for specific dates - Uses gh CLI for API authentication Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Adds a new copilot-usage-metrics Agent Skill under skills/ to help Copilot CLI retrieve GitHub Copilot usage metrics for organizations and enterprises using gh api against the Copilot Usage Metrics REST endpoints.
Changes:
- Introduces
skills/copilot-usage-metrics/SKILL.mddescribing when/how to retrieve aggregated and per-user usage metrics. - Adds 4 bash helper scripts that call the org/enterprise aggregated and per-user Copilot usage endpoints.
- Supports optional day-specific queries via a
[day]argument.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| skills/copilot-usage-metrics/SKILL.md | Defines the skill’s purpose, usage flow, available scripts, and output guidance. |
| skills/copilot-usage-metrics/get-org-metrics.sh | Fetches org-level aggregated Copilot usage metrics (optionally by day). |
| skills/copilot-usage-metrics/get-org-user-metrics.sh | Fetches org-level per-user Copilot usage metrics (optionally by day). |
| skills/copilot-usage-metrics/get-enterprise-metrics.sh | Fetches enterprise-level aggregated Copilot usage metrics (optionally by day). |
| skills/copilot-usage-metrics/get-enterprise-user-metrics.sh | Fetches enterprise-level per-user Copilot usage metrics (optionally by day). |
| @@ -0,0 +1,52 @@ | |||
| --- | |||
| name: copilot-usage-metrics | |||
| description: Retrieve and display GitHub Copilot usage metrics for organizations and enterprises using the GitHub CLI and REST API. | |||
There was a problem hiding this comment.
The skill frontmatter description should follow the skill template format (quoted string) and include stronger discovery keywords (e.g., explicitly include a “Use when …” clause) so it’s consistent with the documented SKILL.md frontmatter guidance (see skills/make-skill-template/SKILL.md around the frontmatter example).
| description: Retrieve and display GitHub Copilot usage metrics for organizations and enterprises using the GitHub CLI and REST API. | |
| description: 'Use when you need to retrieve and display GitHub Copilot usage metrics for organizations or enterprises using the GitHub CLI and REST API.' |
| # Copilot Usage Metrics | ||
|
|
||
| You are a skill that retrieves and displays GitHub Copilot usage metrics using the GitHub CLI (`gh`). |
There was a problem hiding this comment.
This new skill isn’t added to the skills index table in docs/README.skills.md, so it won’t be discoverable from the repository docs. Please add a new row for copilot-usage-metrics (with bundled assets listed).
A Copilot CLI agent skill that retrieves and displays GitHub Copilot usage metrics for organizations and enterprises via the REST API.
Features:
Pull Request Checklist
Description
A new copilot-usage-metrics skill that enables Copilot CLI to fetch and display GitHub Copilot usage metrics using the gh CLI and the Copilot Usage Metrics
REST API (https://docs.github.com/en/rest/copilot/copilot-usage-metrics) (Enterprise Cloud).
Skill structure:
skills/copilot-usage-metrics/
├── SKILL.md # Skill instructions with front matter
├── get-org-metrics.sh # Org aggregated metrics
├── get-org-user-metrics.sh # Org per-user metrics
├── get-enterprise-metrics.sh # Enterprise aggregated metrics
└── get-enterprise-user-metrics.sh # Enterprise per-user metrics
Example usage:
Use the /copilot-usage-metrics skill to show Copilot usage for org "my-org"
Use the /copilot-usage-metrics skill to get per-user metrics for enterprise "my-enterprise" on 2026-02-15
Prerequisites: GitHub CLI (gh) authenticated with manage_billing:copilot or read:enterprise scope, and the "Copilot usage metrics" policy enabled.
Type of Contribution
Additional Notes
By submitting this pull request, I confirm that my contribution abides by the Code of Conduct and will be licensed under the MIT License.