[cli] Add --plan flag to vercel integration add#14965
Merged
Conversation
🦋 Changeset detectedLatest commit: bb8731e The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Contributor
📦 CLI Tarball ReadyThe Vercel CLI tarball for this PR is now available! Quick TestYou can test this PR's CLI directly by running: npx https://vercel-1hgh97tpb.vercel.sh/tarballs/vercel.tgz --helpUse in vercel.jsonTo use this CLI version in your project builds, add to your {
"build": {
"env": {
"VERCEL_CLI_VERSION": "vercel@https://vercel-1hgh97tpb.vercel.sh/tarballs/vercel.tgz"
}
}
} |
Contributor
🧪 Unit Test StrategyComparing: Strategy: Affected packages only ✅ Only testing packages that have been modified or depend on modified packages. Affected packages - 1 (3%)
Unaffected packages - 39 (98%)
Results
This comment is automatically generated based on the affected testing strategy |
30f7b8c to
7e196df
Compare
7e196df to
7a8b38e
Compare
7a8b38e to
0cd0f2d
Compare
0cd0f2d to
bd1e069
Compare
dvoytenko
approved these changes
Feb 10, 2026
Allow users to specify a billing plan ID when adding marketplace integrations via `vercel integration add --plan <id>`. This enables provisioning integrations that have no free plan without falling back to the browser checkout. - Add --plan/-p option to integration add subcommand - Thread billingPlanId through auto-provision and old CLI paths - Skip interactive plan selection when --plan is provided - Append planId to web UI fallback URL for plan preselection - Add tests for --plan flag in auto-provision request body Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
bd1e069 to
bb8731e
Compare
Merged
tknickman
pushed a commit
that referenced
this pull request
Feb 12, 2026
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## @vercel/build-utils@13.4.0 ### Minor Changes - [services] synchronize dependencies in dev mode for JS/TS and Python services ([#14987](#14987)) ### Patch Changes - Add new expirementalTrigger format for queues v2beta ([#14970](#14970)) - Updated dependencies \[[`a960cf23a42ff1a570c808ee9567670c24422f98`](a960cf2)]: - @vercel/python-analysis@0.4.1 ## vercel@50.16.0 ### Minor Changes - [services] synchronize dependencies in dev mode for JS/TS and Python services ([#14987](#14987)) - Add `contract` cli cmd for checking contract commitments ([#14735](#14735)) - Add `usage` command to check billing and usage information ([#14733](#14733)) ### Patch Changes - Add `--plan` flag to `vercel integration add` for specifying a billing plan ID ([#14965](#14965)) - Include the current Vercel CLI version in `.vercel/output/builds.json` generated by `vercel build`. ([#14999](#14999)) - Fixed deployment rate limit error message displaying incorrect retry time ([#14947](#14947)) - [services] services dev server orchestrator framework fallback fix ([#14985](#14985)) - Add new expirementalTrigger format for queues v2beta ([#14970](#14970)) - non-interactive mode for link - selectOrg ([#15003](#15003)) - non-interactive mode for link ([#15001](#15001)) - Remove tags column from `integration discover` table and compact terminal views to reduce width on small screens. Tags remain available in JSON output. ([#15000](#15000)) - non-interactive mode for link - enable for agents ([#15002](#15002)) - Add `--breakdown` option to `vercel usage` for viewing usage broken down by period ([#14741](#14741)) - Updated dependencies \[[`8f2c79045858cd41fa89522ee13f2ce5d6c81be1`](8f2c790), [`2686071de8e17161babea397fcd12226de8ecce9`](2686071), [`a960cf23a42ff1a570c808ee9567670c24422f98`](a960cf2)]: - @vercel/build-utils@13.4.0 - @vercel/python@6.12.0 - @vercel/backends@0.0.33 - @vercel/elysia@0.1.36 - @vercel/express@0.1.45 - @vercel/fastify@0.1.39 - @vercel/go@3.4.0 - @vercel/h3@0.1.45 - @vercel/hono@0.2.39 - @vercel/hydrogen@1.3.5 - @vercel/koa@0.1.19 - @vercel/nestjs@0.2.40 - @vercel/next@4.15.28 - @vercel/node@5.6.3 - @vercel/redwood@2.4.9 - @vercel/remix-builder@5.5.10 - @vercel/ruby@2.3.0 - @vercel/rust@1.0.5 - @vercel/static-build@2.8.37 ## @vercel/python@6.12.0 ### Minor Changes - [services] synchronize dependencies in dev mode for JS/TS and Python services ([#14987](#14987)) ### Patch Changes - log contents of malformed manifests ([#15019](#15019)) - Updated dependencies \[[`a960cf23a42ff1a570c808ee9567670c24422f98`](a960cf2)]: - @vercel/python-analysis@0.4.1 ## @vercel/backends@0.0.33 ### Patch Changes - Updated dependencies \[[`8f2c79045858cd41fa89522ee13f2ce5d6c81be1`](8f2c790), [`2686071de8e17161babea397fcd12226de8ecce9`](2686071)]: - @vercel/build-utils@13.4.0 ## @vercel/cervel@0.0.20 ### Patch Changes - Updated dependencies \[]: - @vercel/backends@0.0.33 ## @vercel/client@17.2.40 ### Patch Changes - Updated dependencies \[[`8f2c79045858cd41fa89522ee13f2ce5d6c81be1`](8f2c790), [`2686071de8e17161babea397fcd12226de8ecce9`](2686071)]: - @vercel/build-utils@13.4.0 ## @vercel/config@0.0.30 ### Patch Changes - Add new expirementalTrigger format for queues v2beta ([#14970](#14970)) ## @vercel/elysia@0.1.36 ### Patch Changes - Updated dependencies \[]: - @vercel/node@5.6.3 ## @vercel/express@0.1.45 ### Patch Changes - Updated dependencies \[]: - @vercel/node@5.6.3 - @vercel/cervel@0.0.20 ## @vercel/fastify@0.1.39 ### Patch Changes - Updated dependencies \[]: - @vercel/node@5.6.3 ## @vercel/gatsby-plugin-vercel-builder@2.0.135 ### Patch Changes - Updated dependencies \[[`8f2c79045858cd41fa89522ee13f2ce5d6c81be1`](8f2c790), [`2686071de8e17161babea397fcd12226de8ecce9`](2686071)]: - @vercel/build-utils@13.4.0 ## @vercel/h3@0.1.45 ### Patch Changes - Updated dependencies \[]: - @vercel/node@5.6.3 ## @vercel/hono@0.2.39 ### Patch Changes - Updated dependencies \[]: - @vercel/node@5.6.3 ## @vercel/koa@0.1.19 ### Patch Changes - Updated dependencies \[]: - @vercel/node@5.6.3 ## @vercel/mcp-adapter@0.3.2 ### Patch Changes - Fix .repository field in package.json to make it possible to publish ([#14997](#14997)) ## @vercel/nestjs@0.2.40 ### Patch Changes - Updated dependencies \[]: - @vercel/node@5.6.3 ## @vercel/node@5.6.3 ### Patch Changes - Updated dependencies \[[`8f2c79045858cd41fa89522ee13f2ce5d6c81be1`](8f2c790), [`2686071de8e17161babea397fcd12226de8ecce9`](2686071)]: - @vercel/build-utils@13.4.0 ## @vercel/python-analysis@0.4.1 ### Patch Changes - log contents of malformed manifests ([#15019](#15019)) ## @vercel/static-build@2.8.37 ### Patch Changes - Updated dependencies \[]: - @vercel/gatsby-plugin-vercel-builder@2.0.135 ## @vercel/python-runtime@0.4.0 ### Minor Changes - Install \_runtime_requirements.txt during lambda execution if provided. ([#15011](#15011)) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
tonypan2
added a commit
that referenced
this pull request
Feb 19, 2026
…15152) ## Summary - When a user interactively selects a non-subscription billing plan in `vercel integration add`, the web checkout fallback was passing `billingPlanId` (the raw `--plan` flag, `undefined` when not passed) instead of `billingPlan.id` (the actually-selected plan) - This meant the Vercel Dashboard checkout wouldn't pre-select the plan the user just chose in the CLI ## Root cause Introduced in #14965 ("Add --plan flag to vercel integration add"). When threading `billingPlanId` through the non-subscription web fallback in `provisionResourceViaCLI`, the wrong variable was passed: ```ts // Before (bug): passes raw --plan flag value, undefined when not provided provisionResourceViaWebUI(..., billingPlanId); // After (fix): passes the plan the user actually selected provisionResourceViaWebUI(..., billingPlan.id); ``` **Why TypeScript didn't catch it:** Both `billingPlanId` (`flags['--plan']`) and `billingPlan.id` are `string | undefined`, so the type checker sees them as interchangeable. **Why the existing unit test didn't catch it:** The test at `add.test.ts:1399` only exercises `--plan pro` (explicit flag), where `billingPlanId === billingPlan.id`. There was no test for the interactive selection path (no `--plan` flag) where `billingPlanId` is `undefined` but `billingPlan.id` is the selected plan. | Scenario | `billingPlanId` | `billingPlan.id` | Bug visible? | |---|---|---|---| | `--plan pro` (tested) | `"pro"` | `"pro"` | No — same value | | Interactive selection (untested) | `undefined` | `"pro"` | **Yes** — `planId` param missing from URL | ## Test plan ### Unit tests ``` $ cd packages/cli && pnpm vitest run test/unit/commands/integration/add.test.ts ✓ test/unit/commands/integration/add.test.ts (75 tests) 4284ms Test Files 1 passed (1) Tests 75 passed (75) ``` New test added: "should include planId in web UI URL for non-subscription plan selected interactively" - Exercises the interactive billing plan selection with `acme-prepayment` (no `--plan` flag) - Asserts `planId=pro` is present in the URL passed to `open()` - **On main (without fix):** fails with `expected null to deeply equal 'pro'` — confirms the bug - **With fix:** passes — `planId=pro` present in URL ### Manual testing The non-subscription billing plan → web fallback path is **unit-only** because no available real integration has prepayment-type plans on the test team. Verified by testing: - **Prisma** (`vc integration add prisma --scope team_ZrswwWlkgu3cRre7Tk7Rr0HV`): has billing plans (Free, Starter, Pro, Business) but all are `subscription` type → goes to CLI provisioning, never hits the web fallback - **Upstash** (`vc integration add upstash/upstash-kv --scope team_ZrswwWlkgu3cRre7Tk7Rr0HV`): unsupported wizard → browser fallback (different code path, no billing plan selection) - **Neon** (`vc integration add neon --scope team_ZrswwWlkgu3cRre7Tk7Rr0HV`): unsupported wizard → browser fallback (different code path) ### Code paths covered | Path | Verified by | |---|---| | Interactive plan selection → non-subscription → web fallback (the bug) | Unit test (new) | | `--plan` flag → non-subscription → web fallback (regression) | Unit test (existing, line 1399) | | Interactive plan selection → subscription → CLI provisioning | Manual (prisma) | | Unsupported wizard → browser fallback | Manual (neon, upstash) | 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- VADE_RISK_START --> > [!NOTE] > Low Risk Change > > Simple bug fix changing a variable reference from `billingPlanId` to `billingPlan.id` to pass the correct plan ID, with corresponding test coverage added. > > - Single-line fix: passes `billingPlan.id` instead of `billingPlanId` in web fallback > - Adds unit test for interactive plan selection path > > <sup>Risk assessment for [commit ebed50f](https://github.com/vercel/vercel/commit/ebed50f138e91c47e5fc2d552846d2e6a7807fc6).</sup> <!-- VADE_RISK_END --> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
3 tasks
qiao
added a commit
that referenced
this pull request
Mar 13, 2026
## Summary https://linear.app/vercel/issue/MKT-2932/pre-fill-web-fallback-ui-with-environment-and-prefix-is-these-flags When `integration add` falls back to the browser (unsupported product, non-subscription billing plan, or auto-provision 422), the `--environment` flag was being dropped. This threads it through as an `environment` query param so the checkout page can pre-select the correct environments. - `add.ts`: pass `environments` to `provisionResourceViaWebUI` and append to URL - `add-auto-provision.ts`: append `environment` param to fallback URL - Tests for all three fallback scenarios ## Related PRs Follows the same pattern established by: - #14965 (`--plan` → `planId` in fallback URLs) - #14868 (`source=cli` + `defaultResourceName` in fallback URLs) ## Test plan - [x] Unit test: auto-provision fallback includes `environment` param - [x] Unit test: unsupported product web UI includes `environment` param - [x] Unit test: non-subscription plan web UI includes `environment` param
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
--plan/-poption tovercel integration addcommandbillingPlanIdthrough all code paths:--planmatches, error with available plans list if not foundvercel integration add <slug> --helpshows available billing plans with IDs and pricingtrackCliOptionPlan--planusage example to command helpDynamic help output
Dependent PRs
This is part 2 of 3 — the full
--planfeature spans three repos:billingPlanIdin auto-provision endpoint body (must deploy first due toadditionalProperties: falsein body schema)planIdURL query paramTest plan
--planincluded in request body,-pshorthand,planIdin fallback URLbillingPlanIdthreaded through policy acceptance retry-pshorthandplanIdin web UI URL (missing installation + non-subscription fallback)formatBillingPlansHelpunit tests (alignment, disabled filtering, empty plans, no-cost plans)pnpm --filter vercel test add-auto-provisionFF_AUTO_PROVISION_INSTALL=1 vercel integration add upstash/upstash-kv --plan paidvercel integration add upstash/upstash-kv --helpshows billing plansvercel integration add --helpshows--planoption🤖 Generated with Claude Code
Note
Low Risk Change
This PR adds a new --plan CLI flag to pass billing plan IDs through API requests and URLs, which is a feature addition that threads data through existing code paths without modifying authorization or validation logic.
Risk assessment for commit bb8731e.