The Vespa CLI is a powerful command-line tool for deploying, managing, and querying Vespa applications. It provides a unified interface for both local development and cloud deployments.
# Deploy to local instancevespa deploy .# Deploy to Vespa Cloudvespa deploy -t cloud# Deploy to specific zonevespa deploy -t cloud -z dev.aws-us-east-1c
The deploy command performs both prepare and activate operations. You can also run them separately:
When deploy returns successfully, the application has been validated and activated on config servers. The process of applying it on individual nodes may still be in progress.
# Put a documentvespa document put id:music:song::123 song.json# Put with inline datavespa document put id:music:song::123 --data '{"fields":{"title":"Hello"}}'# Get a documentvespa document get id:music:song::123# Update a documentvespa document update id:music:song::123 update.json# Remove a documentvespa document remove id:music:song::123
Document operations are synchronous and return only after the operation is visible.
# Simple queryvespa query 'select * from music where artist contains "beatles"'# Query with parametersvespa query 'yql=select * from music where artist contains "beatles"' hits=10# Query from JSON filevespa query --file query.json# Show equivalent curl commandvespa query --verbose 'select * from music'# Plain output (no formatting)vespa query --format=plain 'select * from music'
# Check all endpointsvespa status# Check specific clustervespa status --cluster music# Wait for services to be readyvespa status --wait 300# Check deployment convergencevespa status deployment# Check deployment with specific run ID (cloud)vespa status deployment 12345# JSON outputvespa status --format json
# Set target (local or cloud)vespa config set target localvespa config set target cloud# Set applicationvespa config set application tenant.app.instance# Set clustervespa config set cluster music# List configurationvespa config get
# Verbose mode for queriesvespa query --verbose 'select * from music'# Show logsvespa log --follow# Set log level for deployvespa deploy --log-level info
For loading large datasets, always use vespa feed instead of individual document put commands. The feed command is optimized for high throughput with parallel connections and automatic throttling.
2
Configure appropriate parallelism
Start with default settings and adjust based on your cluster size:
Small clusters (< 5 nodes): 8-16 connections
Medium clusters (5-20 nodes): 16-32 connections
Large clusters (> 20 nodes): 32-64 connections
3
Monitor feed metrics
Use --progress flag to monitor feed progress and identify bottlenecks:
vespa feed docs.jsonl --progress 10
4
Use compression for large documents
The default auto compression setting works well for most cases. It compresses documents larger than 1KB automatically.