← 返回
未分类 Key 中文

v0-cli

Command-line tool for creating, refining, and listing AI-generated websites using v0.dev API without interactive prompts.
命令行工具,使用 v0.dev API 创建、优化和列出 AI 生成的网站,无需交互式提示。
hlongvu
未分类 clawhub v1.0.1 1 版本 99717.5 Key: 需要
★ 1
Stars
📥 333
下载
💾 0
安装
1
版本
#latest

概述

v0-cli — AI Agent Skill Reference

A CLI tool for creating and iterating on websites using v0.dev from the terminal.

Designed for machine/agent use — no interactive prompts.

Prerequisites

  • Node.js >= 18
  • V0_API_KEY environment variable set (obtain from https://v0.dev/chat/settings/keys)
  • Dependencies installed: npm install in this directory

Invocation

node /path/to/v0-cli/src/index.js <command> [options]

Or if installed globally (npm install -g @hlongvu/v0-cli):

v0 <command> [options]

Commands

create — Create a new website

v0 create <prompt> [options]

Arguments:

  • prompt (required) — Natural language description of the website to generate.

Options:

FlagDescriptionDefault
----------------------------
-p, --privacy public, private, or unlistedpublic
-s, --system Custom system prompt for the AI
--no-openSkip opening the browser after creationopens browser

Examples:

# Create and skip browser open (recommended for automation)
v0 create "A dark SaaS landing page with hero, features, and pricing" --no-open

# Create private chat with custom system prompt
v0 create "Admin dashboard" --privacy private --system "Use shadcn/ui components"

Output (stdout):

  Chat ID:  <chatId>
  Preview:  https://v0.app/chat/<chatId>

Key output to parse: Chat ID: line — extract the chatId for follow-up chat calls.


chat — Send a message to an existing chat

v0 chat <chatId> <message>

Arguments:

  • chatId (required) — The ID of an existing v0 chat.
  • message (required) — The refinement message to send.

Output (stdout):

  Chat ID: <chatId>
  Name:    <name>
  URL:     <url>

  v0: <streamed response text>

  Preview: https://v0.app/chat/<chatId>

Examples:

v0 chat abc123xyz "Add a dark mode toggle to the header"
v0 chat abc123xyz "Make the layout responsive for mobile"

list — List all chats

v0 list [options]

Options:

FlagDescriptionDefault
----------------------------
-l, --limit Max number of chats to display20

Output format:

   1. <name> [public] 3/31/2026
      ID:  <chatId>
      URL: https://v0.app/chat/<chatId>

Automation / Agent Workflow

> IMPORTANT — v0 create timeout handling:

> v0 create can take a long time to complete and may time out before returning output.

> If the command times out or the output is lost:

> - Do NOT rerun v0 create — the project may already have been created.

> - Run v0 list to check if the chat was created, then use its chatId to continue.

# 1. Create a site, capture chatId
output=$(v0 create "A portfolio site with dark theme" --no-open 2>&1)
chatId=$(echo "$output" | grep "Chat ID:" | awk '{print $NF}')

# If chatId is empty (timeout / lost output), check if it was already created:
# v0 list --limit 5
# Then extract the chatId manually from the list output.

# 2. Send refinement messages
v0 chat "$chatId" "Add a contact form section"
v0 chat "$chatId" "Make the layout responsive for mobile"

# 3. List all chats
v0 list --limit 10

Environment Variables

VariableRequiredDescription
---------------------------------
V0_API_KEYYesAPI key from https://v0.dev/chat/settings/keys

Error Handling

ScenarioBehavior
--------------------
Missing V0_API_KEYPrints instructions and exits with code 1
Invalid API key (401)Prints error with link to settings page
Chat not found (404)Prints error and exits with code 1
Rate limit (429)Prints error message from API

版本历史

共 1 个版本

  • v1.0.1 当前
    2026-05-07 14:03 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ai-agent

Self-Improving + Proactive Agent

ivangdavila
自我反思+自我批评+自我学习+自组织记忆。智能体评估自身工作、发现错误并持续改进。
★ 1,385 📥 320,934
dev-programming

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 677 📥 325,830
ai-agent

Skill Vetter

spclaudehome
AI智能体技能安全预审工具。安装ClawdHub、GitHub等来源技能前,检查风险信号、权限范围及可疑模式。
★ 1,232 📥 268,215