feat(cli): gx budget — Actions usage + paid-spend thresholds#574
Merged
NagyVikt merged 1 commit intoMay 13, 2026
Merged
Conversation
Wraps the new GitHub /settings/billing/usage endpoint (replaces the
410'd /settings/billing/actions endpoint) and aggregates Actions
minute spend for the current month per org or user.
gx budget [--org <name>] [--user <name>] [--month YYYY-MM]
[--warn-usd <n>] [--critical-usd <n>] [--json]
Auto-detects the authenticated login from `gh api user` and probes
the user endpoint first, then the org endpoint. Output includes
minutes used, gross/discount/net USD, top repos, runner SKU
breakdown, and a verdict against the warn/critical net-paid
thresholds (default $1 / $10). Critical severity exits 2 so CI
scripts can fail closed.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
New
gx budgetsubcommand. Wraps the new GitHub/settings/billing/usageendpoint (the legacy/settings/billing/actionsendpoint was retired in early 2026 — returns 410) and aggregates current-month Actions minute spend per org or user.Output: minutes used, gross/discount/net USD, top repos, runner SKU breakdown, verdict against warn/critical net-paid thresholds (default $1 / $10). Critical severity exits 2 so CI scripts can fail closed. Auto-detects the authenticated login when
--org/--useris omitted.Live smoke against
recodeeeshowed 155k Actions minutes this month covered entirely by the free-tier discount — useful baseline for measuring whether the budget-friendly CI trims merged earlier (#571, #572, #573) actually reduce next month's number.Test plan
node --check src/budget/index.jscleannode --test test/budget.test.js— 7/7 passing (arg parsing, threshold tiers, month filter, format output)gx budget --org recodeeereturned the expected shape against the live APIgx budget --helprenders correctly🤖 Generated with Claude Code