v0-cli
v1.1.6
Published
CLI tool for v0 SDK
Maintainers
Readme
v0 CLI
A developer-friendly command-line tool to interact with the v0 Platform API.
Installation
Option 1: Local Installation (Recommended)
# Clone the repository
git clone [email protected]:emmanuel-martinez-dev/v0-cli.git
cd v0-cli
# Install CLI locally
./cli/install-local.shOption 2: Global Installation (Requires administrator permissions)
# Install globally
npm install -g v0-cli
# Or use npx
npx v0-cli --helpOption 3: Development
# Clone and setup for development
git clone [email protected]:emmanuel-martinez-dev/v0-cli.git
cd v0-cli
# Install dependencies
npm install
# Compile
npm run build
# Run directly
node dist/index.js --helpQuick Start
Before using the CLI, configure your API key:
# Interactive setup
v0 config setup
# Or configure manually
v0 config set-api-key YOUR_API_KEYGet your API key from: https://v0.dev/chat/settings/keys
Usage
Key ideas:
- Global flags:
--api-key,--verbose,--output json|yaml|table. - Precedence for API key:
--api-key>V0_API_KEY> saved config > interactive prompt. - Output format hierarchy: per-command
--output> global--output> saved config.
Chats
Create a chat
# Create chat with message
v0 chat create "Create a React component with Tailwind CSS"
# Create interactive chat
v0 chat create
# With additional options
v0 chat create "Message" --system "You are a React expert" --privacy private --model v0-1.5-md --project-id PROJECT_ID --attachment https://example.com/a.png https://example.com/b.txtList chats
# List all chats
v0 chat list
# List only favorites
v0 chat list --favorite
# Filter by project / privacy / name
v0 chat list --project-id PROJECT_ID --privacy private --name navbar
# Limit results
v0 chat list --limit 5Get chat details
v0 chat get CHAT_IDSend message to chat
# Send message
v0 chat message CHAT_ID "Add form validation"
# Send interactive message
v0 chat message CHAT_IDUpdate chat
# Rename
v0 chat update CHAT_ID --name "New name"
# Change privacy
v0 chat update CHAT_ID --privacy publicDelete chat
# With confirmation
v0 chat delete CHAT_ID
# Without confirmation
v0 chat delete CHAT_ID --forceFavorites
# Add to favorites
v0 chat favorite CHAT_ID
# Remove from favorites
v0 chat favorite CHAT_ID --removeProjects
Create project
# Create project with name
v0 project create "My Project"
# Create interactive project
v0 project create
# With description
v0 project create "My Project" --description "An amazing project"List projects
v0 project listGet project details
v0 project get PROJECT_IDUpdate project
v0 project update PROJECT_ID --name "New Name" --description "New description"Assign chat to project
v0 project assign PROJECT_ID CHAT_IDGet project by chat
v0 project get-by-chat CHAT_IDDeployments
List deployments
# Guided selection (recommended)
v0 deploy list
# Filter by project
v0 deploy list --project-id PROJECT_ID
# Filter by chat
v0 deploy list --chat-id CHAT_IDCreate deployment
# Interactive deployment (recommended)
v0 deploy create
# With specific IDs
v0 deploy create PROJECT_ID CHAT_ID VERSION_ID
# With project and chat names
v0 deploy create --project-name "My Project" --chat-name "My Chat"
# Force interactive mode
v0 deploy create --interactiveQuick deploy from chat
# Interactive chat selection
v0 deploy from-chat
# With chat ID
v0 deploy from-chat CHAT_ID
# With chat name
v0 deploy from-chat --chat-name "My Chat"Quick deploy (create project, chat and deploy)
# Interactive mode
v0 deploy quick
# With message
v0 deploy quick "Create a React todo app"
# With project name and message
v0 deploy quick "Create a React todo app" --project-name "Todo App"Get deployment details
v0 deploy get DEPLOYMENT_IDDelete deployment
v0 deploy delete DEPLOYMENT_IDView deployment logs
v0 deploy logs DEPLOYMENT_ID
# With timestamp
v0 deploy logs DEPLOYMENT_ID --since 1640995200000View deployment errors
v0 deploy errors DEPLOYMENT_IDUser
User information
v0 user infoPlan and billing
v0 user planDetailed billing information
v0 user billing
# With specific scope
v0 user billing --scope SCOPEUser scopes
v0 user scopesRate limits
v0 user rate-limits
# With specific scope
v0 user rate-limits --scope SCOPEConfiguration
Show current configuration
v0 config showConfigure API key
# With argument
v0 config set-api-key YOUR_API_KEY
# Interactive
v0 config set-api-keyConfigure default project
v0 config set-default-project PROJECT_IDConfigure output format
v0 config set-output-format json
v0 config set-output-format table
v0 config set-output-format yamlClear configuration
v0 config clearComplete interactive setup
v0 config setupGlobal Options
Output Format
# JSON
v0 chat list --output json
# YAML
v0 project list --output yaml
# Table (default)
v0 user info --output tableAPI Key
# Use specific API key
v0 chat create "Message" --api-key YOUR_API_KEYVerbose
# Enable detailed logs
v0 chat list --verboseUsage Examples
Complete Development Workflow
# 1. Configure CLI
v0 config setup
# 2. Create project
v0 project create "My React App"
# 3. Create chat for the project
v0 chat create "Create a React todo app" --project-id PROJECT_ID
# 4. Send additional message
v0 chat message CHAT_ID "Add local persistence"
# 5. Create deployment
v0 deploy create PROJECT_ID CHAT_ID VERSION_ID
# 6. View deployment logs
v0 deploy logs DEPLOYMENT_IDQuick Deploy Workflow (Recommended)
# 1. Configure CLI
v0 config setup
# 2. Quick deploy everything in one command
v0 deploy quick "Create a React todo app with local storage"
# 3. Or deploy from existing chat
v0 deploy from-chat
# 4. View deployment logs
v0 deploy logs DEPLOYMENT_IDAutomation
# Create chat and get URL
CHAT_URL=$(v0 chat create "Create a navbar" --output json | jq -r '.webUrl')
echo "Chat created: $CHAT_URL"
# List projects in JSON format
v0 project list --output json | jq '.[] | .name'
# Quick deploy with automation
DEPLOYMENT_URL=$(v0 deploy quick "Create a React component" --output json | jq -r '.deployment.webUrl')
echo "Deployment ready: $DEPLOYMENT_URL"Features
- ✅ Persistent configuration: API key and settings are saved automatically
- ✅ Output formats: JSON, YAML, and developer-friendly tables
- ✅ Better errors: Status/code/message, optional verbose body/stack
- ✅ Interactive UX: Guided prompts when data is missing
- ✅ Smart deployments: Project/chat/version resolution with fallbacks
- ✅ Vercel integration: List and create integration projects
- ✅ Name-based selection: Choose resources by name instead of IDs
Development
Install dependencies
cd cli
npm installCompile
npm run buildRun in development
npm run dev -- --helpTesting
pnpm test
pnpm test:coveragenpm testTroubleshooting
Installation Issues
Permission error when installing globally
# Use local installation instead ./cli/install-local.shIncompatible Node.js version
# Update Node.js to version 18 or higher # Visit: https://nodejs.org/Dependency errors
# Clean and reinstall rm -rf node_modules package-lock.json npm install
Usage Issues
Invalid API key
# Check configuration v0 config show # Reconfigure API key v0 config set-api-key NEW_API_KEYRate limit exceeded
# Check rate limits v0 user rate-limits # Wait and retry sleep 60 v0 chat create "Message"Deployment failed
# View deployment errors v0 deploy errors DEPLOYMENT_ID # View complete logs v0 deploy logs DEPLOYMENT_ID
Debugging
v0 --verbose <command>
v0 --output json <command># Enable verbose mode
v0 chat list --verbose
# Use JSON format for debugging
v0 chat get CHAT_ID --output json | jq '.'
# View current configuration
v0 config showContributing
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Open a Pull Request
