@hlongvu/v0-cli
v1.0.0
Published
CLI for creating and iterating on websites with v0.dev
Readme
v0-cli
CLI for creating and iterating on websites with v0.dev. Designed for machine/agent use.
Install
npm install -g v0-cliOr build from source:
npm install
npm run pack
npm install -g v0-cli-1.0.0.tgzSetup
Get your API key from https://v0.dev/chat/settings/keys and export it:
export V0_API_KEY=your_key_hereCommands
Create a website
v0 create <prompt> [options]| Option | Description | Default |
|--------|-------------|---------|
| -p, --privacy | public, private, or unlisted | public |
| -s, --system | Custom system prompt | — |
| --no-open | Skip opening browser | opens browser |
v0 create "A dark SaaS landing page" --no-open
# Output:
# Chat ID: abc123
# Preview: https://v0.app/chat/abc123Send a message to an existing chat
v0 chat <chatId> <message>v0 chat abc123 "Add a dark mode toggle to the header"List all chats
v0 list [--limit <n>]Agent Workflow
# Create and capture the chat ID
output=$(v0 create "Portfolio site with dark theme" --no-open 2>&1)
chatId=$(echo "$output" | grep "Chat ID:" | awk '{print $NF}')
# Iterate
v0 chat "$chatId" "Add a contact form"
v0 chat "$chatId" "Make it mobile responsive"