Skip to content

CLI: non-interactive ensureLink#15004

Merged
brookemosby merged 20 commits intomainfrom
brookemosby/cli-116-non-interactive-pr4
Feb 12, 2026
Merged

CLI: non-interactive ensureLink#15004
brookemosby merged 20 commits intomainfrom
brookemosby/cli-116-non-interactive-pr4

Conversation

@brookemosby
Copy link
Copy Markdown
Contributor

@brookemosby brookemosby commented Feb 11, 2026

When non-interactive and linking requires confirmation or project selection, ensureLink/setupAndLink now return HEADLESS and output JSON action_required (confirmation_required), with coverage in ensureLink tests.

Note

Low Risk Change

CLI changes add non-interactive mode handling that throws errors or returns early when confirmation is needed, which is defensive behavior that prevents unintended actions without explicit confirmation.

  • Adds HEADLESS error throw in inputProject when client.nonInteractive is true
  • Modifies setup-and-link to handle nonInteractive flag and return error status when prompts needed
  • Adds comprehensive unit tests for ensureLink non-interactive behavior

Risk assessment for commit 0b9e8aa.

Co-authored-by: Cursor <cursoragent@cursor.com>
@brookemosby brookemosby requested review from a team as code owners February 11, 2026 18:48
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Feb 11, 2026

🦋 Changeset detected

Latest commit: 0b9e8aa

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
vercel Patch

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 11, 2026

📦 CLI Tarball Ready

The Vercel CLI tarball for this PR is now available!

Quick Test

You can test this PR's CLI directly by running:

npx https://vercel-mzfpkji1b.vercel.sh/tarballs/vercel.tgz --help

Use in vercel.json

To use this CLI version in your project builds, add to your vercel.json:

{
  "build": {
    "env": {
      "VERCEL_CLI_VERSION": "vercel@https://vercel-mzfpkji1b.vercel.sh/tarballs/vercel.tgz"
    }
  }
}

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 11, 2026

🧪 Unit Test Strategy

Comparing: 9b20cb90b9e8aa (view diff)

Strategy: Affected packages only

✅ Only testing packages that have been modified or depend on modified packages.

Affected packages - 1 (3%)
  1. vercel
Unaffected packages - 39 (98%)
  1. @vercel-internals/get-package-json
  2. @vercel/backends
  3. @vercel/build-utils
  4. @vercel/cervel
  5. @vercel/cli-auth
  6. @vercel/client
  7. @vercel/config
  8. @vercel/detect-agent
  9. @vercel/edge
  10. @vercel/elysia
  11. @vercel/error-utils
  12. @vercel/express
  13. @vercel/fastify
  14. @vercel/firewall
  15. @vercel/frameworks
  16. @vercel/fs-detectors
  17. @vercel/functions
  18. @vercel/gatsby-plugin-vercel-builder
  19. @vercel/go
  20. @vercel/h3
  21. @vercel/hono
  22. @vercel/hydrogen
  23. @vercel/koa
  24. @vercel/nestjs
  25. @vercel/next
  26. @vercel/node
  27. @vercel/oidc
  28. @vercel/oidc-aws-credentials-provider
  29. @vercel/python
  30. @vercel/python-analysis
  31. @vercel/redwood
  32. @vercel/related-projects
  33. @vercel/remix-builder
  34. @vercel/routing-utils
  35. @vercel/ruby
  36. @vercel/rust
  37. @vercel/static-build
  38. @vercel/static-config
  39. examples

Results

  • Unit tests: Only affected packages will run unit tests
  • E2E tests: Running in parallel via E2E Tests workflow
  • Type checks: Only affected packages will run type checks

This comment is automatically generated based on the affected testing strategy

brookemosby and others added 3 commits February 11, 2026 11:56
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@brookemosby brookemosby force-pushed the brookemosby/cli-116-non-interactive-pr4 branch from 84fb6af to 89de5de Compare February 11, 2026 18:56
@brookemosby brookemosby requested review from a team and codywong February 12, 2026 16:45
@brookemosby brookemosby merged commit b3fbe81 into main Feb 12, 2026
224 of 227 checks passed
@brookemosby brookemosby deleted the brookemosby/cli-116-non-interactive-pr4 branch February 12, 2026 18:00
)} requires confirmation. Use option ${param('--yes')} to confirm.`
);
if (nonInteractive) {
outputActionRequired(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this already calls exit so don't need to call again @ line80

): Promise<ProjectLinked | number> {
let { link } = opts;
// All commands respect global --non-interactive; link can override via opts
const nonInteractive = opts.nonInteractive ?? client.nonInteractive ?? false;
Copy link
Copy Markdown
Contributor

@codywong codywong Feb 12, 2026

Choose a reason for hiding this comment

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

outputActionRequired short-circuits on !client.nonInteractive

Is it possible to have opts.nonInteractive === true but client.nonInteractive === false

If so, currently we no-op?

nonInteractive ||
(await client.input.confirm(
`${setupMsg} ${chalk.cyan(`“${toHumanPath(path)}”`)}?`,
true
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Re: line +124]

does this need some nonInteractive handling too?

See this comment inline on Graphite.

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.

3 participants