Skip to content

feat(cli): add upgrade paths, locations, and billing links to account plan [AI-72]#1264

Merged
thebiglabasky merged 11 commits intomainfrom
feat/account-plan-upgrade-paths
Mar 19, 2026
Merged

feat(cli): add upgrade paths, locations, and billing links to account plan [AI-72]#1264
thebiglabasky merged 11 commits intomainfrom
feat/account-plan-upgrade-paths

Conversation

@thebiglabasky
Copy link
Contributor

Summary

  • Extends checkly account plan with upgrade path info from the entitlements API (monorepo#1026)
  • REQUIRED UPGRADE column in all table views — shows what plan/addon is needed (e.g. "Team plan", "Starter plan + Communicate Starter add-on", "Contact sales")
  • Locations summary in plan header — shows available regions with count and per-check limit
  • Billing links — self-service checkout URL and enterprise contact sales URL in header and per-entitlement in JSON
  • --disabled flag — filter to only show entitlements not on your plan (composable with --type and --search)
  • Color styling — cyan labels, magenta highlight on disabled rows (only when mixed with enabled), green/magenta counts in summary
  • JSON enrichment — each disabled entitlement gets an upgradeUrl pointing to checkout or contact sales depending on plan type
  • All new API fields are optional — graceful degradation when API hasn't been updated

Details

New types: RequiredAddon, Location, AccountLocations + extended Entitlement and AccountPlan

New helpers: formatUpgradePath(), formatLocations(), getEntitlementUpgradeUrl(), upgradeLabel(), highlightDisabledRows()

Files changed:

  • src/rest/entitlements.ts — types
  • src/formatters/account-plan.ts — formatters + helpers
  • src/commands/account/plan.ts--disabled flag, URL construction, JSON enrichment

Test plan

  • 20 unit tests (formatters) — all passing
  • 101 command metadata tests — all passing
  • 6 new e2e tests (upgrade column, billing link, JSON URLs, --disabled flag, --disabled + --type, key + --disabled conflict)
  • TypeScript clean, ESLint clean
  • Manual testing against local API with updated entitlements endpoint
  • E2E tests require live API with upgrade path fields deployed

🤖 Generated with Claude Code

thebiglabasky and others added 11 commits March 18, 2026 20:17
…lan formatters

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…nt plan

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Deduplicate REQUIRED UPGRADE column definition into a shared
  `upgradeColumn` constant used by all three table types
- Extract `getAccountAppUrl()` to rest/api.ts as a shared utility
  for constructing account-scoped app URLs (same base URL pattern
  as getTestSessionUrl in reporters/util.ts)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…de path

Disabled entitlements with no requiredPlan/requiredAddon now show
"Contact sales" in the REQUIRED UPGRADE column and link to
checklyhq.com/contact-sales instead of the billing checkout page.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Plan header now shows both links:
- Self-service upgrade: billing checkout URL
- For Enterprise: checklyhq.com/contact-sales/

Detail view uses contact sales URL for CONTRACT entitlements.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Cyan bold labels for Plan, Locations, Add-ons, Metered entitlements
- Magenta highlight on full rows for disabled entitlements in tables
- Green/magenta bold counts in the summary line
- Dim location names for subtlety
- Hardcode production URL (https://app.checklyhq.com) instead of
  deriving from API base URL
- Remove unused getAccountAppUrl from api.ts

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Each disabled entitlement now includes an upgradeUrl field in JSON:
- Self-serve features: billing checkout URL
- Enterprise/CONTRACT features: contact sales URL
- Enabled features: no upgradeUrl (clean)

Top-level JSON also includes both upgradeUrl and contactSalesUrl.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Extract shared getEntitlementUpgradeUrl() from formatter, used by
  both detail view and JSON enrichment (was duplicated)
- Export CONTACT_SALES_URL from formatter, remove duplicate in command
- Rename top-level JSON key from upgradeUrl to checkoutUrl for clarity
- Simplify withUpgradeUrl to delegate to shared function

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Contributor

@MichaelHogers MichaelHogers left a comment

Choose a reason for hiding this comment

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

it works for me, i didn't look closely into the rendering code since it is mostly rendering and i don't have the time atm, tested the CLI locally and it functioned well

@thebiglabasky thebiglabasky merged commit a0c39b4 into main Mar 19, 2026
4 checks passed
@thebiglabasky thebiglabasky deleted the feat/account-plan-upgrade-paths branch March 19, 2026 13:18
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