@vercel/cli-exec
Helpers for locating and executing the Vercel CLI
Last updated 7 months ago by janory .
Apache-2.0 · Repository · Bugs · Original npm · Tarball · package.json
$ npm install @vercel/cli-exec 
SYNC missed versions from official npm registry.

@vercel/cli-exec

Helpers for locating and executing the Vercel CLI from other Node packages.

API

findVercelCli(options?)

Asynchronously resolves the Vercel CLI executable without running it.

Returns a Promise<VercelCliInvocation | null>.

  • Prefers the nearest node_modules/.bin/vercel
  • Falls back to the provided PATH
  • Returns null when no usable CLI installation is found

execVercelCli(args, options?)

Resolves and runs the Vercel CLI, returning:

  • stdout
  • stderr
  • invocation

It preserves access to local node_modules/.bin entries and Node itself even when the caller passes a sanitized PATH.

clearVercelCliLookupCache()

Clears cached CLI lookups. Use this when a long-lived process needs to pick up an install or uninstall that happened after an earlier resolution attempt.

VercelCliError

Thrown when resolution or execution fails. The code field is one of:

  • VERCEL_CLI_INVALID_CWD
  • VERCEL_CLI_NOT_FOUND
  • VERCEL_CLI_PERMISSION_DENIED
  • VERCEL_CLI_ERRORED
  • VERCEL_CLI_TIMED_OUT
  • VERCEL_CLI_CANCELED
  • VERCEL_CLI_SIGNALED
  • VERCEL_CLI_EXEC_FAILED

Available fields:

  • message: human-readable error message
  • code: stable machine-readable error code
  • invocation: resolved CLI command metadata when a command was selected
  • stdout: captured standard output when the child process produced output
  • stderr: captured standard error when the child process produced output
  • exitCode: numeric exit code for non-zero process exits
  • cause: original underlying error when available

Current Tags

  • 1.0.1                                ...           latest (4 months ago)

4 Versions

  • 1.0.1                                ...           4 months ago
  • 1.0.0                                ...           5 months ago
  • 0.1.1                                ...           7 months ago
  • 0.1.0                                ...           7 months ago
Maintainers (378)
Downloads
Total 17
Today 0
This Week 0
This Month 10
Last Day 0
Last Week 4
Last Month 7
Dependencies (1)
Dev Dependencies (2)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE