Skip to content

feat(cli): gx budget — Actions usage + paid-spend thresholds#574

Merged
NagyVikt merged 1 commit into
mainfrom
agent/claude/gx-budget-subcommand-2026-05-14-01-32
May 13, 2026
Merged

feat(cli): gx budget — Actions usage + paid-spend thresholds#574
NagyVikt merged 1 commit into
mainfrom
agent/claude/gx-budget-subcommand-2026-05-14-01-32

Conversation

@NagyVikt
Copy link
Copy Markdown
Collaborator

Summary

New gx budget subcommand. Wraps the new GitHub /settings/billing/usage endpoint (the legacy /settings/billing/actions endpoint was retired in early 2026 — returns 410) and aggregates current-month Actions minute spend per org or user.

gx budget [--org <name>] [--user <name>] [--month YYYY-MM]
          [--warn-usd <n>] [--critical-usd <n>] [--json]

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/--user is omitted.

Live smoke against recodeee showed 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.js clean
  • node --test test/budget.test.js — 7/7 passing (arg parsing, threshold tiers, month filter, format output)
  • Live: gx budget --org recodeee returned the expected shape against the live API
  • Live: gx budget --help renders correctly
  • Verify next month: re-run after the budget-friendly trims have a full cycle of data; expected minutes-used drops materially.

🤖 Generated with Claude Code

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>
@NagyVikt NagyVikt merged commit 8b50cc2 into main May 13, 2026
1 of 2 checks passed
@NagyVikt NagyVikt deleted the agent/claude/gx-budget-subcommand-2026-05-14-01-32 branch May 13, 2026 23:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant