# @vercel/cli-exec

> Helpers for locating and executing the Vercel CLI

Latest version **1.0.1** (published 2026-08-03) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @vercel/cli-exec
pnpm add @vercel/cli-exec
yarn add @vercel/cli-exec
bun add @vercel/cli-exec
```

## Health

**Score 75/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; recently updated; high maintenance score; high quality score; popular repo.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2026-08-03 |
| First published | 2026-05-09 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >= 18 |
| Dependencies | 1 |
| Unpacked size | 130.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 16373 |
| Maintainers | matheuss, matt.straka, vercel-release-bot, zeit-bot |

## Links

- npm: https://www.npmjs.com/package/@vercel/cli-exec
- Repository: https://github.com/vercel/vercel
- Homepage: https://vercel.com
- Issues: https://github.com/vercel/vercel/issues
- npm.io page: https://npm.io/package/@vercel/cli-exec

## Dependencies (1)

- [execa](https://npm.io/package/execa.md) 5.1.1

## Recent versions

- 1.0.1 (latest) — 2026-08-03
- 1.0.0 — 2026-06-18
- 0.1.1 — 2026-05-09
- 0.1.0 — 2026-05-09

## README

# `@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

---
_Source: https://npm.io/package/@vercel/cli-exec · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
