You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit c4eddb4
Browse filesBrowse the repository at this point in the historyBrowse files
* chore: ignore macOS .DS_Store files
* feat: add enterprise AI credit budget reporting to github-copilot-report
Reports each licensed user's effective Universal/Individual AI credit
budget and consumption via the enterprise-level Budgets API
(GET /enterprises/{enterprise}/settings/billing/budgets and
.../budgets/{id}/user-states), adding Budget Scope/Limit/Used/Remaining
CSV columns. Adds a --no-budgets flag to skip the lookup.
---------
Co-authored-by: Patrick Lewis <plewis@ontinue.com>
Generates a GitHub Copilot Enterprise licence and usage report. Shows every licensed user, their plan type, pool credit contribution, and actual AI credit consumption for the current billing month. Optionally enriches data with Entra ID department information.
578
+
Generates a GitHub Copilot Enterprise licence and usage report. Shows every licensed user, their plan type, pool credit contribution, and actual AI credit consumption for the current billing month, plus their effective AI credit budget (Individual override, else Universal) and how much of it has been consumed. Optionally enriches data with Entra ID department information.
579
579
580
580
**Prerequisites:**
581
581
-**[curl](https://curl.se)** — HTTP client
@@ -606,6 +606,7 @@ az login # optional; needed only for Entra ID department enrichment
- Fetches all Copilot seats across the enterprise (deduplicated by user)
624
626
- Fetches per-user AI credit consumption for the current billing month
627
+
- Fetches enterprise-level AI credit budgets (Universal and Individual overrides) and each user's consumed amount against them
625
628
- Fetches enterprise-level model usage metrics (last 28 days)
626
629
- Optionally enriches each user with Entra ID department and job title via `az rest`
627
630
- Outputs a CSV and a formatted console summary with department breakdown and model usage tables
@@ -630,7 +633,7 @@ az login # optional; needed only for Entra ID department enrichment
630
633
> Requires a PAT with `read:enterprise` and `manage_billing:enterprise` scopes — the built-in `GITHUB_TOKEN` cannot grant enterprise-level access. Set `GITHUB_TOKEN` before executing (or have an active `gh` auth session with those scopes so the lib can auto-resolve the token).
631
634
632
635
> [!NOTE]
633
-
> The Entra ID enrichment is skipped automatically if `az` is not logged in, or can be disabled with `--no-entra`.
636
+
> The Entra ID enrichment is skipped automatically if `az` is not logged in, or can be disabled with `--no-entra`. Budget lookups require the token owner to be an enterprise admin or billing manager, and can be disabled with `--no-budgets`.
print_status "Loaded budget data for ${#USER_BUDGET_SCOPE[@]} user(s)."
460
+
else
461
+
print_warning "No enterprise AI credit budgets are configured (Enterprise → Policies → Copilot → Budgets), or the token lacks enterprise admin/billing manager access."
462
+
fi
463
+
fi
464
+
371
465
# Build sorted list of all model names seen across all users
0 commit comments