mirror of
https://github.com/github/awesome-copilot.git
synced 2026-02-24 20:35:12 +00:00
Add copilot-usage-metrics skill
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>
This commit is contained in:
22
skills/copilot-usage-metrics/get-org-user-metrics.sh
Normal file
22
skills/copilot-usage-metrics/get-org-user-metrics.sh
Normal file
@@ -0,0 +1,22 @@
|
||||
#!/usr/bin/env bash
|
||||
# Fetch per-user Copilot usage metrics for an organization
|
||||
# Usage: get-org-user-metrics.sh <org> [day]
|
||||
# org - GitHub organization name
|
||||
# day - (optional) specific day in YYYY-MM-DD format
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
ORG="${1:?Usage: get-org-user-metrics.sh <org> [day]}"
|
||||
DAY="${2:-}"
|
||||
|
||||
if [ -n "$DAY" ]; then
|
||||
gh api \
|
||||
-H "Accept: application/vnd.github+json" \
|
||||
-H "X-GitHub-Api-Version: 2022-11-28" \
|
||||
"/orgs/$ORG/copilot/usage/users/day?day=$DAY"
|
||||
else
|
||||
gh api \
|
||||
-H "Accept: application/vnd.github+json" \
|
||||
-H "X-GitHub-Api-Version: 2022-11-28" \
|
||||
"/orgs/$ORG/copilot/usage/users"
|
||||
fi
|
||||
Reference in New Issue
Block a user