Repository navigation
feat(cli): show monthly usage and charges - #356
Merged
Merged
Conversation
Contributor
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 04290bc. Configure here.
designcode
force-pushed
the
feat/cli-usage
branch
2 times, most recently
from
October 6, 2026 13:52
2043ece to
d8895c3
Compare
designcode
force-pushed
the
feat/cli-usage
branch
from
October 6, 2026 13:57
d8895c3 to
ef7cf92
Compare
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Assisted-by: Claude Fable 5.1 via Claude Code
designcode
force-pushed
the
feat/cli-usage
branch
from
October 6, 2026 14:13
ef7cf92 to
61647d1
Compare
MantasMiksys
approved these changes
Oct 6, 2026
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
Adds
tigris usage: the active organization's usage and charges for a billing month — the data behind the console's Usage page (GET {mgmt}/usage/invoice?month=YYYY-MM).Usedis the metered quantity,Billedthe quantity charged (they differ when a plan minimum applies).--month YYYY-MMfor another month (default: current);--allalso lists line items with zero usage;--format jsonreturns the full invoice;--format xmlemits the charges with raw values plus the invoice amounts. The footer mirrors the console: Minimum Commitment (when the plan has one), Subtotal, each credit, Total — also when nothing was metered. Since the commitment is a floor (total = max(subtotal, minimum commitment) − credits), a note under the table spells it out: "Minimum commitment: your plan bills at least $10.00 a month, before credits." A pay/receipt link is printed as a hint when present. Requires OAuth login.@tigrisdata/iam:getUsage({ month, config })against the management endpoint, returning a camelCaseUsageResponse(charges with tiers, subtotal, credits, total, plan, invoice state). Validates the month before any request; Go zero-times becomeundefined.formatTablegains an optionalfooterargument: summary rows set apart by a rule, with column widths that account for them.Test plan
@tigrisdata/iamand@tigrisdata/cliunit tests (new:usage/get.test.ts,test/lib/usage.test.ts, footer cases informat.test.ts); specs-completeness passes with the new entrytigris usage,--all,--month 2026-09,--format json,--format xml, and--month 2026-13→ exit 1 with a clear messagetsc, Biome, README regenerated🤖 Generated with Claude Code
Note
Medium Risk
Read-only billing/invoice data over the management API behind OAuth, with new client mapping logic; no payment or auth flow changes, but mistakes could misrepresent charges.
Overview
Adds
tigris usageso OAuth-authenticated users can view the active org’s monthly usage and charges (console Usage page parity), with--month YYYY-MM,--allfor zero lines, and--formattable/json/xml.The CLI calls new
@tigrisdata/iamgetUsage(GET /usage/invoice), which validates the month, maps the invoice (charges, tiers, credits, minimum commit, checkout/receipt URLs), and strips Go zero timestamps. Table output hides unused line items by default, prints invoice footer rows (commitment, subtotal, credits, total), optional minimum-commitment note, and payment/receipt hints.formatTablegains an optional footer separated by a rule, with column widths including footer text.Reviewed by Cursor Bugbot for commit 61647d1. Bugbot is set up for automated code reviews on this repo. Configure here.