-cli
Star on GitHub
Docs · Commands

The full surface, grouped by noun.

Create a chat

chat create is T1 — it costs tokens, logs to the audit trail, never prompts. In a human TTY it streams generation live with a clack spinner. In --json mode it blocks and returns one envelope, or emits NDJSON if you pass --stream.

bash
v0 chat create --message "Terminal dashboard" --project prj_xxx --privacy private --json

Init from existing files

chat init does not call the model. It uploads a seed (local dir, public repo, zip, shadcn registry URL, template URL, or template id) and creates a chat anchored to that source. Zero token cost. Use this whenever you already have code you want to iterate on.

Signature: v0 chat init <source> [--branch main] [--name "Build"] [--project prj_xxx]. The source shape decides the type — pass any of the inputs below and the CLI picks the right uploader. Pass --type files|repo|zip|registry|template to force an override, or --list-templates to open the v0.app gallery.

Source
Detected type
. · ./dir · ~/path · /abs/path
files
https://github.com/…
repo
https://….zip
zip
https://…/registry.json
registry (shadcn)
https://v0.app/templates/…
template (id extracted)
template_abc · tpl_abc
template
bash
# Zero token cost — init from existing source.
# Source shape auto-detects: path, repo URL, zip, registry.json, template URL, or template id.
v0 chat init ./my-app --json
v0 chat init https://github.com/user/repo --branch main --json
v0 chat init https://example.com/registry.json --json
v0 chat init template_abc --name "Optimus prime" --project prj_xxx --json

# Force the type if auto-detect guesses wrong
v0 chat init ./my-app --type files --json

# Browse the v0.app template gallery
v0 chat init --list-templates

# Legacy --type/--source form still works
v0 chat init --type repo --source https://github.com/user/repo --branch main --json

The legacy --type <kind> --source <value> form still works unchanged.

Iterate and ship

Once you have a chat_id, send follow-up messages with msg send, grab the latest version_id, then deploy.

bash
# Iterate with msg send
v0 msg send <chat-id> "swap the hero copy"

# Resolve latest version
v0 version list <chat-id> --limit 1 --json | jq -r '.data.data[0].id'

# Preview deploy (T2, dry-run safe)
v0 deploy create <chat-id> <version-id> --dry-run --json

env · project vars

Sync project environment variables. Values are always returned ciphertext unless you explicitly ask with --decrypted (which is T2 — requires confirmation).

bash
# Redacted list — values come back as ciphertext
v0 env list prj_xxx --json

# Reveal decrypted values (T2 — needs --yes in JSON mode)
v0 env list prj_xxx --decrypted --yes --json

# Set a plain key (T1, silent)
v0 env set prj_xxx API_URL=https://api.example.com --json

# Set a secret-pattern key (T2 — needs --yes)
v0 env set prj_xxx STRIPE_SECRET_KEY=sk_test_... --yes --json

# Push a local .env (creates + updates; never deletes)
v0 env push prj_xxx --from .env --yes --json

# Pull decrypted values to disk (T2)
v0 env pull prj_xxx --out .env.v0 --yes

deploy · preview and ship

Deployments are T2 — preview with --dry-run, ship with --yes in JSON mode. --wait polls until the deployment reaches a terminal status.

In a human TTY, --wait streams status transitions as past-tense steps (Queued · 2s, Built · 45s, Deployed · 12s, …) with a rolling Thinking… spinner in between — same transcript style as chat create and msg send. --json keeps emitting NDJSON so agents that pipe through jq are unaffected.

bash
# Dry-run first (T2 safe)
v0 deploy create <chat-id> <ver-id> --dry-run --json

# Ship + live transcript (human TTY)
v0 deploy create <chat-id> <ver-id> --yes --wait

# Ship + NDJSON stream (agents)
v0 deploy create <chat-id> <ver-id> --yes --wait --json

# Observe an existing deployment
v0 deploy logs <dep-id> --tail --json
v0 deploy errors <dep-id> --json

version download · archive export

Export any chat version as a local archive. version download is T0 (silent read, no audit prompt, no confirmation) — it does not mutate remote state, it just pulls files. Defaults to a .zip written to the cwd named after the version id.

bash
# Archive a version as a zip (T0, read-only — no confirmation)
v0 version download <chat-id> <version-id>                          # → ./<ver>.zip

# Tarball instead of zip
v0 version download <chat-id> <version-id> --format tarball         # → ./<ver>.tar.gz

# Custom output path
v0 version download <chat-id> <version-id> --out ./my-app.zip

# Bundle default scaffolding files (package.json, tsconfig, etc.)
v0 version download <chat-id> <version-id> --include-default-files

# JSON mode returns { path, bytes, format }
v0 version download <chat-id> <version-id> --json

Flags:

  • --out <path> — override the output file path.
  • --format <zip|tarball> — archive format. Default zip.
  • --include-default-files — bundle scaffolding files (package.json, tsconfig, configs) so the archive is runnable standalone.
  • --json — emit { path, bytes, format } instead of a human summary.

hook · webhooks

hook create is T1, hook update is T2, hook delete is T3 (requires intent token).

bash
v0 hook list --json
v0 hook create --url https://example.com/v0-webhook --event chat.completed --json

All operations

The CLI mirrors the v0 Platform API 1:1 and adds a few local-only commands (version download, intent, killswitch, audit, doctor). Noun · verbs:

Noun
Verbs
auth
status, whoami, login
user
get, plan, billing, scopes
project
list, show, show-by-chat, create, update, assign, delete
chat
list, show, create, init, update, fork, favorite, delete, pending, status, watch, wait
msg
list, show, send, resume, stop
version
list, show, update, files-delete, download
deploy
list, show, create, delete, logs, errors, batch
env
list, get, set, update, delete, pull, push
hook
list, show, create, update, delete
mcp-server
list, show, create, update, delete
integrations vercel
list, link
report
usage, activity
rate-limits
find
intent
issue, list, purge
killswitch
on, off, status
audit
tail
doctor, schema, init
(top-level)

Every command ships with --help and v0 schema <operation> for offline introspection.