# Vercel CLI

> Helps the agent interact with Vercel CLI to manage deployments, check build/runtime logs, pull environment variables, and inspect deployment status.

- Skill: `laplusdestiny/vercel-cli` (Agent Skill)
- Install (CLI): `npx skillmds@latest add laplusdestiny/vercel-cli`
- Raw SKILL.md: https://api.skillmd.com/api/skills/laplusdestiny/vercel-cli/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: Laplusdestiny (https://skillmd.com/u/laplusdestiny)
- Updated: 2026-09-22
- Page: https://skillmd.com/skills/laplusdestiny/vercel-cli

---


# Vercel CLI Skill

This skill guides the agent through interacting with Vercel CLI to deploy projects, monitor deployment status, and retrieve logs (especially when a deployment fails).

## Use this skill when
- The user requests Vercel-related tasks, such as:
  - Deploying the project to preview or production environments.
  - Retrieving logs for a deployment (either build logs or runtime request logs).
  - Checking the status or details of recent deployments.
  - Pulling environment variables from Vercel to local `.env` files.
  - Linking the local project to a Vercel project.

## Do not use this skill when
- The task does not involve Vercel hosting, deployment, or Vercel configurations.

## Instructions

### 1. Linking and Pulling Environment Variables
- To link the local repository to a Vercel project or pull the latest cloud settings:
  - Run `vercel link` to link the directory.
  - Run `vercel pull` to sync settings and download environment variables:
    ```bash
    vercel pull --yes
    ```
    *(Use `--yes` or `--non-interactive` flags where appropriate to skip prompts in the agent environment).*

### 2. Checking Deployments and Status
- To list recent deployments and check their status (e.g., `Ready`, `Error`, `Building`):
  ```bash
  vercel ls
  ```
- To inspect a specific deployment by URL or deployment ID:
  ```bash
  vercel inspect <deployment-url-or-id>
  ```

### 3. Retrieving Logs for Failed Deployments (CRITICAL)

#### A. Build Failures (Error during deployment/build phase)
- If a preview or production deployment fails during the build phase (status is `Error` in `vercel ls`), fetch the **build logs**:
  ```bash
  vercel inspect <deployment-url-or-id> --logs
  ```
- This prints the full build compilation logs, which is essential for diagnosing Next.js build errors, TypeScript errors, or missing dependencies.

#### B. Runtime Failures (Error during app execution)
- If the deployment succeeded (status is `Ready`) but the application returns errors at runtime (e.g., 500 Internal Server Error):
  - Display recent runtime request/serverless logs:
    ```bash
    vercel logs <deployment-url-or-id>
    ```
  - To retrieve only error logs:
    ```bash
    vercel logs <deployment-url-or-id> --level error
    ```
  - To fetch logs with full details (expanded):
    ```bash
    vercel logs <deployment-url-or-id> --expand
    ```
  - To filter logs by status code (e.g., 5xx):
    ```bash
    vercel logs <deployment-url-or-id> --status-code 500
    ```

### 4. Deploying the Project
- Always verify that local builds pass or check for lint errors before triggering a deployment.
- **Preview Deployment**:
  ```bash
  vercel --yes
  ```
- **Production Deployment**:
  ```bash
  vercel --prod --yes
  ```
- Always capture the deployment URL/ID returned by Vercel from the command output.

## Security & Safety Guidelines

### ⚠️ Environmental Hygiene
- **Never** commit the `.vercel` directory or `.env*.local` files generated by the CLI. Verify they are included in `.gitignore`.
- If environment variables change, remind the user to pull the latest variables locally using `vercel pull`.

