How to Use OpenShot 4.1's CLI: Script Video Edits From the Terminal
CodexFuse Team · 2026-11-06T13:45:09.370Z · 21 min read min read
How to Use OpenShot 4.1's CLI: Script Video Edits From the Terminal
Learning how to use the OpenShot 4.1 CLI takes about twenty minutes if you install the current 4.1.1 release and follow the arc below. OpenShot 4.1 adds an experimental command-line interface, openshot-cli, that turns the free video editor into a scriptable tool, so you can import footage, trim clips, apply presets, add text, and export a finished video without clicking through the timeline. This openshot cli tutorial follows the full arc, from install to a headless export, with every command taken from the official docs and the release announcement.
To use the OpenShot 4.1 CLI, start a session, import your media, add a clip to the timeline with a trim, and export with the wait flag. You type one command per edit, and every command returns structured JSON with IDs you can feed into the next command. The CLI works beside the open editor or headless on a server, so the same commands drive a desktop session and a batch job.
All facts in this guide are as of November 2026, and the current release is OpenShot 4.1.1, published 2 November 2026, so install 4.1.1, not 4.1.0. OpenShot announced 4.1 on 25 October 2026, and packaged releases reached download channels around 31 October 2026, which is why news dates differ by a few days. CodexFuse offers no OpenShot tool, so this guide teaches the open-source editor itself, step by step, with every version and command taken from the official blog, the user guide, and the project repository.
What Is the OpenShot 4.1 CLI, Exactly?
The OpenShot 4.1 CLI is an experimental command-line interface that exposes the full timeline editor as terminal commands. You start a session, then import files, add and trim clips, apply effects and the same Motion, Look, Speed, Repeat, and Waveform presets as the clip menu, set keyframes, add text, and export.
Every command returns structured JSON, so scripts and AI agents can use the IDs directly instead of parsing screen output. If AI agents are new to you, read our Claude Code beginner guide first, because the CLI's whole pitch is agent control.
OpenShot itself is a free, open-source video editor for Linux, Windows, and macOS, built by OpenShot Studios and led by developer Jonathan Thomas. Version 4.1 arrived two months after OpenShot 4.0, which shipped in August 2026, and it is the third release in three months after 4.0.1 on 27 September 2026.
The release notes live in the project's repository, and our GitHub beginner guide covers that platform if you want to follow the project there. The interface speaks 25 languages, and the 4.1 builds package FFmpeg 7.1.
The openshot command line works in two modes, and the mode you pick changes nothing about the commands. On a desktop it works alongside the open editor, sharing the same live project, timeline, undo history, and active export jobs. On a server without a display it runs headless, and you save the project as an .osp file to open later in the desktop editor.
What You Need Before You Start
You need OpenShot 4.1.1, a terminal, a few seconds of test footage, and about twenty minutes. You do not need a paid plan or an account, because OpenShot is free and open source under GPL version 3.0. The table below lists each requirement and why it matters.
| What you need | Why | Notes |
|---|---|---|
| OpenShot 4.1.1 | Provides the CLI | Check Help, then About OpenShot, for the version |
| A terminal | Runs the CLI commands | macOS, Linux, or Windows Terminal |
| Test footage | Practice imports, trims, and exports | A few seconds of any MP4 works |
| jq (optional) | Reads session and file IDs from JSON replies | Any JSON tool works, or read the reply by eye |
| About 20 minutes | The full arc, start to finish | Most of it is one first export |
If you would rather cut by hand, the GUI editor is still there, and our CapCut beginner guide covers a mobile editor instead. This guide is for the terminal path, so the GUI only appears when you hand a session back to it. Keep your footage in one folder before you start, because the import step works best with absolute paths.
Install OpenShot 4.1.1 on Linux, Windows, and macOS
Installing OpenShot 4.1.1 means downloading the build for your system from the official download page, because distro repository packages are often very outdated. The guide recommends the AppImage on Linux for exactly that reason, and you can check the installed version under Help, then About OpenShot. The table below gives the fastest path per platform.
| Platform | Install path | CLI form |
|---|---|---|
| Linux AppImage | Download, mark executable, launch | ./OpenShot.AppImage --cli |
| Linux PPA | Stable PPA, then apt install openshot-qt | openshot-qt --cli |
| Linux Snap | sudo snap install openshot-qt | snap run openshot-qt --cli |
| Windows | Download the installer, 64-bit or 32-bit | openshot-qt-cmd.exe --cli |
| macOS | Download the DMG, drag into Applications | Binary inside the app bundle --cli |
The command name needs care, because openshot-cli is shorthand in the docs for your installation's executable plus the --cli flag. On Linux that means ./OpenShot.AppImage --cli or snap run openshot-qt --cli, on Windows you must use openshot-qt-cmd.exe because the desktop executable shows no terminal output, and on macOS you call the binary inside the app bundle. Some installations do provide a bare openshot-cli command, but the --cli form works everywhere, so this guide uses it throughout.
On Linux, the AppImage needs libfuse2, which Ubuntu 22.04 and newer do not ship by default, so install it with sudo apt install libfuse2 first. If AppImageLauncher shows integration dialogs when you use --cli, set APPIMAGELAUNCHER_DISABLE=1 before launching. The Snap is official since 4.0.1, and its file permissions apply to the CLI too, so keep media, projects, and exports inside your home folder.
The macOS download is built for Intel Macs, so on Apple Silicon it runs through Rosetta, with no native Apple Silicon build available yet. ARM64 Linux builds exist through the daily PPA and the Snap edge channel, which is also where the experimental daily builds live. The 4.1.1 release also fixes GPU exports, with new AMD AMF and NVIDIA NVENC and Intel Quick Sync HEVC presets, plus Windows save retries and atomic saves on network shares.
# Linux AppImage sudo apt install libfuse2 export APPIMAGELAUNCHER_DISABLE=1 ./OpenShot.AppImage --cli intro # Linux stable PPA sudo add-apt-repository ppa:openshot.developers/ppa sudo apt update sudo apt install openshot-qt python3-openshot # Linux Snap sudo snap install openshot-qt
Run the intro command after installing, because --cli intro prints the CLI introduction and confirms the interface answers. If you are building from source instead, run python3 src/launch.py --cli intro from the openshot-qt checkout. No Python version number is stated in the official 4.1 docs, so do not trust any number you see in a third-party guide.
Your First Scripted Edit in 7 Steps
Your first scripted edit follows seven steps, and each step is one command that returns JSON. The pattern is always the same: start a session, remember its ID, import a file, place a clip, shape it, and export. Follow the steps in order, and check the export at the end.
- Start a headless session and capture the session ID from the JSON reply.
- Save the session ID in OPENSHOT_SESSION so later commands find it.
- Import your clip and capture the file ID from the JSON reply.
- Add the clip to the timeline at position 0, trimming seconds 10 to 17.
- Apply the slide-in-left motion preset to the clip.
- Export to a new MP4 file with the wait flag.
- Save the project as an .osp file so the edit survives the session.
cli="./OpenShot.AppImage --cli" export APPIMAGELAUNCHER_DISABLE=1 reply=$($cli session start) session_id=$(printf '%s' "$reply" | jq -er 'select(.ok == true) | .result.session_id | strings | select(length > 0)') export OPENSHOT_SESSION="$session_id"
cli="./OpenShot.AppImage --cli" $cli file import /home/me/Videos/clip.mp4 $cli clip add FILE_ID --position 0 --start 10 --end 17 $cli clip motion CLIP_ID --preset slide-in-left $cli export start /home/me/Videos/video.mp4 --wait $cli project save "/home/me/Videos/My Project.osp"
The export step needs a new filename in an existing folder, because existing outputs are never overwritten. The --wait flag keeps the command running until the export finishes or fails, with a default wait of 600 seconds, which is 10 minutes. If the wait times out, the export keeps running in the background, so check the same job instead of starting another.
How Sessions Work
A session is the CLI's connection to one editing project, and every command after session start runs inside the selected session. The start command returns JSON containing result.session_id, which you save in the OPENSHOT_SESSION environment variable for that terminal only. Starting a session does not set the variable for you, so export it yourself, and clear it with unset OPENSHOT_SESSION when you stop.
If more than one session exists, automatic selection stops working, and you get a session_required error instead. Run session list to find the available sessions, then select one explicitly, or target a single command with the --session flag. The session registry lives in ~/.openshot_qt/sessions unless OPENSHOT_SESSION_DIR overrides it, and the guide warns to keep that registry private, because it holds the credentials for your editing sessions.
On a desktop, session show brings the project into the editor window at any point, keeping the same timeline, undo history, and active export jobs. Sessions started without a display cannot later show a desktop window, so save the project and reopen it in a new desktop session instead. The stop command refuses unsaved changes and active exports, so add --discard only when you mean to throw edits away.
cli="./OpenShot.AppImage --cli" $cli session list $cli session show $cli project get $cli project save "/home/me/Videos/My Project v2.osp" --overwrite $cli session stop
Saving an .osp file does not package your footage into it, so keep the source media available wherever the project travels. Opening a project through the CLI shows no interactive missing-media dialogs, so a moved file simply stays missing. If you run long batch jobs, session serve stays in the foreground for supervisors, while session start returns once a background host registers.
Import Media and Add Clips to the Timeline
Media must be imported into Project Files before it can sit on the timeline, and the import command returns a file ID for exactly that reason. Capture the ID from the JSON reply, because the next command needs it, and never guess a track number or a timing value. The clip add command takes the file ID, a layer, a timeline position, and a source trim.
| Setting | Unit | Rule |
|---|---|---|
| position | Timeline seconds | Where the clip starts on the timeline |
| start | Source seconds | Where the clip starts inside the file |
| end | Source seconds | Where the clip ends inside the file, exclusive |
| Frames | Project FPS | Frame numbers start at 1, not 0 |
| Layers | Track numbers | Discover them with project get first |
The blog's minimal example adds a clip at position 0 with seconds 10 to 17 of the source, and the guide's fuller form adds a layer and a volume. Frames start at 1, and file thumbnail frames use source FPS while timeline frames use project FPS. Trimming a clip does not move its first visible keyframe to frame 1, because clip keyframes use source coordinates at project FPS.
Use the --audio-only flag when a music file should land without its embedded cover art as video. The import command also takes thumbnails and contact sheets, so you can inspect a file before placing it. Relative media paths resolve from the working directory, which is why absolute paths are the safer habit.
Trim, Split, and Fade Clips
Trimming is the clip add command's start and end flags, and splitting is a separate command that cuts a clip at a timeline position. The split command snaps to the nearest project frame, keeps both halves, and keeps the source-coordinate curves, duplicating effects with fresh IDs on the right half. The left half keeps the original clip ID, and undo restores the original clip in one transaction.
cli="./OpenShot.AppImage --cli"
$cli clip split CLIP_ID --at 6.5
$cli clip fade CLIP_ID --in 0.5 --out 0.5
$cli clip set CLIP_ID --json '{"volume":0.5}'
$cli clip keyframe set CLIP_ID --property volume --frame 301 --value 0
The fade command calculates the source-trim keyframe coordinates for you and replaces the alpha curve, and adding --property volume --value 0.25 turns it into an audio fade with a 0.25 peak gain. Fade durations must fit between the first and last visible frames, and the fade-out reaches zero on the last frame. The set command merges top-level properties, and JSON arguments accept inline JSON, an @file.json reference, or a dash for standard input.
Apply Presets and Effects
The CLI applies the same Motion, Look, Speed, Repeat, and Waveform presets as the clip menu, and the blog's example applies the slide-in-left motion preset. Only that one preset name is verified in the fetched sources, so list the rest from the CLI itself with clip motion help instead of trusting a third-party list. The preset families are the story here, not a name you have not seen in the docs.
Effects work the same way, starting with effects list to see what is available with a short description. Add one by class name, display name, or underscore alias, then set its properties with JSON, and list the attached instances to find their IDs. Effects support the same keyframe subcommands as clips, with nested property paths such as color.red on a Chroma Key effect.
If you need to see your footage while you edit, the timeline commands return thumbnails, contact sheets, and waveform views at any position and zoom. Frame images default to 320 by 180 pixels, and contact sheets use 160 by 90 pixel tiles with timecode labels. These previews are how an agent inspects the edit without opening the video, and they are also handy for a human checking a cut.
Animate With Keyframes
Keyframes animate any property over time, and the CLI gives you three coordinate spaces and two units to place them precisely. The spaces are native, clip, and timeline, and the units are frames or seconds, with all frames using project FPS and starting at 1. Seconds start at zero and snap to the nearest frame, and interpolation describes the segment into the destination point, with linear, constant, and Bezier choices.
The worked equivalence from the guide makes the spaces concrete: for a clip at 5 seconds, trimmed at 2 seconds, in a 30 fps project, clip frame 1 equals timeline frame 151 and native frame 61. Native is the engine coordinate including the source trim, clip counts from the visible clip in-point, and timeline counts from project time zero. Use keyframe preview to sample the curve before rendering, with 17 evenly spaced samples by default and a count flag from 2 to 256.
Easing presets apply with an --easing flag on the destination point, and the GUI preset called ease differs from plain Bezier handles, so check the preview when a motion looks wrong. The keyframe list command without a property discovers the curve paths and point counts on a clip, and copy and paste move curves between clips in merge or replace mode. Text colors animate too, with text_color, text_background, text_stroke, and text_border taking red, green, blue, and alpha values from 0 to 255.
Add Text From the Terminal
Text in 4.1 is drawn by the video engine, so it stays sharp when scaled, and the CLI adds it with one text add command. You give the words, a layer, a position, and a duration, then place the box at the center, an edge, a corner, or the lower third, and style it with a font, size, bold flag, and colors. Sizes are pixels at project resolution, and colors take hex codes with or without alpha, CSS names, or transparent.
cli="./OpenShot.AppImage --cli"
$cli text add --text "Opening Night" --layer 5000000 --position 2 --duration 4 \
--place lower-third --font "Noto Sans" --size 72 --bold --color "#ffffff" \
--background "#80000000" --background-padding 16 --background-corner 12
$cli text get CLIP_ID
$cli text set CLIP_ID --stroke black --stroke-width 3
$cli text fonts --search noto
$cli text list --search opening
$cli text reset CLIP_ID
The shared-style rule is the one that catches people: text words, font, size, alignment, box width, and default colors live in Project Files and are shared by every clip using that text. Running text set on one clip changes all of them and lists the changed clip IDs, so add --this-clip-only when a clip needs its own copy first. A text clip is otherwise an ordinary clip, so position, scale, rotation, opacity, timing, fades, motion presets, and effects all use the normal clip commands.
In the GUI, the same engine powers native text editing: press Shift+T or click the Tt button, and a text clip appears at the playhead with its placeholder selected. The redesigned Edit Style dialog holds outline, background, padding, rounded corners, border, box width, and letter and line spacing. Font size, padding, box width, and spacing set the text-box size and cannot be keyframed, so keyframe the clip's scale to animate text size.
Export Your Video, Headless or Not
The default export writes an MP4 with H.264 video and AAC audio at the project's resolution and frame rate, and the export start command takes the output path and the wait flag. Before you render, run export validate, which opens the encoders with the exact settings in a separate process and checks them without writing a file. A combination the container cannot hold fails with an incompatible_export error, FFmpeg's own explanation, and the setting to change.
| Export job | Profile | What it does |
|---|---|---|
| 720p landscape | builtin:01280x0720p0030_16-09 | 1280 by 720 at 30 fps, 16 by 9 |
| 1080p landscape | builtin:01920x1080p0030_16-09 | 1920 by 1080 at 30 fps, 16 by 9 |
| Square | builtin:01080x1080p0030_01-01 | 1080 by 1080 at 30 fps, 1 by 1 |
| Preset encode | builtin:format_mp4_x264, quality med | MP4 with H.264 at medium quality |
An export profile sets dimensions, frame rate, and aspect ratio for one job only, and it never changes the editing project's profile. An export preset selects the encoding settings, so the two combine: pick a profile for the shape and a preset for the codec. Changing aspect ratio can change framing, so review each output, especially titles and animated subjects, and compose a separate square or portrait version from a project copy when the framing matters.
Background exports free the terminal: start the job without --wait, then check it with export status, list all jobs with export list, and stop one with export cancel. Each job captures the timeline when it starts, so later edits never change an export already in progress. Frame ranges render part of the timeline with --start-frame and --end-frame, which are inclusive and one-based at the export profile's frame rate, so frames 1 to 90 at 30 fps give three seconds.
This is the openshot headless export pattern: reuse one headless session, open a project, export with --wait, then open the next, with a 24-hour wait timeout per export in the guide's example scripts. Advanced JSON opens audio-only and image-sequence modes, so an export can write a WAV file or a folder of PNG frames instead of a video. The FFmpeg checks behind export validate are the same ones the Export dialog runs, and our FFmpeg beginner guide covers the tool underneath if you want the background.
The headless story has an older chapter worth one line: openshot-render is a separate legacy front-end to libopenshot for exporting saved .osp files, and it predates the 4.1 CLI. Whether it still ships with 4.1.x installs is unverified, so treat it as history, not as the 4.1 way. The 4.1.1 release also added GPU export presets, validated the GPU alternatives before falling back to CPU encoding, and made export badges match the encoder actually selected.
Let an AI Agent Drive the Edit
The official line is simple: give Claude Code, Codex, or any AI agent a task, and OpenShot handles the edit. Describe the video you want, and the agent imports the footage, builds the timeline, and exports the result, because every command is documented in its own help and returns structured results. The guide's workflow is to give the agent the executable path, the media and project, and the desired result, then ask it to read --cli intro before starting.
The blog's example is ai agent video editing openshot at its clearest: a request for a 15-second highlight reel becomes CLI commands and a finished video with an Adventure Awaits title. Agents inspect the edit as they work, using thumbnail strips, audio waveform data, and timeline previews at a chosen position and zoom. Phoronix's Michael Larabel said he hopes to use the scripting support to build an automated performance benchmark for OpenShot, which shows how far the idea reaches beyond editing.
A community piece from 1 November 2026 proposes a full openshot-director skill that inspects footage with ffmpeg scene detection, delegates visual description to a vision-capable subagent, proposes a shot list, waits for approval, then applies everything through the CLI. That piece is third-party, not official documentation, so this guide cites it as one community approach and does not repeat its prices or model names as facts. The human stays in control either way: session show hands the live project back to the GUI, you review the result, make your own adjustments, and let the agent handle the next task.
If you run the CLI on a server, keep the pattern from the container world in mind: one session, one project at a time, and explicit saves. Our Docker beginner guide covers containers if your headless server runs them, and the same session discipline applies there. Batch edits help too: edit apply takes up to 256 ordered mutation commands in one undo step, and edit bulk repeats a small template across a selection, with --dry-run to validate first.
Every worked number in this guide comes from the short script below, run on 6 November 2026. The inputs are the release dates from the sources section, and the outputs are the figures quoted in the article. The headline figures are 12 days since the 4.1.0 announcement, 4.1.1 arrived 4 days ago, and 18 years from 2008 to 2026.
from datetime import date
today = date(2026, 11, 6)
print('days since 4.1.0 announcement (2026-10-25):', (today - date(2026, 10, 25)).days)
print('days since Phoronix post (2026-10-31):', (today - date(2026, 10, 31)).days)
print('days since 4.1.1 release (2026-11-02):', (today - date(2026, 11, 2)).days)
print('days since 4.0.1 release (2026-09-27):', (today - date(2026, 9, 27)).days)
print('days since Medium piece (2026-11-01):', (today - date(2026, 11, 1)).days)
print('days 4.0.1 to 4.1.0:', (date(2026, 10, 25) - date(2026, 9, 27)).days)
print('days 4.1.0 announcement to 4.1.1:', (date(2026, 11, 2) - date(2026, 10, 25)).days)
print('default wait in minutes (600/60):', 600 // 60)
print('batch wait timeout in hours (86400/3600):', 86400 // 3600)
print('seconds in frames 1-90 at 30 fps:', 90 / 30)
print('years since OpenShot began (2026-2008):', 2026 - 2008)
Sources
Official blog, OpenShot 4.1: Type, Create, Automate, 25 October 2026: https://www.openshot.org/blog/2026/10/25/openshot-41-direct-text-editing-auto-optimize-command-line-editing/.
Official User Guide, Command Line Interface chapter: https://photo.openshot.org/static/files/user-guide/agent_cli.html#cli-ref.
Official User Guide, Installation chapter: https://photo.openshot.org/static/files/user-guide/installation.html.
GitHub releases for openshot-qt, 4.1.1 and 4.1.0 changelogs: https://github.com/OpenShot/openshot-qt/releases.
Phoronix, OpenShot 4.1 Released With Auto-Optimize, CLI Automation and ARM64 Linux Builds, 31 October 2026: https://www.phoronix.com/news/OpenShot-4.1-Released.
Linuxiac, OpenShot 4.1 Video Editor Adds Direct Text Editing, CLI Automation, 1 November 2026: https://linuxiac.com/openshot-4-1-video-editor-adds-direct-text-editing-cli-automation/.
Neowin, OpenShot Video Editor 4.1.0, 1 November 2026: https://www.neowin.net/software/openshot-video-editor-410/.
Medium community piece, Have your super intelligent video editor with a low cost AI plus OpenShot CLI, 1 November 2026: https://medium.com/@parade4940/have-your-super-intelligent-video-editor-with-a-low-cost-ai-openshot-cli-93b715012816.
Softtechhub, OpenShot 4.1: 6 Powerful Facts About AI Agent Video Editing, 2 November 2026: https://softtechhub.us/2026/11/02/openshot-4-1-cli-ai-agents/.
OpenShot 4.1.1 coverage, GPU Export Fixes and AI-Ready Video Editing CLI, 2 November 2026: https://bitcoinversus.tech/2026/11/02/openshot-4-1-1-gpu-export-windows-save-fixes-ai-cli-video-editor-2026/.
VideoHelp, OpenShot Video Editor version history: https://www.videohelp.com/software/OpenShot-Video-Editor/version-history.
Official download page: https://www.openshot.org/download/.
Frequently Asked Questions
Is the OpenShot 4.1 CLI stable?
No, it is experimental in 4.1, so expect rough edges and changed commands in later releases. Use it for automation and batch work, not for a deadline edit you cannot redo.
Why is openshot-cli not found on my computer?
Because only some installations provide the bare command, and the rest need your executable plus the --cli flag. Call ./OpenShot.AppImage --cli, snap run openshot-qt --cli, or openshot-qt-cmd.exe --cli on Windows, then run --cli intro to confirm.
Does the CLI need a display to export?
No, a headless session runs with no window, and export start with --wait renders the video on a server. Save the project as an .osp file to open it later in the desktop editor.
Does export overwrite my old video?
No, an export to a taken filename fails instead of destroying the old file. Pick a new filename or move the old file first.
Can I use the CLI on Windows and macOS?
Yes, Windows needs openshot-qt-cmd.exe for terminal output, and macOS calls the binary inside the app bundle. The macOS build targets Intel Macs and runs through Rosetta on Apple Silicon, with no native build yet.




