Repository navigation
Description
Verified against (commit SHA or released version)
commit 988c0355bb05631e9c6c1785e443937ff2a88c0e (main, v0.14.0)
Discord Username / User ID
1149447580477042769
What does this improvement do?
--dry-run is documented as a no-side-effect preview:
- global
--help: "Skip the network and credentials; emit a canned sample matching the OpenAPI contract." - DOCUMENTATION.md (Quick start): "
--dry-runis a global flag that emits a canned sample matching the API contract without writes or charges."
Every other command I tried honours that, including the sibling ci init --dry-run ("[dry-run] would write the workflow below — no files changed, no secret set"). setup, auth remove, agent install, doctor, usage and tunnel list honour it too. But ci connect and ci doctor never read --dry-run:
ci connect --project <name> --dry-runspawns the realnpx --yes vercel@59 link --project <name> --non-interactiveand thennpx --yes vercel@59 git connect --non-interactive. The command's own help lists what that does:vercel link"writes.vercel/, may add a VERCEL_OIDC_TOKEN line to.env.local, and may update.gitignore".git connectlinks the GitHub repo to the Vercel project on Vercel's side, so future pushes deploy. After all that, it printsConnected Vercel to this repo., emits JSON"connected": true, exits 0, and shows no[dry-run]banner.ci doctor --dry-runruns a livegh api repos/<repo>/deployments?per_page=100and reports the real verdict.
So a user or coding agent following the docs' advice to "run any command with --dry-run first" ends up linking a real Vercel project to their repo.
Reproduction. No Vercel or GitHub account is needed: a PATH shim logs what would have been spawned and exits 0.
mkdir -p /tmp/shim
printf '#!/bin/sh\necho "npx $*" >> /tmp/shim.log\nexit 0\n' > /tmp/shim/npx
printf '#!/bin/sh\necho "gh $*" >> /tmp/shim.log\necho "[]"\n' > /tmp/shim/gh
chmod +x /tmp/shim/npx /tmp/shim/gh
cd "$(mktemp -d)" && git init -q
PATH=/tmp/shim:$PATH testsprite ci connect --project my-app --dry-run --output json; echo "exit=$?"
PATH=/tmp/shim:$PATH testsprite ci doctor --repo acme/web --dry-run >/dev/null 2>&1
cat /tmp/shim.logActual output:
{
"platform": "vercel",
"ran": [
"npx vercel@59 link --project my-app --non-interactive",
"npx vercel@59 git connect --non-interactive"
],
"connected": true,
"alreadyConnected": false,
"reason": null
}
[info] connected. Linking only affects FUTURE pushes.
...
exit=0
npx --yes vercel@59 link --project my-app --non-interactive
npx --yes vercel@59 git connect --non-interactive
gh api repos/acme/web/deployments?per_page=100
Expected. With --dry-run, neither command spawns a subprocess. ci connect previews the commands it would run, and ci doctor previews the read it would make, each with a [dry-run] line on stderr like ci init --dry-run does.
Details / implementation notes
Root cause. In src/commands/ci.ts, runCiConnect and runCiDoctor never consult opts.dryRun. The flag is resolved (dryRun: g.dryRun ?? false in the common options) and runCiInit honours it in its // --dry-run: preview to stderr, emit the summary, and make no writes / no gh call. branch, but the two commands added alongside it in v0.13.0 skip it.
Proposed change (one file plus its spec):
runCiConnect: keep the existing--projectname validation (so a bad name still exits 5 under--dry-run). Then, whenopts.dryRunis set:- read
.vercel/project.jsonthe way it already does, to decide whetherlinkwould be needed; - print
[dry-run] would run: npx vercel@59 …for each step; - emit the summary with
ran: []andconnected: false, spawn nothing, and exit 0. - The "not linked and no
--project" refusal stays as it is, since it is a local check.
- read
runCiDoctor: whenopts.dryRunis set, skipgh, print[dry-run] would read: gh api repos/<repo>/deployments?per_page=100, and emit a summary marked as a sample, the same wayusage --dry-runlabels its canned values. If you'd rather keepci doctorout of scope, I'll limit the change toci connect, since that is the one with side effects.- Tests in
src/commands/ci.spec.ts: injectdeps.spawnas a spy and assert it is never called underdryRun: truefor connect (linked and unlinked directory) and doctor, plus that a bad--projectname still fails with exit 5 under--dry-run. Each test fails onmaintoday. - Update the
ci connect/ci doctorsections of DOCUMENTATION.md to say what--dry-runpreviews.
I'd like to work on this once it's triaged.
Confirmations
- I have searched existing issues and this is not a duplicate.
- I have provided my Discord identity above for reward coordination.
Activity
protonjls commentedon Oct 20, 2026
Closing this myself. v0.15.0 deprecated
ci doctorandci connect, and the CHANGELOG says both are removed in the next release, so a fix here would land in code that is about to be deleted (the same reason #375 and #378 were closed). Until then,ci connect --dry-runonmain(d61e6df) still runsnpx vercel link/vercel git connect, so--dry-runon that command is a real run.