Skip to content

docs(cli): document account spending-cap commands - #871

Open
ejanusevicius wants to merge 1 commit into
mainfrom
edvinas/tree-1269-cli-spending-cap-docs
Open

ejanusevicius wants to merge 1 commit into
mainfrom
edvinas/tree-1269-cli-spending-cap-docs

Conversation

@ejanusevicius

Copy link
Copy Markdown
Contributor

What

Documents the checkly account spending-cap commands added in checkly/checkly-cli#1613 (TREE-1269):

  • cli/checkly-account.mdx: new checkly account spending-cap section (show, set <dollars>, remove), with output fields, amount rules, plan/permission/API key requirements, the confirmation flow (--force, --dry-run, confirmation_required with exit 3) and examples. Subcommand table and page description updated.
  • cli/checkly-skills.mdx: adds the spending-cap resource to the skills manage table.
  • admin/usage.mdx: one-sentence cross-link from the overage emails paragraph.

Example output is taken from the CLI test evidence captured against a local backend.

Merge timing

Merge only after a CLI release includes checkly/checkly-cli#1613. It is merged on main but not yet released (latest is 10.2.0). Consider adding an "Available since CLI vX" note once the version is known.

Validation

  • npm run check:links: no broken internal links
  • npm run check:anchors: OK
  • python3 .github/scripts/check_frontmatter.py: passed
  • npx mint broken-links: no broken links found

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mintlify

mintlify Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated
checkly-422f444a 🟢 Ready View Preview Nov 23, 2026, 1:54 PM

💡 Tip: Enable Automations to automatically generate PRs for you.

@hlenke hlenke left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs changes · The commands shipped in CLI 10.3.0 today, so the merge condition in the description is met: add an "Available since CLI v10.3.0" note to the new section and this is ready to merge.

The content holds up. I checked every claim against the CLI source on checkly-cli main (c58d58c1, which is exactly the 10.3.0 tag) and found nothing wrong. The flags, the 0 to 10000 range with at most 2 decimals, the billing:read/billing:update permissions, the API key and plan errors, exit codes 2 and 3, the dry_run/confirmation_required envelope and its confirmCommand, the output fields, and the spending-cap skills resource all match the source.

Not about specific lines

  • CI passes, and the PR is mergeable.
  • Release. CLI 10.3.0, published 2026-11-23, lists checkly/checkly-cli#1613. The compare 10.3.0...c58d58c1 comes back identical. The inline comment has the note text.
  • Overlap with #853. It adds a new ## Overage section to admin/usage.mdx, right above the Usage emails paragraph this PR extends. A sentence about stopping overage at a chosen amount belongs in that section more than in the paragraph about emails. Whichever PR lands second should move the spending-cap sentence (line 72 here) to the end of ## Overage. The two PRs touch neighboring lines, so expect a small conflict.
  • Overlap with #774. That sentence-case sweep already conflicts with main and also touches cli/checkly-account.mdx. ### Spending Cap Examples matches its sibling ### Plan Examples, so keep it as it is. If #774 lands first, rename it to ### Spending cap examples with the rest.

Inline: 1 important, 2 wording (optional).

What I checked
  • Files read: the full diff from merge base f948c1fe for cli/checkly-account.mdx, cli/checkly-skills.mdx and admin/usage.mdx, plus the whole PR version of cli/checkly-account.mdx (page structure and sibling sections). main has not changed these files since the merge base.
  • CI and merge state: gh pr checks (all pass) and gh pr view (MERGEABLE, CLEAN). I checked open PRs on the same files and found #853 and #774.
  • CLI source (checkly-cli origin/main c58d58c1 = tag 10.3.0):
    • The account/spending-cap.ts, spending-cap/set.ts and spending-cap/remove.ts commands: flags, read-only/destructive classification, and which permission each error names.
    • helpers/spending-cap.ts: the dollar parsing (^\d+(\.\d{1,2})?$, max 10000), the preview warnings, and the 401/403/409 messages.
    • helpers/invalid-input-error.ts: invalid input exits 2.
    • commands/authCommand.ts (confirmOrAbort, exit 3) and helpers/command-preview.ts (envelope fields and order, confirmCommand drops --output/--force/--dry-run).
    • helpers/cli-mode.ts (interactive/agent/CI detection), helpers/flags.ts (-o, -f), formatters/spending-cap.ts (labels, Measured at format), and ai-context/context.ts (the manage-spending-cap resource).
  • Release: gh release view 10.3.0 and the compare/10.3.0...c58d58c1 API.
  • Backend (checkly monorepo main 2c87c611c9): the public spending-cap routes require self-serve plan management. Setting a cap on a plan that cannot hold one returns 409. The API caps the amount at 1,000,000 cents, which matches the CLI's $10000. The permissions page on main lists billing:read and billing:update.
  • End-to-end: not run. The local app did not come up within 5 minutes, so I stopped it and verified against source instead. The dry-run envelope and exit codes come from the source, backed by the CLI's unit tests for exit 2 and for --dry-run exiting 0. None of it comes from a live run.
  • Could not verify: that Status appears only when a cap is set. The formatter shows it whenever the API returns a limit for the account, and I did not trace when the backend does that.

Comment thread cli/checkly-account.mdx

## `checkly account spending-cap`

Show the overage spending cap: the most your account may spend on check runs beyond what your plan includes. When the overage reaches the cap, checks stop running.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important · The spending-cap commands first shipped in CLI 10.3.0, but the only version note on this page says v7.7.0. Someone on 10.2 who follows this section gets an unknown-command error. CLI command pages start a newly added command with an "Available since" note.

Suggested change
Show the overage spending cap: the most your account may spend on check runs beyond what your plan includes. When the overage reaches the cap, checks stop running.
<Note>Available since CLI v10.3.0.</Note>
Show the overage spending cap: the most your account may spend on check runs beyond what your plan includes. When the overage reaches the cap, checks stop running.

Comment thread cli/checkly-account.mdx

The default view shows:

- **Spending cap**: the cap in US dollars, or `No cap`.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wording (optional) · A cap of 0 prints $0.00 (no overage allowed) (formatters/spending-cap.ts). That is worth showing, since the set section tells readers 0 is a valid cap.

Suggested change
- **Spending cap**: the cap in US dollars, or `No cap`.
- **Spending cap**: the cap in US dollars, `$0.00 (no overage allowed)` for a cap of `0`, or `No cap`.

Comment thread cli/checkly-account.mdx
- **Spending cap**: the cap in US dollars, or `No cap`.
- **Overage so far**: the overage measured so far. It shows `Not measured` when the runs are not measured yet or the plan has no overage. This does not mean $0.00 of overage.
- **Status**: `Under the cap`, `Close to the cap (from $X)`, or `Cap reached`. It is only shown when a cap is set.
- **Checks stopped**: `Yes` when the cap is reached.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wording (optional) · The CLI prints Yes, the spending cap is reached here, not just Yes (formatters/spending-cap.ts). Quote the full value so readers who search the output find it.

Suggested change
- **Checks stopped**: `Yes` when the cap is reached.
- **Checks stopped**: `No`, or `Yes, the spending cap is reached`.

This branch was successfully deployed

1 active deployment
staging — c6249021 Deployed Nov 23, 2026 by mintlify[bot]
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.

2 participants