Native Pipeline CLI Skill
Run QCut's built-in TypeScript pipeline CLI (qcut-pipeline / bun run pipeline).
Additional resources
- - For standalone CLI commands (generate, analyze, transcribe, models, help, output formats), see REFERENCE.md
- For YAML pipelines, API key management, project management, see reference-pipelines.md
- For ViMax commands (idea2video, script2video, novel2movie, portraits), see reference-vimax.md
- For editor core reference: connection, flags, batch limits, env vars, common workflows, see editor-core.md
- For editor media & project commands, project.json schema, see editor-media.md
- For editor timeline & editing commands, see editor-timeline.md
- For editor export, diagnostics, MCP, screen recording, UI, Moyin, screenshots, state control, see editor-output.md
- For editor AI commands: video analysis, transcription, AI generation, Remotion, navigator, see editor-ai.md
- For editor state automation: snapshots, event streams, correlation IDs, transactions, capabilities, and notification bridge endpoints, see editor-state-control.md
Step 1: Ensure QCut is Running
Before any editor:* command, check if QCut is running. If not, build and launch it.
CODEBLOCK0
If NOT_RUNNING:
CODEBLOCK1
Step 2: Find Project, Media & Timeline
Most editor commands need --project-id, --media-id, or --element-id. Run these to discover them.
CODEBLOCK2
Now you have the IDs needed for all other editor commands.
How to Run
CODEBLOCK3
Quick Commands
CODEBLOCK4
ViMax Quick Start
CODEBLOCK5
API Key Setup
Keys stored in ~/.qcut/.env (mode 0600).
CODEBLOCK6
Supported keys: FAL_KEY, GEMINI_API_KEY, GOOGLE_AI_API_KEY, OPENROUTER_API_KEY, ELEVENLABS_API_KEY, OPENAI_API_KEY, RUNWAY_API_KEY, HEYGEN_API_KEY, DID_API_KEY, INLINECODE17
Unified JSON Output
All commands support --json for machine-readable output using a consistent envelope:
CODEBLOCK7
Three possible envelope shapes:
| Status | Shape | When |
|---|
| INLINECODE19 | INLINECODE20 | Command succeeded |
| INLINECODE21 |
{ "status": "error", "error": "msg", "code": "cmd:failed" } | Command failed |
|
pending |
{ "status": "pending", "jobId": "abc-123" } | Async job started |
See REFERENCE.md for full envelope docs.
3-Level Progressive Help (JSON)
The CLI provides structured help at three levels when using --help --json:
CODEBLOCK8
Each level returns a JSON envelope ({ "status": "ok", "data": { ... } }).
project.json — Agent-Readable Project State
Two CLI commands export the full project state as structured JSON:
CODEBLOCK9
See editor-media.md for the full project.json schema.
Global Options
| Flag | Short | Description |
|---|
| INLINECODE27 | INLINECODE28 | Output directory (default: ./output) |
| INLINECODE30 |
-m | Model key |
|
--json | | Output as JSON |
|
--quiet |
-q | Suppress progress |
|
--verbose |
-v | Debug logging |
|
--stream | | JSONL progress events on stderr |
|
--help |
-h | Print help |
|
--session | | Session mode: read commands from stdin |
|
--skip-health | | Skip editor health check |
|
--no-capability-check | | Skip per-request capability warnings |
Key Source Files
| Component | File |
|---|
| CLI entry point | INLINECODE43 |
| Command router |
electron/native-pipeline/cli/cli-runner/runner.ts |
| Command registry (core) |
electron/native-pipeline/cli/command-registry.ts |
| Command registry (editor) |
electron/native-pipeline/cli/command-registry-editor.ts |
| Command registry types |
electron/native-pipeline/cli/command-registry-types.ts |
| JSON output helpers |
electron/native-pipeline/cli/json-output.ts |
| project.json types |
electron/native-pipeline/cli/project-json-types.ts |
| project.json builder |
electron/native-pipeline/cli/project-json-builder.ts |
| Editor dispatch |
electron/native-pipeline/cli/cli-handlers-editor.ts |
| Admin handlers |
electron/native-pipeline/cli/cli-handlers-admin.ts |
| Media handlers |
electron/native-pipeline/cli/cli-handlers-media.ts |
| ViMax handlers |
electron/native-pipeline/cli/vimax-cli-handlers.ts |
| Remotion handler |
electron/native-pipeline/cli/cli-handlers-remotion.ts |
| Moyin handler |
electron/native-pipeline/cli/cli-handlers-moyin.ts |
| Key manager |
electron/native-pipeline/key-manager.ts |
原生流水线 CLI 技能
运行 QCut 内置的 TypeScript 流水线 CLI(qcut-pipeline / bun run pipeline)。
附加资源
步骤 1:确保 QCut 正在运行
在执行任何 editor:* 命令之前,检查 QCut 是否正在运行。如果没有,则构建并启动它。
bash
检查 QCut 是否正在运行
curl -s --connect-timeout 2 http://127.0.0.1:8765/api/claude/health || echo NOT_RUNNING
如果 NOT_RUNNING:
bash
bun run build # 先构建
bun run electron & # 后台启动
sleep 5 # 等待启动
步骤 2:查找项目、媒体和时间轴
大多数编辑器命令需要 --project-id、--media-id 或 --element-id。运行以下命令来发现它们。
bash
1. 列出项目 → 获取 project-id
bun run pipeline editor:navigator:projects
2. 打开项目(导航编辑器)
bun run pipeline editor:navigator:open --project-id
3. 切换到编辑器面板(navigator:open 会进入登录页面,而不是编辑器)
bun run pipeline editor:ui:switch-panel --panel video-edit
4. 列出媒体 → 获取 media-id 值
bun run pipeline editor:media:list --project-id --json
5. 导出时间轴 → 获取 track-id 和 element-id 值
bun run pipeline editor:timeline:export --project-id --json
现在您已拥有所有其他编辑器命令所需的 ID。
如何运行
bash
bun run pipeline [options] # 开发模式(推荐)
bun run electron/native-pipeline/cli/cli.ts [options] # 直接源码
qcut-pipeline [options] # 生产二进制文件
快速命令
bash
bun run pipeline list-models # 列出所有模型
bun run pipeline generate-image -t 黄金时刻的电影级肖像
bun run pipeline create-video -m kling26_pro -t 日落时分的海浪 -d 5s
bun run pipeline generate-avatar -m omnihumanv15 -t 你好世界 --image-url avatar.png
bun run pipeline analyze-video -i video.mp4 --analysis-type summary
bun run pipeline transcribe -i audio.mp3 --srt
bun run pipeline run-pipeline -c pipeline.yaml -i 日落 --no-confirm
bun run pipeline estimate-cost -m veo3 -d 8s
ViMax 快速入门
bash
bun run pipeline vimax:idea2video --idea 1920年代巴黎的侦探 -d 120
bun run pipeline vimax:script2video --script script.json --portraits registry.json
bun run pipeline vimax:novel2movie --novel book.txt --max-scenes 20
API 密钥设置
密钥存储在 ~/.qcut/.env(权限模式 0600)。
bash
bun run pipeline setup # 创建 .env 模板
bun run pipeline set-key --name FAL_KEY # 设置密钥(交互式)
bun run pipeline check-keys # 检查已配置的密钥
支持的密钥: FALKEY、GEMINIAPIKEY、GOOGLEAIAPIKEY、OPENROUTERAPIKEY、ELEVENLABSAPIKEY、OPENAIAPIKEY、RUNWAYAPIKEY、HEYGENAPIKEY、DIDAPIKEY、SYNTHESIAAPIKEY
统一 JSON 输出
所有命令都支持 --json,用于机器可读的输出,使用一致的封装格式:
bash
bun run pipeline generate-image -t 一只猫 --json
三种可能的封装格式:
| 状态 | 格式 | 时机 |
|---|
| ok | { status: ok, data: { ... } } | 命令成功 |
| error |
{ status: error, error: msg, code: cmd:failed } | 命令失败 |
| pending | { status: pending, jobId: abc-123 } | 异步任务已启动 |
完整的封装文档请参阅 REFERENCE.md。
3 级渐进式帮助(JSON)
CLI 在使用 --help --json 时提供三个级别的结构化帮助:
bash
级别 1:根级别 — 列出所有命令、类别、全局标志
bun run pipeline --help --json
级别 2:命令级别 — 标志(必需/可选)、示例、用法
bun run pipeline generate-image --help --json
级别 3:参数级别 — 类型、枚举值、默认值、描述
bun run pipeline generate-image --help model --json
每个级别返回一个 JSON 封装({ status: ok, data: { ... } })。
project.json — 代理可读的项目状态
两个 CLI 命令将完整的项目状态导出为结构化的 JSON:
bash
最小模式(约 200 个 token):仅计数和设置
bun run pipeline editor:project:info --project-id --json
完整模式(约 2000 个 token):设置 + media[] + subtitles[] + generated[] + exports[] + jobs[]
bun run pipeline editor:project:info --project-id --full --json
转储到磁盘
bun run pipeline editor:project:export-state --project-id
完整的 project.json 模式请参阅 editor-media.md。
全局选项
| 标志 | 简写 | 描述 |
|---|
| --output-dir | -o | 输出目录(默认:./output) |
| --model |
-m | 模型键 |
| --json | | 以 JSON 格式输出 |
| --quiet | -q | 抑制进度信息 |
| --verbose | -v | 调试日志 |
| --stream | | 在 stderr 上输出 JSONL 进度事件 |
| --help | -h | 打印帮助 |
| --session | | 会话模式:从 stdin 读取命令 |
| --skip-health | | 跳过编辑器健康检查 |
| --no-capability-check | | 跳过每次请求的能力警告 |
关键源文件
| 组件 | 文件 |
|---|
| CLI 入口点 | electron/native-pipeline/cli/cli.ts |
| 命令路由器 |
electron/native-pipeline/cli/cli-runner/runner.ts |
| 命令注册表(核心) | electron/native-pipeline/cli/command-registry.ts |
| 命令注册表(编辑器) | electron/native-pipeline/cli/command-registry-editor.ts |
| 命令注册表类型 | electron/native-pipeline/cli/command-registry-types.ts |
| JSON 输出辅助工具 | electron/native-pipeline/cli/json-output.ts |
| project.json 类型 | electron/native-pipeline/cli