Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

All notable changes to capcut-cli are documented here. The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/); the project follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.37.1] - 2026-11-23

### Fixed
- The Chinese command reference (`docs/command-reference.zh-CN.md`) lists every command `capcut describe` knows, `dub`, `matting`, `catalogue` and `detect-retakes` among them, with current usages; it is generated with the English reference and checked against `describe` like it.
- The Windows relocation check of the portable archive waits for Windows to release the folder after the bundled runtime exits, instead of failing on a momentary lock.

## [0.37.0] - 2026-11-22

### Added
Expand Down
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,16 @@ npm install -g capcut-cli

### Portable downloads without installing Node or npm

Download `capcut-cli-v0.37.0-linux-x64.tar.gz` and its `.sha256` file from the [release assets](https://github.com/renezander030/capcut-cli/releases). Verify and extract them together:
Download `capcut-cli-v0.37.1-linux-x64.tar.gz` and its `.sha256` file from the [release assets](https://github.com/renezander030/capcut-cli/releases). Verify and extract them together:

```sh
sha256sum -c capcut-cli-v0.37.0-linux-x64.tar.gz.sha256
tar -xzf capcut-cli-v0.37.0-linux-x64.tar.gz
./capcut-cli-v0.37.0-linux-x64/capcut --version
./capcut-cli-v0.37.0-linux-x64/capcut describe --compact
sha256sum -c capcut-cli-v0.37.1-linux-x64.tar.gz.sha256
tar -xzf capcut-cli-v0.37.1-linux-x64.tar.gz
./capcut-cli-v0.37.1-linux-x64/capcut --version
./capcut-cli-v0.37.1-linux-x64/capcut describe --compact
```

On Linux arm64 (aarch64), choose `capcut-cli-v0.37.0-linux-arm64.tar.gz` and its matching `.sha256` file, then use the same verification and extraction commands with that filename. Use the archive matching the machine architecture; these archives bundle Node, not ffmpeg or the desktop editor.
On Linux arm64 (aarch64), choose `capcut-cli-v0.37.1-linux-arm64.tar.gz` and its matching `.sha256` file, then use the same verification and extraction commands with that filename. Use the archive matching the machine architecture; these archives bundle Node, not ffmpeg or the desktop editor.

Keep the whole extracted directory together; it includes the Node runtime and its license. Both `capcut` and `capcut-cli` launchers work after moving the directory. Linux archives target x64 or arm64 with glibc (not Alpine/musl); optional FFmpeg/Whisper tools remain separate. This is a portable directory, not a single-file executable.

Expand All @@ -52,18 +52,18 @@ You can add the extracted directory to `PATH` or create symbolic links to `capcu
On macOS, choose `darwin-arm64` for Apple Silicon or `darwin-x64` for Intel. Download the matching archive and checksum from the same release, then verify and extract them (Apple Silicon example):

```sh
shasum -a 256 -c capcut-cli-v0.37.0-darwin-arm64.tar.gz.sha256
tar -xzf capcut-cli-v0.37.0-darwin-arm64.tar.gz
./capcut-cli-v0.37.0-darwin-arm64/capcut --version
shasum -a 256 -c capcut-cli-v0.37.1-darwin-arm64.tar.gz.sha256
tar -xzf capcut-cli-v0.37.1-darwin-arm64.tar.gz
./capcut-cli-v0.37.1-darwin-arm64/capcut --version
```

On Windows x64 (from release 0.37.0 on), download `capcut-cli-v0.37.0-win-x64.zip` and its `.sha256` file. In PowerShell, compare the hash with the one in the `.sha256` file, extract, and run the `capcut.cmd` launcher:
On Windows x64 (from release 0.37.1 on), download `capcut-cli-v0.37.1-win-x64.zip` and its `.sha256` file. In PowerShell, compare the hash with the one in the `.sha256` file, extract, and run the `capcut.cmd` launcher:

```powershell
(Get-FileHash capcut-cli-v0.37.0-win-x64.zip -Algorithm SHA256).Hash.ToLower()
Get-Content capcut-cli-v0.37.0-win-x64.zip.sha256
Expand-Archive capcut-cli-v0.37.0-win-x64.zip -DestinationPath .
.\capcut-cli-v0.37.0-win-x64\capcut.cmd --version
(Get-FileHash capcut-cli-v0.37.1-win-x64.zip -Algorithm SHA256).Hash.ToLower()
Get-Content capcut-cli-v0.37.1-win-x64.zip.sha256
Expand-Archive capcut-cli-v0.37.1-win-x64.zip -DestinationPath .
.\capcut-cli-v0.37.1-win-x64\capcut.cmd --version
```

The folder holds the official Node runtime (`runtime\node.exe` and its license); `capcut.cmd` and `capcut-cli.cmd` work from any location, also with spaces in the path, and you can add the folder to `PATH`. Arguments pass through `cmd.exe`, so quote values containing `&`, `|`, `<`, `>` or `^`. Every release builds this archive on a Windows runner and runs it there before publishing.
Expand Down
2 changes: 1 addition & 1 deletion docs/command-reference.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "capcut-cli",
"version": "0.37.0",
"version": "0.37.1",
"schema_version": 2,
"description": "Edit CapCut/JianYing draft_content.json directly. JSON in, JSON out.",
"global_flags": [
Expand Down
24 changes: 14 additions & 10 deletions docs/command-reference.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,16 @@
| `opacity` | `capcut opacity <project> <id> <alpha>` | 是 | 设置片段不透明度(0.0-1.0)。 |
| `export-srt` | `capcut export-srt <project> [options]` | 否 | 把字幕导出为 SRT 或 WebVTT(输出到 stdout),按行或按词。 |
| `export-ass` | `capcut export-ass <project> [--karaoke] [--out <file.ass>]` | 否 | 把带样式的 ASS 字幕导出到 stdout 或 --out,支持按区间的样式覆盖;--karaoke 输出逐词时间。 |
| `export-timeline` | `capcut export-timeline <project> [--out <file.otio>]` | 否 | 把视频/音频轨道导出为 OpenTimelineIO JSON,交接给 NLE(DaVinci Resolve 原生导入 .otio)。 |
| `export-timeline` | `capcut export-timeline <project> [--out <file.otio>] [--captions skip\|markers]` | 否 | 把视频/音频轨道导出为 OpenTimelineIO JSON,交接给 NLE(DaVinci Resolve 原生导入 .otio)。 |
| `import-timeline` | `capcut import-timeline <file.otio> (--out <new-project> \| --into <project>)` | 是 | 导入 OpenTimelineIO JSON,把嵌套的 Timeline/Stack/Track 展平,生成新草稿(--out)或追加到已有草稿(--into);不支持的 OTIO 特性一律报告,绝不静默丢弃。 |
| `materials` | `capcut materials <project> [--type <type>]` | 否 | 列出素材类型与数量;用 --type 过滤。 |
| `segment` | `capcut segment <project> <id>` | 否 | 单个片段及其素材的完整详情。 |
| `material` | `capcut material <project> <id>` | 否 | 单个素材的完整详情。 |
| `add-audio` | `capcut add-audio <project> <file-or-url> <start> [duration] [options]` | 是 | 在音频轨道上添加本地或 Wikimedia 音频文件。 |
| `add-video` | `capcut add-video <project> <file-or-url> <start> [duration] [options]` | 是 | 在视频轨道上添加本地或 Wikimedia 视频/图片。 |
| `add-text` | `capcut add-text <project> <start> <duration> <text> [options]` | 是 | 添加文本片段,带字体/颜色/位置选项。 |
| `tts` | `capcut tts <project> [start] [duration] (--text <string> \| --text-file <path>) --tts-cmd <template> [options]` | 是 | 通过本地 TTS 命令(--tts-cmd)从文本合成配音,并作为音频片段添加。 |
| `tts` | `capcut tts <project> [start] [duration] (--text <string> \| --text-file <path>) --tts-cmd <template> [--lexicon <file>] [options]` | 是 | 通过本地 TTS 命令(--tts-cmd)从文本合成配音,并作为音频片段添加。 |
| `dub` | `capcut dub <project> <subtitles.srt\|.vtt> --tts-cmd <template> [--lexicon <file>] [--trim-overlap] [options]` | 是 | 为字幕轨配音:通过本地 TTS 命令(--tts-cmd)为每条 SRT 或 WebVTT 字幕生成一段音频,放在该字幕的起点。 |
| `crop` | `capcut crop <project> <segment-id> [--ratio <r> \| --rect <x,y,w,h> \| --reset]` | 是 | 读取或设置视频/图片片段的源素材裁剪(--ratio 预设、--rect x,y,w,h 或 --reset)。 |
| `cut` | `capcut cut <project> <start> <end> --out <path>` | 是 | 把一段时间范围提取为一个独立的新草稿。 |
| `duplicate` | `capcut duplicate <project> <segment-id> [--track <track-name>] [--new-track]` | 是 | 在相同的时间线位置,把片段复制到源轨道上方的轨道。 |
Expand All @@ -55,17 +56,18 @@
| `apply-template` | `capcut apply-template <project> <template> <start> <duration> [text] [options]` | 是 | 用新的时间/文本把模板盖印到项目里。 |
| `make-preset` | `capcut make-preset <project> <text-segment-id> --out <preset.json>` | 否 | 把文本片段的样式提取为可复用的预设 JSON(通过 --preset 应用)。 |
| `templates` | `capcut templates <project>` | 否 | 列出内置的可复用模板。 |
| `batch` | `capcut batch <project> [--continue-on-error] < operations.jsonl` | 是 | 从 stdin(JSONL)批量执行多个编辑,只写一次文件。 |
| `import-srt` | `capcut import-srt <project> <srt-or-> [options]` | 是 | 导入 SRT 文件/stdin,每条字幕生成一个文本片段。 |
| `batch` | `capcut batch <project> [--continue-on-error] [--plan <plan.json>] < operations.jsonl \| capcut batch <project> --apply-plan <plan.json>` | 是 | 从 stdin(JSONL)批量执行多个编辑,只写一次文件。 |
| `import-srt` | `capcut import-srt <project> <srt-or-vtt-or-> [options]` | 是 | 导入 SRT 文件/stdin,每条字幕生成一个文本片段。 |
| `import-ass` | `capcut import-ass <project> <ass-or-> [options]` | 是 | 把 ASS/SSA 字幕文件导入为文本片段,并把内联覆盖标签保留为按区间的样式。 |
| `text-ranges` | `capcut text-ranges <project> <id> --styles <json-or-@file>` | 是 | 为文本片段应用字节级精确的多样式区间。 |
| `caption` | `capcut caption <project> (--audio <path> \| --from-segment <id>) [options]` | 是 | 用 whisper 转写音频,生成真正的字幕轨道片段;支持音轨选择、脚本匹配门槛和逐词显现。 |
| `caption` | `capcut caption <project> (--audio <path> \| --from-segment <id> \| --words <file.json\|->) [options]` | 是 | 用 whisper 转写音频,生成真正的字幕轨道片段;支持音轨选择、脚本匹配门槛和逐词显现。 |
| `translate` | `capcut translate <project> --to <language> --out <path> [options]` | 是 | 通过 Anthropic API 把草稿克隆为另一种语言。 |
| `migrate` | `capcut migrate <project> --from <version> --to <version>` | 是 | 在版本边界之间应用已知的 schema 迁移。 |
| `migrate` | `capcut migrate <project> (--from <version> --to <version> \| --like <project> \| --from-store)` | 是 | 在版本边界之间应用已知的 schema 迁移。 |
| `add-sfx` | `capcut add-sfx <project> <slug> <start> <duration> [options]` | 是 | 在专用轨道上添加音效。 |
| `chroma` | `capcut chroma <project> <id> (--color <hex> \| --off) [options]` | 是 | 对视频片段做绿幕/色度抠像,或 --off 关闭。 |
| `matting` | `capcut matting <project> <id> [--off]` | 是 | 对视频/图片片段的素材开启智能抠像(去除背景)—— 标志 3 为开启;--off 写入文档记载的标志 0 对象。 |
| `prune` | `capcut prune <project>` | 是 | 删除没有任何片段引用的素材。 |
| `register` | `capcut register <project-dir> [--apply] [--drafts <dir>]` | 是 | 从只读的 draft_content.json 修复已有草稿的注册元数据(draft_meta_info.json + root_meta_info.json 条目),让 CapCut 应用能列出它(默认只出计划;--apply 写入并留 .bak)。 |
| `register` | `capcut register <project-dir> [--apply] [--materials] [--drafts <dir>]` | 是 | 从只读的 draft_content.json 修复已有草稿的注册元数据(draft_meta_info.json + root_meta_info.json 条目),让 CapCut 应用能列出它(默认只出计划;--apply 写入并留 .bak)。 |
| `rename` | `capcut rename <project> <new-name> [--drafts <dir>]` | 是 | 在创建后重命名草稿:磁盘上的文件夹,加上 draft_meta_info.json 和存储 root_meta_info.json 条目里的 draft_name 及所有自引用路径,事务性完成(目标文件夹已存在时拒绝)。 |
| `relink` | `capcut relink <project> (--dir <path> [--recursive] \| --from <prefix> --to <prefix>) [--stage]` | 是 | 修复失效的媒体路径(--dir 可递归搜索;同名歧义会报告并保持原路径;--from/--to 按路径边界映射)。 |
| `replace-media` | `capcut replace-media <project> <segment-id> <new-file> [--retime]` | 是 | 替换片段的源文件(占位素材 → 成片素材),保留其时间、特效与关键帧。 |
Expand All @@ -77,19 +79,21 @@
| `describe` | `capcut describe [--compact] [--command <name>]` | 否 | 以 JSON 输出命令契约;可按命令名筛选,或输出精简的命令发现索引。 |
| `completions` | `capcut completions <bash\|zsh\|fish>` | 否 | 生成 shell 补全(bash\|zsh\|fish)。 |
| `enums` | `capcut enums <category-flag> [--jianying]` | 否 | 按类别列出枚举 slug(转场、蒙版、特效等)。 |
| `catalogue` | `capcut catalogue <query> [--kind <category>] [--limit <n>] [--jianying]` | 否 | 按名称在所有类别(含已采集条目)中查找资源 id。 |
| `harvest-enums` | `capcut harvest-enums [<project> \| --sync \| --add <kind> <slug> <resource-id>] [--apply] [--catalogue <path>]` | 否 | 把商店资源 ID 学习进用户级素材目录:来源可以是单个草稿、整个草稿库(--sync),或手动添加(--add)。 |
| `doctor` | `capcut doctor [--drafts <dir>]` | 否 | 环境预检(Node、whisper、API key、项目目录),并统计草稿目录中可读 / 无标记 / 已加密 / 无法读取的项目。 |
| `diagnose` | `capcut diagnose <project> [--bundle <report.json>]` | 否 | 检查草稿的规范文件、文件间分歧与编辑器写入安全性。 |
| `fixture` | `capcut fixture <project> --out <dir> [--anonymize] [--check]` | 否 | 构建可分享、已脱敏的兼容性包(仅时间线 JSON),用于版本支持 issue,内含蒙版关键帧证据报告(#44)。 |
| `sync-timelines` | `capcut sync-timelines <project-dir> [--apply]` | 是 | 从只读的 draft_content.json 出发,协调已漂移的时间线镜像文件(template-2.tmp、draft_info.json)(默认输出带 mtime 的计划;--apply 只重写发生漂移的镜像)。 |
| `sync-timelines` | `capcut sync-timelines <project-dir> [--nested] [--apply]` | 是 | 从只读的 draft_content.json 出发,协调已漂移的时间线镜像文件(template-2.tmp、draft_info.json)(默认输出带 mtime 的计划;--apply 只重写发生漂移的镜像)。 |
| `restore` | `capcut restore <project> [--step <number> \| --list]` | 是 | 从 .bak / 快照历史撤销写入(--step N、--list)。 |
| `serve` | `capcut serve [--queue <path>] [options]` | 否 | 从 stdin/--queue 运行无状态的 JSONL 任务队列。 |
| `decrypt` | `capcut decrypt <project-or-file>` | 否 | 检测剪映 6.0+ 加密并说明应对方法。 |
| `export` | `capcut export <drafts-dir> --batch [options]` | 是 | 实验性的 UI 自动化渲染队列(macOS)。 |
| `init` | `capcut init <name> [--template <dir>] [--drafts <dir>]` | 是 | 从模板创建一个新的空草稿。 |
| `quickstart` | `capcut quickstart <name> [--video <f>] [--audio <f>] [--srt <f>] [--drafts <dir>]` | 是 | 一条命令生成第一个草稿:创建 + 添加一个素材 + lint + 打印“在 CapCut 中打开”的步骤。 |
| `init` | `capcut init <name> [--template auto\|bundled\|<dir>] [--drafts <dir>] [--ratio <r> \| --width <px> --height <px>]` | 是 | 从模板创建一个新的空草稿。 |
| `quickstart` | `capcut quickstart <name> [--video <f>] [--audio <f>] [--srt <f>] [--drafts <dir>] [--template auto\|bundled\|<dir>] [--ratio <r> \| --width <px> --height <px>]` | 是 | 一条命令生成第一个草稿:创建 + 添加一个素材 + lint + 打印“在 CapCut 中打开”的步骤。 |
| `compile` | `capcut compile <spec.json> [--out <draftdir> \| --into <project>] [--template auto\|bundled\|<dir>] [--data <rows.jsonl\|->] [--check \| --plan]` | 是 | 从声明式 JSON spec 构建草稿;`--into` 填充应用创建的空项目,保留项目身份和注册信息。 |
| `render` | `capcut render <project> [--out <preview.mp4>] [options]` | 否 | 渲染低清 ffmpeg 代理预览(裁剪+变速+音频,--burn-captions);支持 --crf / --video-bitrate,大型滤镜图自动走脚本文件;不是 CapCut 的最终渲染。 |
| `loudness` | `capcut loudness <project> [--target <lufs>] [--per-clip] [--max-gain-db <db>] [--apply] [--tolerance <lu>] [--max-true-peak <dbtp>]` | 否 | 测量每个有声片段的响度(EBU R128);配合 --target 计算并写入使导出达到目标响度的增益;--tolerance / --max-true-peak 作为交付门槛,未达标时退出码为 1。 |
| `detect-scenes` | `capcut detect-scenes <video> [options]` | 否 | 检测视频中的场景切换切点(ffmpeg scene 滤镜);输出切点与片段列表,供 compile/cut 使用。 |
| `detect-silence` | `capcut detect-silence <media> [options]` | 否 | 检测媒体文件中的静音区间(ffmpeg silencedetect);输出静音与保留片段列表,供 compile/cut 使用。 |
| `detect-retakes` | `capcut detect-retakes <project> [--track-name <s>] [--window <s>] [--similarity <n>] [--min-words <n>] \| --srt <file>` | 否 | 在草稿字幕(或 SRT)中查找重复录制的片段:基于窗口的词序列相似度,保留后一次录制;输出切点与保留片段,供 compile/cut 使用。 |
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "capcut-cli",
"version": "0.37.0",
"version": "0.37.1",
"description": "Independent, unofficial CLI to create and edit CapCut projects — build drafts from scratch, add video/audio/text, subtitles, timing, speed, volume, templates, cut long-form to shorts. No API needed. Not affiliated with ByteDance.",
"type": "module",
"bin": {
Expand Down
Loading
Loading