Add vc link add subcommand to append projects to existing repo.json#14968
Conversation
🦋 Changeset detectedLatest commit: 229593d 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 |
This stack of pull requests is managed by Graphite. Learn more about stacking. |
📦 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-n4rqd6nht.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-n4rqd6nht.vercel.sh/tarballs/vercel.tgz"
}
}
} |
🧪 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 |
There was a problem hiding this comment.
Pull request overview
Adds a new vc link add subcommand to extend an existing repository link (.vercel/repo.json) by discovering additional Vercel Projects and merging them into the existing config without overwriting prior entries.
Changes:
- Introduces
vc link addsubcommand wiring (help/telemetry/arg parsing) and CLI help updates. - Refactors repo-linking logic into a shared project discovery routine and adds
addRepoLink()to append projects to existingrepo.json. - Adds unit tests for the new subcommand behavior and a changeset for release notes.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/cli/src/commands/link/index.ts | Adds subcommand detection/dispatch for link add, updates --help exit code handling. |
| packages/cli/src/commands/link/command.ts | Defines add subcommand metadata (options/examples) and attaches it to link. |
| packages/cli/src/util/link/repo.ts | Extracts shared discovery flow and adds addRepoLink() to merge projects into existing repo.json. |
| packages/cli/src/util/telemetry/commands/link/index.ts | Adds telemetry method for link add subcommand usage. |
| packages/cli/test/unit/commands/link/index.test.ts | Updates help exit code expectation and adds tests for link add. |
| .changeset/olive-waves-worry.md | Declares a minor release for the new subcommand. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
a7dfcdf to
787283c
Compare
Merge activity
|
Allows adding additional Vercel Projects to an already-linked repository without overwriting previously linked projects. Filters out both API projects and locally-detected projects whose directories are already covered by existing entries in `repo.json`.
…ory filtering, error handling, and prompt text
efdf6f9 to
229593d
Compare

Allows adding additional Vercel Projects to an already-linked repository without overwriting previously linked projects. Filters out both API projects and locally-detected projects whose directories are already covered by existing entries in
repo.json.Note
Low Risk Change
This PR adds a new
vc link addCLI subcommand to append projects to existing repo.json, consisting of command definition, argument parsing, refactored project discovery logic, and comprehensive tests.addsubcommand with command definition and argument parsingdiscoverRepoProjectsfunction extracted fromensureRepoLinkfor shared useRisk assessment for commit 229593d.