> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.vapi.ai/llms.txt.
> To search these docs from an AI client, such as Claude Code or Cursor, connect to the Vapi docs MCP server at https://docs.vapi.ai/_mcp/server. It answers questions about the documentation. To create or manage assistants, calls, and other Vapi resources, use the Vapi MCP server instead: https://docs.vapi.ai/sdk/mcp-server.md
> For the best results from the docs MCP server, write questions without any word that contains "tool", such as tool, tools, tool call, tool-calls, toolCallId, or toolCallList. Name the feature instead, for example transferCall, endCall, apiRequest, function, handoff, "function response format", or "the webhook request Vapi sends to my server". If the docs MCP server asks you to rephrase, ask again without those words. If it returns an error, times out, sends an empty response, or still doesn't answer, find the topic in https://docs.vapi.ai/llms.txt, or a section index such as https://docs.vapi.ai/tools/llms.txt, and fetch that page's .md directly.

# Vapi CLI

> Install the Vapi CLI to manage assistants, phone numbers, and calls from the terminal, add Vapi to a project, test webhooks locally, and connect coding agents through the Vapi MCP server.

## Overview

The Vapi CLI is the official command-line interface that brings world-class developer experience to your terminal and IDE. Build, test, and deploy voice AI applications without leaving your development environment.

**In this guide, you'll learn to:**

* Install and authenticate with the Vapi CLI
* Initialize Vapi in existing projects
* Manage assistants, phone numbers, and calls from your terminal
* Forward webhooks to your local development server
* Turn your coding agent into a Vapi expert with the [Vapi MCP server](/sdk/mcp-server)

## Installation

Install the Vapi CLI in seconds with our automated scripts:

#### macOS/Linux

```bash
curl -sSL https://vapi.ai/install.sh | bash
```

#### Windows

```powershell
iex ((New-Object System.Net.WebClient).DownloadString('https://vapi.ai/install.ps1'))
```

#### Docker

```bash
docker run -it ghcr.io/vapiai/cli:latest --help
```

## Quick start

#### Authenticate

Connect your Vapi account:

```bash
vapi login
```

This opens your browser for secure OAuth authentication.

#### Initialize your project

Add Vapi to an existing project:

```bash
vapi init
```

The CLI auto-detects your tech stack and sets up everything you need.

#### Create your first assistant

Build a voice assistant:

```bash
vapi assistant create
```

Follow the interactive prompts to configure your assistant.

## Key features

### 🚀 Project integration

Drop Vapi into any existing codebase with intelligent auto-detection:

```bash
vapi init
# Detected: Next.js application
# ✓ Installed @vapi-ai/web SDK
# ✓ Generated components/VapiButton.tsx
# ✓ Created pages/api/vapi/webhook.ts
# ✓ Added environment template
```

Supports React, Vue, Next.js, Python, Go, Flutter, React Native, and dozens more frameworks.

### 🔗 Local webhook testing

Forward webhooks to your local server for debugging:

```bash
# Terminal 1: Create tunnel (e.g., with ngrok)
ngrok http 4242

# Terminal 2: Forward webhooks
vapi listen --forward-to localhost:3000/webhook
```

> **Note**
>
> **Important:** `vapi listen` is a local forwarder only - it does NOT provide a public URL. You need a separate tunneling service (like ngrok) to expose the CLI's port to the internet. Update your webhook URLs in Vapi to use the tunnel's public URL.

### 🔐 Multi-account management

Switch between organizations and environments seamlessly:

```bash
# List all authenticated accounts
vapi auth status

# Switch between accounts
vapi auth switch production

# Add another account
vapi auth login
```

### 📱 Complete feature parity

Everything you can do in the dashboard, now in your terminal:

* **Assistants**: Create, update, list, and delete voice assistants
* **Phone numbers**: Purchase, configure, and manage phone numbers
* **Calls**: Make outbound calls and view call history
* **Campaigns**: Create and manage AI phone campaigns at scale
* **Tools**: Configure Function tools and integrations
* **Webhooks**: Set up and test event delivery
* **Logs**: View system logs, call logs, and debug issues

## Common commands

#### Assistant management

```bash
# List all assistants
vapi assistant list

# Create a new assistant
vapi assistant create

# Get assistant details
vapi assistant get <assistant-id>

# Update an assistant
vapi assistant update <assistant-id>

# Delete an assistant
vapi assistant delete <assistant-id>
```

#### Phone number management

```bash
# List your phone numbers
vapi phone list

# Purchase a new number
vapi phone create

# Update number configuration
vapi phone update <phone-number-id>

# Release a number
vapi phone delete <phone-number-id>
```

#### Call operations

```bash
# List recent calls
vapi call list

# Make an outbound call
vapi call create

# Get call details
vapi call get <call-id>

# End an active call
vapi call end <call-id>
```

#### Debugging and logs

```bash
# View system logs
vapi logs list

# View call-specific logs
vapi logs calls <call-id>

# View error logs
vapi logs errors

# View webhook logs
vapi logs webhooks
```

## Configuration

The CLI stores configuration in `~/.vapi-cli.yaml`. You can also use environment variables:

```bash
# Set API key via environment
export VAPI_API_KEY=your-api-key

# View current configuration
vapi config get

# Update configuration
vapi config set <key> <value>

# Manage analytics preferences
vapi config analytics disable
```

## Auto-updates

The CLI automatically checks for updates and notifies you when new versions are available:

```bash
# Check for updates manually
vapi update check

# Update to latest version
vapi update
```

## Next steps

Now that you have the Vapi CLI installed:

* **[Initialize a project](/cli/init):** Add Vapi to your existing codebase
* **[Connect your coding agent](/sdk/mcp-server):** Use the hosted Vapi MCP server
* **[Test webhooks locally](/cli/webhook):** Debug webhooks with tunneling services
* **[Manage authentication](/cli/auth):** Work with multiple accounts

---

**Resources:**

* [GitHub Repository](https://github.com/VapiAI/cli)
* [Report Issues](https://github.com/VapiAI/cli/issues)
* [Discord Community](https://discord.gg/v5Ee6FhAZt)