CapCutCLI
CapCut Desktop project automation for humans, scripts, and AI agents.
CapCutCLI creates and edits local CapCut draft folders through a JSON-first command line and Python API. It gives an agent structured operations for media, tracks, clips, audio, text, transitions, filters, keyframes, motion, and project installation without requiring the agent to understand CapCut's internal JSON.
It edits project files. It does not render/export video, control the CapCut editor UI, or guarantee live refresh while a draft is open. Close CapCut before mutating a project, then install it and select it from CapCut's project list.
Capabilities
| Area | What an agent can do |
|---|---|
| Projects | Create, inspect, validate integrity, install, and launch CapCut Desktop |
| Assets | Import and probe image/video/audio files; list reusable asset IDs |
| Timeline | Create tracks; add, query, move, trim, update, and delete segments |
| Audio | Place TTS/BGM/local SFX, set volume/fades/mute, and duck music under voice |
| Text | Add titles/subtitles, style emphasis ranges, and apply intro/outro/loop animations |
| Visuals | Set transitions and filters; add keyframes; apply camera-motion presets |
| Storyboards | Validate, plan, and transactionally compile a high-level storyboard |
| Quality | Detect structural problems and viewer-visible timeline defects before opening CapCut |
| Automation | Apply atomic batches, stream newline-delimited JSON, or use guarded raw patches |
Install
Requires Python 3.11–3.14 and pipx.
pipx install capcut-cli
capcut --help
Upgrade or uninstall:
pipx upgrade capcut-cli
pipx uninstall capcut-cli
Native wheels are published for CPython 3.11–3.14 on Apple Silicon and Intel macOS, x64 Windows, and x64 Linux.
AI Agent Quick Reference
Recommended workflow
- Inspect first with
project.inspect,asset.list, ortimeline.summary. - Discover exact arguments with
capcut schema --op <operation>. - Import assets before referencing their
asset_idfrom clips or audio. - Prefer structured operations. Group related writes with
batch.apply. - Re-inspect, then run
project.integrityandquality.lint. - Run
project.install-launch; the user selects the installed draft in CapCut.
Use raw.patch only when no structured operation can express the edit.
batch.apply is transactional by default, so a failed operation rolls back the
group instead of leaving a partially edited timeline.
Operation map
project.*: create, inspect, integrity-check, install, and launch projectsasset.*: import, list, and probe mediatrack.*: ensure and listvideo,audio, ortexttracksclip.*: add image/video clips; move, trim, update, or delete segmentsaudio.*: add TTS/BGM/local SFX; update audio; generate ducking envelopesstoryboard.*: validate, plan, and compile high-level storyboard JSONtimeline.*: summarize, query, move, or delete any segment; delete managed outputtext.*: add/update titles and subtitles; list/apply animationstransition.*,filter.*,sfx.*: use CapCut's built-in effect catalogskeyframe.*,motion.*: edit animation values or apply camera presetsquality.*: lint black gaps, overlaps, text layout, caption pacing, audio mix, invisible clips, transition errors, and long motionless stillsbatch.*: execute grouped operations, atomically by defaultraw.*: patch low-level project JSON as a last-resort escape hatchsession.*: process one JSON request per input line for long-lived agents
List CLI commands or inspect the machine-readable schema for one operation:
capcut --help
capcut schema --op clip.add-video
capcut schema --op storyboard.compile
Data and response contract
- Public operation times are milliseconds. Stored CapCut timeranges and keyframe offsets are microseconds.
- Segments on the same track may not overlap.
draft_info.jsonanddraft_content.jsonare saved together through guarded, normalized writes.- IDs should be discovered from read operations, not guessed.
- Every CLI/session response is JSON. Success uses
{"ok": true, "command": "...", "result": {...}, "warnings": []}. Failure uses{"ok": false, "error": {"code": "...", "message": "...", "details": {...}}}. - Error details include
suggested_fixand, when relevant, conflicting IDs, invalid fields, paths, or recovery artifacts.
Important recovery rule: CLEANUP_RECOVERY_REQUIRED means the mutation was
already committed. Resolve the listed artifacts and do not retry the original
operation, or it may duplicate timeline state. PROJECT_BUSY means another
writer holds the lock; wait instead of deleting .lock.
JSON session example
session.serve keeps one process alive and accepts one operation object per line:
printf '%s\n' \
'{"op":"project.inspect","project_dir":"./workspace/demo"}' \
'{"op":"timeline.summary","project_dir":"./workspace/demo"}' \
'{"op":"quality.lint","project_dir":"./workspace/demo"}' \
| capcut session serve
The same operation names and fields are accepted by
modules.capcut.operations.apply_operation(op, args) in Python.
Development
python -m venv .venv
.venv/bin/pip install -e .[dev]
.venv/bin/pytest
Example:
capcut project create --project-dir ./workspace/demo --title "Demo Project"
capcut project inspect --project-dir ./workspace/demo
capcut timeline summary --project-dir ./workspace/demo
Place a CapCut library sound effect (auto-downloads the mp3 on first use):
capcut sfx list # catalog size
capcut sfx add --project-dir ./workspace/demo \
--effect-id 6817667030158706690 --start-ms 0 # Poi-n jumping sound
The catalog at modules/capcut/_draft/metadata/capcut_sfx_meta.py is generated
from your local CapCut rp.db cache. Rebuild it after browsing new categories
in the "사운드 효과" panel:
python3 scripts/sync_sfx.py
Reference Points
tests/test_capcut_cli.py: compact behavior coverage for the public CLI andapply_operation()docs/operation-contract.json: current public operation contract, required fields, and error surfacedocs/compatibility.md: package/runtime compatibility targets and smoke-test guidancedocs/publishing.md: private-source PyPI/pipx release proceduredocs/motion-api-spec.md: planned shared camera motion API for builder and CLI
Demo Scripts
Full feature demo with real local media:
python3 demo_specs/build_full_feature_demo.py --clean --install
This creates reusable demo assets under demo_assets/full_feature_demo/, builds a sample project in workspace/full_feature_demo_project/, and writes an execution report to demo_reports/full_feature_demo_report.json.
Focused demo for the newer list/update/trim operations:
python3 demo_specs/build_new_ops_demo.py --clean
This verifies asset.list, clip.trim, clip.update, audio.update, and text.update, then writes a report to demo_reports/new_ops_demo_report.json.
Metadata
Release files for capcut-cli 0.78.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| capcut_cli-0.78.1-cp314-cp314-macosx_11_0_x86_64.whl | CPython 3.14 | CPython 3.14 | macOS 11.0+ x86-64 | Details |
| capcut_cli-0.78.1-cp314-cp314-macosx_11_0_arm64.whl | CPython 3.14 | CPython 3.14 | macOS 11.0+ ARM64 | Details |
| capcut_cli-0.78.1-cp313-cp313-macosx_11_0_x86_64.whl | CPython 3.13 | CPython 3.13 | macOS 11.0+ x86-64 | Details |
| capcut_cli-0.78.1-cp313-cp313-macosx_11_0_arm64.whl | CPython 3.13 | CPython 3.13 | macOS 11.0+ ARM64 | Details |
| capcut_cli-0.78.1-cp312-cp312-macosx_11_0_x86_64.whl | CPython 3.12 | CPython 3.12 | macOS 11.0+ x86-64 | Details |
| capcut_cli-0.78.1-cp312-cp312-macosx_11_0_arm64.whl | CPython 3.12 | CPython 3.12 | macOS 11.0+ ARM64 | Details |
| capcut_cli-0.78.1-cp311-cp311-macosx_11_0_x86_64.whl | CPython 3.11 | CPython 3.11 | macOS 11.0+ x86-64 | Details |
| capcut_cli-0.78.1-cp311-cp311-macosx_11_0_arm64.whl | CPython 3.11 | CPython 3.11 | macOS 11.0+ ARM64 | Details |
Total release size: 28.0 MB
Release files / capcut_cli-0.78.1-cp314-cp314-macosx_11_0_x86_64.whl
| Download URL | capcut_cli-0.78.1-cp314-cp314-macosx_11_0_x86_64.whl |
|---|---|
| Size | 3.5 MB |
| Tags | CPython 3.14 macOS 11.0+ x86-64 |
|
SHA-256 checksum How to use checksums |
38ee17bd2fc59ae88a1b9fba6deb8c417b230f385218055f5d0a224e6d938d31
|
|
BLAKE2b-256 checksum How to use checksums |
f33e9513f84138704fed891afaee46204d46773541b06d7da1209f1519e74c06
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.2 {"installer":{"name":"uv","version":"0.12.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / capcut_cli-0.78.1-cp314-cp314-macosx_11_0_arm64.whl
| Download URL | capcut_cli-0.78.1-cp314-cp314-macosx_11_0_arm64.whl |
|---|---|
| Size | 3.4 MB |
| Tags | CPython 3.14 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
08940ec3d0165131c752c55c73a971d68925d83f282314cd0378af974499ba1c
|
|
BLAKE2b-256 checksum How to use checksums |
37c86b3f8e4eaa941425e6e6216ff0f9623ba57a31e8f8a4f3dd6e2746323577
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.2 {"installer":{"name":"uv","version":"0.12.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / capcut_cli-0.78.1-cp313-cp313-macosx_11_0_x86_64.whl
| Download URL | capcut_cli-0.78.1-cp313-cp313-macosx_11_0_x86_64.whl |
|---|---|
| Size | 3.5 MB |
| Tags | CPython 3.13 macOS 11.0+ x86-64 |
|
SHA-256 checksum How to use checksums |
0a30948c89bd4d764549a51887298196a4d682d103f52d250b046be9ee84ae16
|
|
BLAKE2b-256 checksum How to use checksums |
57d97a2e87caac3e6a42bc20d04dfea62a4f19c0f18eb65898f8f524591b22ea
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.2 {"installer":{"name":"uv","version":"0.12.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / capcut_cli-0.78.1-cp313-cp313-macosx_11_0_arm64.whl
| Download URL | capcut_cli-0.78.1-cp313-cp313-macosx_11_0_arm64.whl |
|---|---|
| Size | 3.3 MB |
| Tags | CPython 3.13 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
02ce506fe7f3c075658edeb08b3a0b522d01e14ca5c72827221fd8a9195cd116
|
|
BLAKE2b-256 checksum How to use checksums |
36cfa3d935e9a968489ea7a18375a8f8e7b5108ff51ee0008abdce6af9e52a0e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.2 {"installer":{"name":"uv","version":"0.12.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / capcut_cli-0.78.1-cp312-cp312-macosx_11_0_x86_64.whl
| Download URL | capcut_cli-0.78.1-cp312-cp312-macosx_11_0_x86_64.whl |
|---|---|
| Size | 3.5 MB |
| Tags | CPython 3.12 macOS 11.0+ x86-64 |
|
SHA-256 checksum How to use checksums |
24b19aee42cc16f8ef5bb6b9390e88a0b86267aa28c54551d44cd36469c752b9
|
|
BLAKE2b-256 checksum How to use checksums |
fda80d715a2d651e9281643d869f00b18207f1a470054c5e7fdc4a041c295b6a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.2 {"installer":{"name":"uv","version":"0.12.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / capcut_cli-0.78.1-cp312-cp312-macosx_11_0_arm64.whl
| Download URL | capcut_cli-0.78.1-cp312-cp312-macosx_11_0_arm64.whl |
|---|---|
| Size | 3.4 MB |
| Tags | CPython 3.12 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
aa4791170be624466246ed15dbd803ab673cb1fab63eb186c4e1c3a9a0d4f7f4
|
|
BLAKE2b-256 checksum How to use checksums |
43a87746890fcb46d1d29dffbc3e412a2741f9bfca5c05208123398fc11e5e29
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.2 {"installer":{"name":"uv","version":"0.12.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / capcut_cli-0.78.1-cp311-cp311-macosx_11_0_x86_64.whl
| Download URL | capcut_cli-0.78.1-cp311-cp311-macosx_11_0_x86_64.whl |
|---|---|
| Size | 3.8 MB |
| Tags | CPython 3.11 macOS 11.0+ x86-64 |
|
SHA-256 checksum How to use checksums |
3fc9e9422a1ed33c0239a9629535fcf70f13bbea7737576efba57a887ac0bab4
|
|
BLAKE2b-256 checksum How to use checksums |
5c1ca86c0d3f888f8bbe889752aa804a8bcb518ff54a06823dff4719217e88cc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.2 {"installer":{"name":"uv","version":"0.12.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / capcut_cli-0.78.1-cp311-cp311-macosx_11_0_arm64.whl
| Download URL | capcut_cli-0.78.1-cp311-cp311-macosx_11_0_arm64.whl |
|---|---|
| Size | 3.5 MB |
| Tags | CPython 3.11 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
fc5bc8fc83bacbe54458afd85e73bc90e66752f064dfa8f1ccbd8915bd58ebaf
|
|
BLAKE2b-256 checksum How to use checksums |
04513469910ba605dbc3c81aa75225728fa36c7a9f3af45509b9fffa10c6f60c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.2 {"installer":{"name":"uv","version":"0.12.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|