Skip to content

feat: add upgrade and billing commands - #17

Merged
facundofarias merged 2 commits into
mainfrom
feat/upgrade-billing-commands
Oct 28, 2026
Merged

facundofarias merged 2 commits into
mainfrom
feat/upgrade-billing-commands

Conversation

@facundofarias

@facundofarias facundofarias commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

Why

The API now lets a live secret key start a Stripe checkout and open the billing portal (pixelvault-dev/pixelvault#323, deployed). The CLI had usage and keys but no way to upgrade, so an agent in a terminal still had to open the dashboard.

What

  • pixelvault upgrade <starter|pro> [--json] → POST /v1/billing/checkout, prints the Stripe Checkout URL.
  • pixelvault billing [--json] → POST /v1/billing/portal, prints the portal URL.
  • Output contract kept: URL/JSON on stdout, guidance on stderr, so URL=$(pixelvault upgrade pro) works.
  • Nothing is charged by either command; a person opens the URL and pays. The plan changes after Stripe confirms, so the hint points at pixelvault usage.
  • Errors mapped to actionable messages: test_key_forbidden, publishable_key_forbidden, email_not_verified, already_subscribed, no_subscription, billing_unavailable, rate_limit_exceeded (with Retry-After).
  • README: command table + "Upgrade and billing" section.

Not in this PR

No version bump or tag. Release flow is bump package.json + VERSION, then tag vX.Y.Z; the skill doc update should land only after this is published to npm.

Test plan

  • typecheck, build, 68 tests (new tests/commands/upgrade-billing.test.ts, fetch mocked)
  • Against production with a real pv_live_ key: pixelvault upgrade starter prints a checkout.stripe.com URL; with a pv_test_ key it fails with the live-key message

🤖 Generated with Claude Code

facundofarias and others added 2 commits October 28, 2026 09:51
`pixelvault upgrade <starter|pro>` prints a Stripe Checkout URL and
`pixelvault billing` prints a billing-portal URL, using the API's new
key-authenticated POST /v1/billing/checkout and /portal (live secret key only).
URL goes to stdout, guidance to stderr, --json prints { url }. Known API errors
(test/publishable key, unverified email, already subscribed, no subscription,
unavailable, rate limit) map to actionable messages.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@facundofarias
facundofarias merged commit bd1afa9 into main Oct 28, 2026
2 checks passed
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