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.
Installation
This CLI is installed as part of the cli-anything-shotcut package:
Prerequisites:
- Python 3.10+
melt(MLT CLI) — required for rendering and playbackffmpeg/ffprobe— required for media probingshotcutmust be installed on your system
Usage
Basic Commands
REPL Mode
When invoked without a subcommand, the CLI enters an interactive REPL session with undo/redo support:
REPL Commands
Workflow: Always media import first to get a clip_id, then use add-clip to place it on the timeline.
Project & Session:
new [profile]— Create new project (default:hd1080p30)open <path>— Open.mltfilesave [path]— Save projectinfo— Show project infoxml— Print raw MLT XMLstatus— Show session statusundo/redo— Navigate operation history
Media (two-step model):
media import <file> [--caption name]— Import file into project bin, returnsclip_id(e.g.,clip0)media— List all imported mediaprobe <file>— Analyze a media file
Timeline:
add-track <video|audio> [name]— Add a tracktracks— List all tracksshow— Visual timeline overviewadd-clip <clip_id> <track> [in] [out] [--at time]— Place imported clip on trackclips <track>— List clips on a trackremove-clip <track> <clip>— Remove a cliptrim <track> <clip> [--in tc] [--out tc]— Trim clipsplit <track> <clip> <at>— Split clip at timecode
Filters:
list-filters [video|audio]— Browse available filtersfilter-info <name>— Show filter detailsadd-filter <name> [--track n] [--clip n] [key=val ...]— Add filter to clip, track, or globalfilters [--track n] [--clip n]— List active filtersremove-filter <idx> [--track n] [--clip n]— Remove filter by indexset-filter <idx> <param> <value> [--track n] [--clip n]— Set filter parametervolume-envelope [--track n] [--clip n] TIME=LEVEL ...— Keyframed volume (e.g.,00:00:00.000=1.0 00:00:03.000=0.35)duck [--track n] [--clip n] START..END ...— Ducking envelope (e.g.,00:00:06.000..00:00:09.000)
Export:
presets— List export presetsrender <output> [--preset name]— Render to video file
Command Groups
Project
Project management: new, open, save, info.
Timeline
Timeline operations: tracks, clips, trimming.
Filter Group
Filter operations: add, remove, configure effects.
Media
Media operations: probe, list, check files.
Export
Export/render operations.
Transition Group
Transition operations: dissolve, wipe, and other transitions.
Composite Group
Compositing: blend modes, PIP, opacity.
Session
Session management: status, undo, redo.
Preview
Preview bundles and live preview sessions for iterative editing review.
Typical quick bundle contents:
preview.mp4- several sampled frames
- midpoint
hero.png summary.jsonwith project facts
Poll mode is supported:
preview live status --json includes session refs and a compact
trajectory_summary so agents can cheaply understand the latest few publishes.
Viewer commands:
Examples
Create a New Project
Create a new shotcut project file.
Interactive REPL Session
Start an interactive session with undo/redo support.
Export Project
Export the project to a final output format.
Deterministic Timeline Reconstruction
For rebuilds, prefer absolute placement over append-only clip insertion:
--atinserts blanks automatically when the target time lands in empty space.- The CLI rejects overlap with an existing clip.
- Prefer explicit
--inand--outvalues so later absolute placement remains unambiguous.
Audio Automation
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
Output Formats
All commands support dual output modes:
- Human-readable (default): Tables, colors, formatted text
- Machine-readable (
--jsonflag): Structured JSON for agent consumption
For AI Agents
When using this CLI programmatically:
- Always use
--jsonflag for parseable output - 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
timeline add-clip --atwhen recreating a known edit - Review final renders after keyframed volume or ducking changes
- Use
preview captureorpreview live ...to validate pacing, cuts, and filter effects visually - Read returned artifact paths such as
hero.pngandpreview.mp4; JSON payloads reference files on disk - Use
preview live status --jsonbefore reading the fulltrajectory.json - Use
cli-hub previews ...only to inspect/open existing bundles or live sessions
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
Version
1.0.0

