pixverse-ai-image-and-video-generator
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChinesePixVerse CLI — Master Skill
PixVerse CLI — 核心使用指南
What is PixVerse CLI
什么是PixVerse CLI
PixVerse CLI is the official command-line interface for PixVerse — an AI-powered creative platform for generating videos and images. It is essentially a UI-free version of the PixVerse website: all features, models, and parameters are aligned with the web experience at app.pixverse.ai.
It is designed for:
- AI agents (primary) — structured JSON output, deterministic exit codes, and pipeable commands for autonomous workflows (Claude Code, Cursor, Codex, custom agents)
- Developers & power users — scriptable video/image generation without leaving the terminal
- Automation — batch processing, CI/CD pipelines, content production workflows
Key facts:
- Generating content consumes credits from the user's PixVerse account (same pricing as the website)
- Only subscribed users can use the CLI — see subscription plans
- All output can be returned as structured JSON via flag
--json - English only
PixVerse CLI是PixVerse的官方命令行界面——一个基于AI的创意平台,用于生成视频和图片。它本质上是PixVerse网站的无UI版本:所有功能、模型和参数都与app.pixverse.ai的网页体验保持一致。
它专为以下用户设计:
- AI Agent(主要用户)——结构化JSON输出、确定的退出码和可管道化的命令,适用于自主工作流(Claude Code、Cursor、Codex、自定义Agent)
- 开发者与高级用户——无需离开终端即可通过脚本生成视频/图片
- 自动化场景——批量处理、CI/CD流水线、内容生产工作流
关键说明:
- 生成内容会消耗用户PixVerse账户中的点数(定价与网站一致)
- 仅订阅用户可使用该CLI——查看订阅方案
- 所有输出可通过标志返回为结构化JSON
--json - 仅支持英文
Installation
安装
bash
npm install -g pixverseOr run without installing:
bash
npx pixverseVerify:
bash
pixverse --versionRequires Node.js >= 20.
bash
npm install -g pixverse或者无需安装直接运行:
bash
npx pixverse验证安装:
bash
pixverse --version要求Node.js版本 >= 20。
Quick Start
快速开始
bash
undefinedbash
undefined1. Install
1. 安装
npm install -g pixverse
npm install -g pixverse
2. Authenticate (OAuth device flow — opens browser)
2. 认证(OAuth设备流 — 会打开浏览器)
pixverse auth login --json
pixverse auth login --json
3. Create a video (waits for completion by default)
3. 创建视频(默认等待生成完成)
RESULT=$(pixverse create video --prompt "A cat astronaut floating in space" --json)
VIDEO_ID=$(echo "$RESULT" | jq -r '.video_id')
RESULT=$(pixverse create video --prompt "A cat astronaut floating in space" --json)
VIDEO_ID=$(echo "$RESULT" | jq -r '.video_id')
4. Download the result
4. 下载生成结果
pixverse asset download $VIDEO_ID --json
To skip waiting and poll later:
```bash
RESULT=$(pixverse create video --prompt "A cat astronaut floating in space" --no-wait --json)
VIDEO_ID=$(echo "$RESULT" | jq -r '.video_id')
pixverse task wait $VIDEO_ID --json
pixverse asset download $VIDEO_ID --jsonpixverse asset download $VIDEO_ID --json
若要跳过等待,后续再轮询状态:
```bash
RESULT=$(pixverse create video --prompt "A cat astronaut floating in space" --no-wait --json)
VIDEO_ID=$(echo "$RESULT" | jq -r '.video_id')
pixverse task wait $VIDEO_ID --json
pixverse asset download $VIDEO_ID --jsonAuthentication
认证
PixVerse CLI uses OAuth device flow — no need to manually copy tokens:
- Run
pixverse auth login --json - The CLI prints an authorization URL
- Open the URL in your browser and authorize
- The token is stored automatically in
~/.pixverse/
Details:
- Token is valid for 30 days
- CLI sessions are independent from your web/app sessions
- If token expires (exit code 3), re-run
pixverse auth login --json - Set environment variable to override the stored token
PIXVERSE_TOKEN - Run to check login state and credits
pixverse auth status --json
PixVerse CLI采用OAuth设备流——无需手动复制令牌:
- 运行
pixverse auth login --json - CLI会打印一个授权URL
- 在浏览器中打开该URL并完成授权
- 令牌会自动存储在目录中
~/.pixverse/
详细说明:
- 令牌有效期为30天
- CLI会话与网页/应用会话相互独立
- 若令牌过期(退出码3),重新运行
pixverse auth login --json - 设置环境变量可覆盖存储的令牌
PIXVERSE_TOKEN - 运行可查看登录状态和剩余点数
pixverse auth status --json
Capabilities Overview
功能概览
| I want to... | Use skill |
|---|---|
| Create a video from text or image | |
| Create or edit an image | |
| Extend, upscale, or add audio to a video | |
| Create transition animation between frames | |
| Check generation progress | |
| Browse, download, or delete assets | |
| Set up auth or check account | |
| Browse and create from effect templates | |
Looking up models or parameters? Don't wait until you're generating — read the relevant capabilities file directly:
- Video models & constraints →
(Model Reference section)skills/capabilities/create-video.md- Image models & constraints →
(Model Reference section)skills/capabilities/create-and-edit-image.md
| 我想要... | 使用对应技能 |
|---|---|
| 从文本或图片创建视频 | |
| 创建或编辑图片 | |
| 扩展视频时长、提升分辨率或为视频添加音频 | |
| 在帧之间创建转场动画 | |
| 查看生成进度 | |
| 浏览、下载或删除资产 | |
| 设置认证或查看账户信息 | |
| 浏览并从特效模板创建内容 | |
想要查看模型或参数? 不用等到生成时才了解——直接阅读相关的功能文档:
- 视频模型与限制 →
(模型参考章节)skills/capabilities/create-video.md- 图像模型与限制 →
(模型参考章节)skills/capabilities/create-and-edit-image.md
Model Quick Reference
模型快速参考
Use this to pick a model before diving into a sub-skill.
在深入学习子技能之前,用这个来选择合适的模型。
Video Models (pixverse create video --model <value>
)
pixverse create video --model <value>视频模型(pixverse create video --model <value>
)
pixverse create video --model <value>| Model | | Max Quality | Duration |
|---|---|---|---|
| PixVerse v5.6 (default) | | | |
| Sora 2 | | | |
| Sora 2 Pro | | | |
| Veo 3.1 Standard | | | |
| Veo 3.1 Fast | | | |
| Grok Imagine | | | |
| 模型 | | 最高画质 | 时长 |
|---|---|---|---|
| PixVerse v5.6(默认) | | | |
| Sora 2 | | | |
| Sora 2 Pro | | | |
| Veo 3.1 Standard | | | |
| Veo 3.1 Fast | | | |
| Grok Imagine | | | |
Image Models (pixverse create image --model <value>
)
pixverse create image --model <value>图像模型(pixverse create image --model <value>
)
pixverse create image --model <value>| Model | | Max Quality |
|---|---|---|
| Qwen Image (default) | | |
| Seedream 5.0 Lite | | |
| Seedream 4.5 | | |
| Seedream 4.0 | | |
| Gemini 2.5 Flash (Nanobanana) | | |
| Gemini 3.0 (Nano Banana Pro) | | |
| Gemini 3.1 Flash (Nano Banana 2) | | |
For full parameter constraints (aspect ratios, quality per model, mode support), read the capabilities files listed above.
| 模型 | | 最高画质 |
|---|---|---|
| Qwen Image(默认) | | |
| Seedream 5.0 Lite | | |
| Seedream 4.5 | | |
| Seedream 4.0 | | |
| Gemini 2.5 Flash (Nanobanana) | | |
| Gemini 3.0 (Nano Banana Pro) | | |
| Gemini 3.1 Flash (Nano Banana 2) | | |
如需完整的参数限制(宽高比、各模型支持的画质、模式支持),请阅读上面列出的功能文档。
Workflow Skills
工作流技能
| I want to... | Use skill |
|---|---|
| Generate video from text end-to-end | |
| Animate an image into video | |
| Generate image then animate it | |
| Iteratively edit an image | |
| Full video production (create + extend + audio + upscale) | |
| Create multiple items in parallel | |
| 我想要... | 使用对应技能 |
|---|---|
| 从文本端到端生成视频 | |
| 将图片动作为视频 | |
| 先生成图片再将其动作为视频 | |
| 迭代编辑图片 | |
| 完整视频制作(创建+扩展+音频+提升分辨率) | |
| 并行生成多个内容 | |
All Commands
所有命令
| Command | Description |
|---|---|
| Login via browser (OAuth device flow) |
| Check authentication status |
| Remove stored token |
| Text-to-video or image-to-video |
| Text-to-image or image-to-image |
| Create transitions between keyframes |
| Add lip-sync speech to video |
| Add AI sound effects to video |
| Extend video duration |
| Upscale video resolution |
| Generate video with character references |
| Create video or image from an effect template |
| List template categories |
| Browse templates (with optional category filter) |
| Search templates by keyword |
| Get template details |
| Check task status |
| Wait for task completion |
| List generated assets |
| Get asset details |
| Download a generated asset |
| Delete an asset |
| View account info and credits |
| View credit usage records |
| Open subscription page in browser |
| List all config values |
| Get a config value |
| Set a config value |
| Reset config to defaults |
| Show config file path |
| Manage per-mode creation defaults |
| 命令 | 描述 |
|---|---|
| 通过浏览器登录(OAuth设备流) |
| 查看认证状态 |
| 删除存储的令牌 |
| 文本转视频或图片转视频 |
| 文本转图片或图片转图片 |
| 在关键帧之间创建转场效果 |
| 为视频添加唇形同步的语音 |
| 为视频添加AI音效 |
| 扩展视频时长 |
| 提升视频分辨率 |
| 基于角色参考生成视频 |
| 从特效模板创建视频或图片 |
| 列出模板分类 |
| 浏览模板(可按分类筛选) |
| 按关键词搜索模板 |
| 获取模板详情 |
| 查看任务状态 |
| 等待任务完成 |
| 列出已生成的资产 |
| 获取资产详情 |
| 下载已生成的资产 |
| 删除资产 |
| 查看账户信息和剩余点数 |
| 查看点数使用记录 |
| 在浏览器中打开订阅页面 |
| 列出所有配置值 |
| 获取某个配置值 |
| 设置某个配置值 |
| 将配置重置为默认值 |
| 显示配置文件路径 |
| 管理各创建模式的默认设置 |
Global Flags
全局标志
| Flag | Description |
|---|---|
| Pure JSON output to stdout (required for agent use) |
| Show CLI version |
| Show help for any command |
Every command supports . All examples in skills use for machine-readable output.
--json--jsonInteractive mode: Run any creation command without arguments (and without ) to enter the interactive wizard.
--json| 标志 | 描述 |
|---|---|
| 向标准输出输出纯JSON(Agent使用时必填) |
| 显示CLI版本 |
| 查看任意命令的帮助信息 |
所有命令都支持标志。技能中的所有示例都使用以获得机器可读的输出。
--json--json交互模式:运行任意创建命令时不带参数(且不带)即可进入交互式向导。
--jsonOutput Contract
输出约定
JSON mode (--json
)
--jsonJSON模式(--json
)
--json- stdout: Pure JSON only. No spinners, no progress text, no decorative output.
- stderr: All errors, warnings, and diagnostic messages.
- Parse stdout with or any JSON parser.
jq
- 标准输出:仅输出纯JSON。无加载动画、无进度文本、无装饰性输出。
- 标准错误输出:所有错误、警告和诊断信息。
- 可使用或任意JSON解析器解析标准输出。
jq
Exit Codes
退出码
| Code | Name | Meaning | Recovery |
|---|---|---|---|
| 0 | SUCCESS | Completed | — |
| 1 | GENERAL_ERROR | Unexpected error | Check stderr for details |
| 2 | TIMEOUT | Polling timed out | Increase |
| 3 | AUTH_EXPIRED | Token invalid/expired | Re-run |
| 4 | CREDIT_INSUFFICIENT | Not enough credits | Check |
| 5 | GENERATION_FAILED | Generation failed/rejected | Check prompt, try different parameters |
| 6 | VALIDATION_ERROR | Invalid parameters | Check flag values against enums in each skill |
| 代码 | 名称 | 含义 | 恢复方法 |
|---|---|---|---|
| 0 | SUCCESS | 任务完成 | — |
| 1 | GENERAL_ERROR | 意外错误 | 查看标准错误输出获取详情 |
| 2 | TIMEOUT | 轮询超时 | 增加 |
| 3 | AUTH_EXPIRED | 令牌无效/过期 | 重新运行 |
| 4 | CREDIT_INSUFFICIENT | 点数不足 | 查看 |
| 5 | GENERATION_FAILED | 生成失败/被拒绝 | 检查提示词,尝试不同参数 |
| 6 | VALIDATION_ERROR | 参数无效 | 检查标志值是否符合各技能中的枚举值 |
Error handling pattern
错误处理示例
bash
RESULT=$(pixverse create video --prompt "A sunset over mountains" --json 2>/tmp/pv_err)
EXIT_CODE=$?
if [ $EXIT_CODE -eq 0 ]; then
VIDEO_ID=$(echo "$RESULT" | jq -r '.video_id')
echo "Success: $VIDEO_ID"
pixverse asset download $VIDEO_ID --json
elif [ $EXIT_CODE -eq 3 ]; then
echo "Token expired, re-authenticating..."
pixverse auth login --json
elif [ $EXIT_CODE -eq 4 ]; then
echo "Not enough credits"
pixverse account info --json | jq '.credits'
elif [ $EXIT_CODE -eq 5 ]; then
echo "Generation failed — check prompt or parameters"
cat /tmp/pv_err
else
echo "Error (code $EXIT_CODE)"
cat /tmp/pv_err
fibash
RESULT=$(pixverse create video --prompt "A sunset over mountains" --json 2>/tmp/pv_err)
EXIT_CODE=$?
if [ $EXIT_CODE -eq 0 ]; then
VIDEO_ID=$(echo "$RESULT" | jq -r '.video_id')
echo "Success: $VIDEO_ID"
pixverse asset download $VIDEO_ID --json
elif [ $EXIT_CODE -eq 3 ]; then
echo "令牌过期,重新认证中..."
pixverse auth login --json
elif [ $EXIT_CODE -eq 4 ]; then
echo "点数不足"
pixverse account info --json | jq '.credits'
elif [ $EXIT_CODE -eq 5 ]; then
echo "生成失败 — 检查提示词或参数"
cat /tmp/pv_err
else
echo "错误(代码 $EXIT_CODE)"
cat /tmp/pv_err
fi