Repository navigation
feat(cli): add account spending-cap commands - #1613
Draft
ejanusevicius wants to merge 2 commits into
Draft
ejanusevicius wants to merge 2 commits into
ejanusevicius wants to merge 2 commits into
Conversation
Show, set and remove the overage spending limit from the CLI (`checkly account spending-limit [set <dollars> | remove]`). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ejanusevicius
marked this pull request as draft
November 20, 2026 13:18
Match the API: `/v1/billing/spending-cap`, `checkly account spending-cap`, "spending cap" in user-facing text. Explain the 401 legacy account API keys get. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Affected Components
Implements TREE-1269 "[CLI] Spending limit in the CLI". Customers can check and manage their overage spending cap from the CLI. The API calls it "spending cap", so the commands and the wording use that name too.
standingisnull, overage reads "Not measured" and the stopped and measured lines are left out, so it never shows $0.set/remove: fetch the current cap first, then go throughconfirmOrAbortwith--forceand--dry-run. The preview shows the change ("Change the spending cap from $50.00 to $12.50"). It also warns when the new cap is at or below the overage so far (checks stop at once), or when it is $0.InvalidInputError(exit 2).-o detail|json|md.jsonprints the API response unchanged.billing:read/billing:updateand the account must manage its plan in Checkly. The account-not-accessible 403 passes through unchanged.account:spending-capoclif topic, the new commands incommand-metadata.spec.ts, and amanage-spending-capAI-context reference.skills/checkly/SKILL.mdwas regenerated withsync:skills.Notes for the Reviewer
Depends on an unmerged backend API.
GET/PUT /v1/billing/spending-caplive on branchedvinas/tree-1269-cli-spending-limit-in-the-cliin the backend monorepo and are not merged or deployed yet. This PR is blocked from merge and release until that API ships. It has only been tested against mocks.Open questions:
billing:*permission apart from a missingSTRIPE_PLAN_MANAGEMENTfeature without a backenderrorCode, so the 403 message names both.REACHED.-odefault isdetail(likeaccount usage summary);members updateusestable.--output json, not in the terminal view.AuthCommandauthenticates beforerun(), so a bad amount is only rejected after the credential check. It never reaches the spending-cap API.checkly account --helplistsspending-capboth as a topic and as a command (oclif's behaviour for a command that is also a topic, below the root).Follow-up idea (not in this PR):
account usage summarycould fetch the cap for the terminal and md views and add a line such asSpending cap: $30.00 · overage so far $18.06 (close to cap), keeping its JSON unchanged.Verified:
pnpm --filter checkly run prepare(incl.tsc --build),pnpm lint,pnpm --filter checkly test(255 files, 4897 passed, 8 skipped).🤖 Generated with Claude Code