cli-anything-shotcut
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesecli-anything-shotcut
cli-anything-shotcut
A stateful command-line interface for video editing, built on the MLT XML format. Designed for AI agents and power users who need to create and edit Shotcut projects without a GUI.
一款基于MLT XML格式的有状态视频编辑命令行界面,专为AI代理和无需GUI即可创建、编辑Shotcut项目的高级用户设计。
Installation
安装
This CLI is installed as part of the cli-anything-shotcut package:
bash
pip install cli-anything-shotcutPrerequisites:
- Python 3.10+
- shotcut must be installed on your system
该CLI作为cli-anything-shotcut包的一部分进行安装:
bash
pip install cli-anything-shotcut前置要求:
- Python 3.10+
- 系统中必须安装Shotcut
Usage
使用
Basic Commands
基础命令
bash
undefinedbash
undefinedShow help
显示帮助信息
cli-anything-shotcut --help
cli-anything-shotcut --help
Start interactive REPL mode
启动交互式REPL模式
cli-anything-shotcut
cli-anything-shotcut
Create a new project
创建新项目
cli-anything-shotcut project new -o project.json
cli-anything-shotcut project new -o project.json
Run with JSON output (for agent consumption)
以JSON格式输出(供代理使用)
cli-anything-shotcut --json project info -p project.json
undefinedcli-anything-shotcut --json project info -p project.json
undefinedREPL Mode
REPL模式
When invoked without a subcommand, the CLI enters an interactive REPL session:
bash
cli-anything-shotcut当不指定子命令调用时,CLI会进入交互式REPL会话:
bash
cli-anything-shotcutEnter commands interactively with tab-completion and history
交互式输入命令,支持自动补全和历史记录
The REPL exposes the same practical helpers as command mode, including
`add-clip ... --at`, `volume-envelope`, and `duck`.
REPL提供与命令模式相同的实用辅助功能,包括`add-clip ... --at`、`volume-envelope`和`duck`。Command Groups
命令组
Project
项目管理
Project management: new, open, save, info.
| Command | Description |
|---|---|
| Create a new blank project |
| Open an existing .mlt project file |
| Save the current project |
| Show detailed project information |
| List available video profiles |
| Print the raw MLT XML of the current project |
项目管理命令:新建、打开、保存、信息查看。
| 命令 | 描述 |
|---|---|
| 创建新的空白项目 |
| 打开现有的.mlt项目文件 |
| 保存当前项目 |
| 显示详细的项目信息 |
| 列出可用的视频配置文件 |
| 打印当前项目的原始MLT XML内容 |
Timeline
时间轴
Timeline operations: tracks, clips, trimming.
| Command | Description |
|---|---|
| Show the timeline overview |
| List all tracks |
| Add a new track to the timeline |
| Remove a track by index |
| Add a media clip to a track; supports |
| Remove a clip from a track |
| Move a clip between tracks or positions |
| Trim a clip's in/out points |
| Split a clip into two at the given timecode |
| List all clips on a track |
| Add a blank gap to a track |
| Set a track's display name |
| Mute or unmute a track |
| Hide or unhide a video track |
时间轴操作命令:轨道、剪辑、修剪。
| 命令 | 描述 |
|---|---|
| 显示时间轴概览 |
| 列出所有轨道 |
| 向时间轴添加新轨道 |
| 通过索引删除轨道 |
| 向轨道添加媒体剪辑;支持 |
| 从轨道删除剪辑 |
| 在轨道间或不同位置移动剪辑 |
| 修剪剪辑的入点/出点 |
| 在指定时间码处将剪辑分割为两段 |
| 列出轨道上的所有剪辑 |
| 向轨道添加空白间隙 |
| 设置轨道的显示名称 |
| 静音或取消静音轨道 |
| 隐藏或取消隐藏视频轨道 |
Filter Group
滤镜组
Filter operations: add, remove, configure effects.
| Command | Description |
|---|---|
| List all available filters |
| Show detailed info about a filter and its parameters |
| Add a filter to a clip, track, or globally |
| Remove a filter by index |
| Set a parameter on a filter |
| Create or replace a keyframed volume envelope on a track or clip |
| Build a practical ducking envelope over one or more time windows |
| List active filters on a target |
滤镜操作命令:添加、删除、配置效果。
| 命令 | 描述 |
|---|---|
| 列出所有可用滤镜 |
| 显示滤镜及其参数的详细信息 |
| 向剪辑、轨道或全局添加滤镜 |
| 通过索引删除滤镜 |
| 设置滤镜的参数 |
| 为轨道或剪辑创建或替换关键帧音量包络 |
| 在一个或多个时间窗口上构建实用的闪避包络 |
| 列出目标上的所有激活滤镜 |
Media
媒体
Media operations: probe, list, check files.
| Command | Description |
|---|---|
| Analyze a media file's properties |
| List all media clips in the current project |
| Check all media files for existence |
| Generate a thumbnail from a video file |
媒体操作命令:探测、列出、检查文件。
| 命令 | 描述 |
|---|---|
| 分析媒体文件的属性 |
| 列出当前项目中的所有媒体剪辑 |
| 检查所有媒体文件是否存在 |
| 从视频文件生成缩略图 |
Export
导出
Export/render operations.
| Command | Description |
|---|---|
| List available export presets |
| Show details of an export preset |
| Render the project to a video file |
导出/渲染操作命令。
| 命令 | 描述 |
|---|---|
| 列出可用的导出预设 |
| 显示导出预设的详细信息 |
| 将项目渲染为视频文件 |
Transition Group
转场组
Transition operations: dissolve, wipe, and other transitions.
| Command | Description |
|---|---|
| List all available transition types |
| Show detailed info about a transition type |
| Add a transition between two tracks |
| Remove a transition by index |
| Set a parameter on a transition |
| List all transitions on the timeline |
转场操作命令:溶解、擦除及其他转场效果。
| 命令 | 描述 |
|---|---|
| 列出所有可用的转场类型 |
| 显示转场类型的详细信息 |
| 在两个轨道间添加转场 |
| 通过索引删除转场 |
| 设置转场的参数 |
| 列出时间轴上的所有转场 |
Composite Group
合成组
Compositing: blend modes, PIP, opacity.
| Command | Description |
|---|---|
| List all available blend modes |
| Set the blend mode for a track |
| Get the current blend mode for a track |
| Set the opacity of a track (0.0-1.0) |
| Set picture-in-picture position for a clip |
合成操作命令:混合模式、画中画、透明度。
| 命令 | 描述 |
|---|---|
| 列出所有可用的混合模式 |
| 设置轨道的混合模式 |
| 获取轨道当前的混合模式 |
| 设置轨道的透明度(0.0-1.0) |
| 设置剪辑的画中画位置 |
Session
会话
Session management: status, undo, redo.
| Command | Description |
|---|---|
| Show current session status |
| Undo the last operation |
| Redo the last undone operation |
| Save session state to disk |
| List all saved sessions |
会话管理命令:状态、撤销、重做。
| 命令 | 描述 |
|---|---|
| 显示当前会话状态 |
| 撤销上一次操作 |
| 重做上一次撤销的操作 |
| 将会话状态保存到磁盘 |
| 列出所有已保存的会话 |
Examples
示例
Create a New Project
创建新项目
Create a new shotcut project file.
bash
cli-anything-shotcut project new -o myproject.json创建新的Shotcut项目文件。
bash
cli-anything-shotcut project new -o myproject.jsonOr with JSON output for programmatic use
或以JSON格式输出供程序化使用
cli-anything-shotcut --json project new -o myproject.json
undefinedcli-anything-shotcut --json project new -o myproject.json
undefinedInteractive REPL Session
交互式REPL会话
Start an interactive session with undo/redo support.
bash
cli-anything-shotcut启动支持撤销/重做功能的交互式会话。
bash
cli-anything-shotcutEnter commands interactively
交互式输入命令
Use 'help' to see available commands
使用'help'查看可用命令
Use 'undo' and 'redo' for history navigation
使用'undo'和'redo'导航历史操作
undefinedundefinedExport Project
导出项目
Export the project to a final output format.
bash
cli-anything-shotcut --project myproject.json export render output.mp4 --overwrite将项目导出为最终输出格式。
bash
cli-anything-shotcut --project myproject.json export render output.mp4 --overwriteDeterministic Timeline Reconstruction
确定性时间轴重建
For rebuilds, prefer absolute placement over append-only clip insertion:
bash
cli-anything-shotcut --project myproject.json -s timeline add-clip intro.mp4 \
--track 1 --in 00:00:00.000 --out 00:00:04.000 --at 00:00:00.000
cli-anything-shotcut --project myproject.json -s timeline add-clip broll.mp4 \
--track 1 --in 00:00:10.000 --out 00:00:16.000 --at 00:00:08.000Notes:
- inserts blanks automatically when the target time lands in empty space.
--at - The CLI rejects overlap with an existing clip instead of silently changing the timeline.
- For agent-built timelines, prefer explicit and
--invalues so later absolute placement remains unambiguous.--out
重建时,优先使用绝对位置而非仅追加插入剪辑:
bash
cli-anything-shotcut --project myproject.json -s timeline add-clip intro.mp4 \
--track 1 --in 00:00:00.000 --out 00:00:04.000 --at 00:00:00.000
cli-anything-shotcut --project myproject.json -s timeline add-clip broll.mp4 \
--track 1 --in 00:00:10.000 --out 00:00:16.000 --at 00:00:08.000注意:
- 参数会在目标时间处于空白区域时自动插入空白片段。
--at - CLI会拒绝与现有剪辑重叠的操作,而非静默修改时间轴。
- 对于AI代理构建的时间轴,优先使用明确的和
--in值,以便后续的绝对位置操作保持明确。--out
Audio Automation
音频自动化
The released CLI now includes higher-level audio automation helpers:
bash
cli-anything-shotcut --project myproject.json -s filter volume-envelope \
--track 2 \
--point 00:00:00.000=1.0 \
--point 00:00:03.000=0.35 \
--point 00:00:05.000=1.0
cli-anything-shotcut --project myproject.json -s filter duck \
--track 2 \
--window 00:00:06.000:00:00:09.000 \
--window 00:00:15.000:00:00:18.000 \
--normal 1.0 --duck 0.25 \
--attack 00:00:00.150 --release 00:00:00.250Keyframed filters now export as ffmpeg expressions instead of
collapsing to a simple fade. This is materially better, but you should still
review final renders when automation is editorially important.
volumevolume=发布的CLI现在包含更高级的音频自动化辅助功能:
bash
cli-anything-shotcut --project myproject.json -s filter volume-envelope \
--track 2 \
--point 00:00:00.000=1.0 \
--point 00:00:03.000=0.35 \
--point 00:00:05.000=1.0
cli-anything-shotcut --project myproject.json -s filter duck \
--track 2 \
--window 00:00:06.000:00:00:09.000 \
--window 00:00:15.000:00:00:18.000 \
--normal 1.0 --duck 0.25 \
--attack 00:00:00.150 --release 00:00:00.250关键帧滤镜现在会导出为ffmpeg的表达式,而非简化为简单的淡入淡出。这一改进效果显著,但当自动化对编辑至关重要时,仍需检查最终渲染结果。
volumevolume=State Management
状态管理
The CLI maintains session state with:
- Undo/Redo: Up to 50 levels of history
- Project persistence: Save/load project state as JSON
- Session tracking: Track modifications and changes
CLI通过以下方式维护会话状态:
- 撤销/重做:最多支持50级历史记录
- 项目持久化:以JSON格式保存/加载项目状态
- 会话跟踪:跟踪修改和变更
Output Formats
输出格式
All commands support dual output modes:
- Human-readable (default): Tables, colors, formatted text
- Machine-readable (flag): Structured JSON for agent consumption
--json
bash
undefined所有命令支持两种输出模式:
- 人类可读格式(默认):表格、颜色、格式化文本
- 机器可读格式(标志):结构化JSON,供代理使用
--json
bash
undefinedHuman output
人类可读输出
cli-anything-shotcut project info -p project.json
cli-anything-shotcut project info -p project.json
JSON output for agents
供代理使用的JSON输出
cli-anything-shotcut --json project info -p project.json
undefinedcli-anything-shotcut --json project info -p project.json
undefinedFor AI Agents
面向AI代理
When using this CLI programmatically:
- Always use flag for parseable output
--json - Check return codes - 0 for success, non-zero for errors
- Parse stderr for error messages on failure
- Use absolute paths for all file operations
- Verify outputs exist after export operations
- Prefer when recreating a known edit
timeline add-clip --at - Review final renders after keyframed volume or ducking changes
程序化使用本CLI时:
- 始终使用标志以获得可解析的输出
--json - 检查返回码——0表示成功,非0表示错误
- 解析stderr以获取失败时的错误信息
- 使用绝对路径进行所有文件操作
- 导出操作后验证输出是否存在
- 重建已知编辑时优先使用
timeline add-clip --at - 关键帧音量或闪避变更后检查最终渲染结果
More Information
更多信息
- Full documentation: See README.md in the package
- Test coverage: See TEST.md in the package
- Methodology: See HARNESS.md in the cli-anything-plugin
- 完整文档:查看包中的README.md
- 测试覆盖率:查看包中的TEST.md
- 方法学:查看cli-anything-plugin中的HARNESS.md
Version
版本
1.0.0
1.0.0