CLI for creating and iterating on websites with v0.dev. Designed for machine/agent use.
npm install -g @hlongvu/v0-cliOr build from source:
npm install
npm run pack
npm install -g @hlongvu/v0-cli-1.0.0.tgzGet your API key from https://v0.dev/chat/settings/keys and export it:
export V0_API_KEY=your_key_herev0 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/abc123v0 chat <chatId><message>v0 chat abc123 "Add a dark mode toggle to the header"v0 list [--limit <n>]# 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"