README
ΒΆ
Vapi CLI
The official command-line interface for Vapi - Voice AI for developers.
Features
- π Authentication Management - Secure OAuth login, logout, and account switching
- π€ Assistant Management - List, create, update, and delete voice assistants
- π¬ Chat Management - Text-based conversations and chat history
- π Enhanced Call Management - Full call lifecycle control and monitoring
- π± Phone Number Management - Purchase, configure, and manage phone numbers
- π Workflow Management - Manage visual conversation flows and branching logic
- π£ Campaign Management - Create and manage AI phone call campaigns at scale
- π οΈ Tool Management - Custom functions and API integrations
- π Webhook Management - Configure and manage real-time event delivery
- π§ Webhook Testing - Local webhook forwarding without ngrok
- π Logs & Debugging - System logs, call logs, and error tracking
- π§ Project Integration - Auto-detect and integrate with existing projects
- π Framework Support - React, Vue, Angular, Next.js, Node.js, Python, Go, and more
- π¦ SDK Installation - Automatic SDK setup for your project type
- π¨ Code Generation - Generate components, hooks, and examples
- β¬οΈ Auto-Updates - Keep your CLI up-to-date with the latest features
Installation
Unix/Linux/macOS
curl -sSL https://vapi.ai/install.sh | bash
Windows
iex ((New-Object System.Net.WebClient).DownloadString('https://vapi.ai/install.ps1'))
Both scripts automatically detect your platform and install the latest version.
Docker
# Run directly
docker run -it ghcr.io/vapiai/cli:latest --help
# Or with persistent config
docker run -it -v ~/.vapi-cli.yaml:/home/vapi/.vapi-cli.yaml ghcr.io/vapiai/cli:latest assistant list
Manual Download
Download pre-built binaries from GitHub Releases:
# macOS/Linux
curl -sSL https://github.com/VapiAI/cli/releases/latest/download/cli_$(uname -s)_$(uname -m).tar.gz | tar xz
sudo mv vapi /usr/local/bin
# Or download specific version
curl -sSL https://github.com/VapiAI/cli/releases/download/v0.0.6/cli_Darwin_arm64.tar.gz | tar xz
From Source
# Clone the repository
git clone https://github.com/VapiAI/cli.git
cd cli
# Install dependencies
make deps
# Build the CLI
make build
# Install to ~/.local/bin
make install
Development Requirements
-
Go 1.21+ - Install Go
-
golangci-lint - For code linting
# macOS brew install golangci-lint # Linux/Windows go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
Usage
Authentication
First, authenticate with your Vapi account:
vapi login
This will open your browser for secure authentication. Your API key will be saved locally.
Managing Authentication
For users who work with multiple organizations or need to switch accounts:
# Check current authentication status and list all accounts
vapi auth status
# Switch between multiple authenticated accounts
vapi auth switch [account-name]
# View current API key and source
vapi auth token
# View current user and organization info
vapi auth whoami
# Add another account (keeping existing ones)
vapi auth login
# Logout from current account
vapi auth logout
# Logout from all accounts
vapi auth logout --all
The CLI supports multiple accounts simultaneously, similar to GitHub CLI. This is perfect for:
- Working with multiple Vapi organizations
- Switching between production and staging environments
- Managing different client accounts
- Team collaboration with role-specific access
Assistant Management
# List all assistants
vapi assistant list
# Get assistant details
vapi assistant get <assistant-id>
# Create a new assistant (interactive)
vapi assistant create
# Delete an assistant
vapi assistant delete <assistant-id>
Workflow Management
# List all workflows
vapi workflow list
# Get workflow details
vapi workflow get <workflow-id>
# Create a new workflow (basic)
vapi workflow create
# Delete a workflow
vapi workflow delete <workflow-id>
Note: For visual workflow building with nodes and edges, use the Vapi Dashboard.
Campaign Management
# List all campaigns
vapi campaign list
# Get campaign details
vapi campaign get <campaign-id>
# Create a new campaign
vapi campaign create
# Update/end a campaign
vapi campaign update <campaign-id>
# Delete a campaign
vapi campaign delete <campaign-id>
Note: For advanced campaign features (customer lists, scheduling), use the Vapi Dashboard.
Project Integration
Initialize Vapi in your existing project:
# Auto-detect project type and set up Vapi
vapi init
# Initialize in a specific directory
vapi init /path/to/project
The init command will:
- Detect your project framework/language
- Install the appropriate Vapi SDK
- Generate example code and components
- Create environment configuration templates
MCP Integration - Turn Your IDE into a Vapi Expert
Set up Model Context Protocol (MCP) integration to give your IDE's AI assistant complete knowledge about Vapi:
# Auto-detect and configure all IDEs
vapi mcp setup
# Configure a specific IDE
vapi mcp setup cursor # For Cursor
vapi mcp setup windsurf # For Windsurf
vapi mcp setup vscode # For VSCode
# Check configuration status
vapi mcp status
Once configured, your IDE's AI assistant will have access to:
- Complete Vapi Documentation - No more hallucinated API info
- Code Examples & Templates - Real working examples
- Best Practices & Guides - Expert-level implementation patterns
- Latest Features - Always up-to-date with new releases
Supported IDEs:
What this does:
- Configures your IDE to use the Vapi MCP docs server
- Creates appropriate configuration files (
.cursor/mcp.json, etc.) - Eliminates AI hallucination about Vapi features and APIs
- Enables intelligent code suggestions specific to Vapi
Try asking your IDE's AI: "How do I create a voice assistant with Vapi?" and watch it provide accurate, up-to-date information!
Configuration
# View current configuration
vapi config get
# Set configuration values
vapi config set <key> <value>
# List all configuration options
vapi config list
# Manage analytics preferences
vapi config analytics status # Show current analytics status
vapi config analytics disable # Disable analytics collection
vapi config analytics enable # Enable analytics collection
Analytics and Privacy
The Vapi CLI collects anonymous usage analytics to help improve the product. We prioritize your privacy:
What we collect:
- Command usage patterns (anonymous)
- Error types and frequencies (hashed)
- Performance metrics
- Operating system and architecture
- CLI version information
What we DON'T collect:
- API keys or sensitive credentials
- File contents or personal data
- User-identifiable information
- Specific error messages (only hashed patterns)
How to opt out:
You can disable analytics collection in multiple ways:
# Via CLI command
vapi config analytics disable
# Via environment variable (any of these)
export VAPI_DISABLE_ANALYTICS=1
export VAPI_NO_TELEMETRY=1
export DISABLE_TELEMETRY=1
export DO_NOT_TRACK=1
# Via config file
echo "disable_analytics: true" >> ~/.vapi-cli.yaml
All data is collected anonymously and securely transmitted to PostHog for analysis.
Chat Management
Manage text-based chat conversations with Vapi assistants:
# List all chat conversations
vapi chat list
# Get chat conversation details
vapi chat get <chat-id>
# Create a new chat (guided setup)
vapi chat create
# Continue an existing chat conversation
vapi chat continue <chat-id> "Your message here"
# Delete a chat conversation
vapi chat delete <chat-id>
Phone Number Management
Manage your Vapi phone numbers for calls:
# List all phone numbers
vapi phone list
# Get phone number details
vapi phone get <phone-number-id>
# Purchase a new phone number (guided)
vapi phone create
# Update phone number configuration
vapi phone update <phone-number-id>
# Release a phone number
vapi phone delete <phone-number-id>
Enhanced Call Management
Enhanced call operations and monitoring:
# List all calls
vapi call list
# Get call details
vapi call get <call-id>
# Create a new call (guided)
vapi call create
# Update a call in progress
vapi call update <call-id>
# End an active call
vapi call end <call-id>
Logs and Debugging
View system logs for debugging and monitoring:
# List recent system logs
vapi logs list
# View call-specific logs
vapi logs calls [call-id]
# View recent error logs
vapi logs errors
# View webhook delivery logs
vapi logs webhooks
Tool Management
Manage custom tools and functions that connect your voice agents to external APIs:
# List all tools
vapi tool list
# Get tool details
vapi tool get <tool-id>
# Create a new tool (guided)
vapi tool create
# Update tool configuration
vapi tool update <tool-id>
# Delete a tool
vapi tool delete <tool-id>
# Test a tool with sample input
vapi tool test <tool-id>
# List available tool types
vapi tool types
Webhook Management
Manage webhook endpoints and configurations for real-time event delivery:
# List all webhook endpoints
vapi webhook list
# Get webhook details
vapi webhook get <webhook-id>
# Create a new webhook endpoint
vapi webhook create [url]
# Update webhook configuration
vapi webhook update <webhook-id>
# Delete a webhook endpoint
vapi webhook delete <webhook-id>
# Test a webhook endpoint
vapi webhook test <webhook-id>
# List available webhook event types
vapi webhook events
Webhook Testing
Test your webhook integrations locally without needing ngrok or other tunneling tools:
# Forward webhooks to your local development server
vapi listen --forward-to localhost:3000/webhook
# Use a different port for the webhook listener
vapi listen --forward-to localhost:8080/api/webhooks --port 4242
# Skip TLS verification (for development only)
vapi listen --forward-to localhost:3000/webhook --skip-verify
The listen command will:
- Start a local webhook server (default port 4242)
- Forward all incoming Vapi webhooks to your specified endpoint
- Display webhook events in real-time for debugging
- Add helpful headers to identify forwarded requests
Staying Updated
Keep your CLI up-to-date with the latest features and bug fixes:
# Check for available updates
vapi update check
# Update to the latest version
vapi update
The CLI will automatically check for updates periodically and notify you when a new version is available.
Project Structure
This is a monorepo containing both the Go CLI and the TypeScript MCP server:
vapi-cli/ # π Main repository
βββ cmd/ # Go CLI command implementations
β βββ root.go # Main CLI setup & auth
β βββ assistant.go # Assistant management
β βββ workflow.go # Workflow commands
β βββ campaign.go # Campaign management
β βββ call.go # Call operations
β βββ config.go # Configuration
β βββ init.go # Project integration
β βββ mcp.go # MCP server setup β¨
β βββ login.go # Authentication
βββ pkg/ # Go core packages
β βββ auth/ # Authentication logic
β βββ client/ # Vapi API client
β βββ config/ # Configuration management
β βββ integrations/ # Framework detection
β βββ output/ # Output formatting
βββ mcp-docs-server/ # π¦ MCP Server (TypeScript)
β βββ src/ # TypeScript source
β β βββ index.ts # MCP server entry point
β β βββ server.ts # Core server logic
β β βββ tools/ # MCP tools (5 tools)
β β βββ resources/ # MCP resources
β β βββ utils/ # Utilities & data
β βββ dist/ # Built JavaScript
β βββ package.json # npm package config
β βββ README.md # MCP server docs
βββ build/ # Build artifacts (git-ignored)
βββ main.go # Go CLI entry point
βββ Makefile # Unified build system β‘
βββ README.md # This file
Monorepo Benefits
- π Synchronized Development - CLI and MCP server stay in sync
- π¦ Single Source of Truth - All Vapi tooling in one place
- π Unified Build System -
make allbuilds everything - π― Consistent Versioning - CLI and MCP server versions aligned
Development
This monorepo includes both Go (CLI) and TypeScript (MCP server) components. The unified Makefile handles both.
Quick Start
# Build everything (CLI + MCP server)
make all
# Install everything locally
make install-all
# Test everything
make test-all
# Clean everything
make clean-all
Building
CLI (Go)
# Build CLI only
make build
# Build for all platforms
make build-all
# Run without building
go run main.go
MCP Server (TypeScript)
# Build MCP server only
make build-mcp
# Install MCP server globally
make install-mcp
# Publish to npm
make publish-mcp
Development Requirements
- Go 1.21+ - Install Go
- Node.js 18+ - Install Node.js
- golangci-lint - For Go code linting
- npm - For MCP server dependencies
# macOS
brew install go node golangci-lint
# Install dependencies for both projects
make deps-all
Testing
# Run all tests
make test
# Run tests with coverage
make test-coverage
Code Quality
# Run linters
make lint
# Format code
go fmt ./...
Contributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Configuration
The CLI stores configuration in ~/.vapi-cli.yaml. You can also use environment variables:
VAPI_API_KEY- Your Vapi API keyVAPI_BASE_URL- API base URL (for development)
Supported Frameworks
Frontend
- React (Create React App, Vite)
- Vue.js
- Angular
- Svelte
- Next.js
- Nuxt.js
- Remix
- Vanilla JavaScript
Mobile
- React Native
- Flutter
Backend
- Node.js/TypeScript
- Python
- Go
- Ruby
- Java
- C#/.NET
License
MIT License - see LICENSE file for details.
Support
- π Documentation
- π¬ Discord Community
- π Issue Tracker
Built with β€οΈ by the Vapi team
Version Management
The Vapi CLI uses a simple and discoverable version management system:
Current Version
The current version is stored in the VERSION file at the project root. This makes it easy to find and update.
Managing Versions
Using Make (Recommended)
# Show current version
make version
# Set a specific version
make version-set VERSION=1.2.3
# Bump versions automatically
make version-bump-patch # 1.2.3 -> 1.2.4
make version-bump-minor # 1.2.3 -> 1.3.0
make version-bump-major # 1.2.3 -> 2.0.0
Using the Script Directly
# Show current version
./scripts/version.sh get
# Set a specific version
./scripts/version.sh set 1.2.3
# Bump versions
./scripts/version.sh bump patch
./scripts/version.sh bump minor
./scripts/version.sh bump major
How It Works
- Development: The CLI reads the version from the
VERSIONfile - Release Builds: GoReleaser overrides the version using git tags and ldflags
- Priority: Build-time version (from releases) takes priority over the VERSION file
This approach provides:
- β
Easy version discovery (just check the
VERSIONfile) - β Automated version bumping with semantic versioning
- β Consistent versioning across development and releases
- β No need to manually edit code files
Documentation
ΒΆ
Overview ΒΆ
Copyright Β© 2025 Vapi, Inc.
Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Authors:
Dan Goosewin <[email protected]>