What
Add a sync-timelines command that repairs a stale CapCut/JianYing timeline mirror, so edits made by the CLI are actually honored by the app on CapCut >= 8.7.
This is the implementation task for the bug already reported in #35. That issue documents the symptom; this one scopes the fix and is a good pickup for a contributor.
Why it matters
On CapCut >= 8.7 (seen on Windows) the app drives the timeline from template-2.tmp / draft_info.json, not draft_content.json. The CLI writes draft_content.json correctly, but the app renders from the mirror, so the edit is silently ignored. That is a data-loss-class failure: the user sees no error and no effect.
doctor already detects the condition. In src/store.ts it emits:
CapCut >= 8.7 detected without a readable template-2.tmp timeline; attach this report to issue #35.
So we detect it but have no repair path. This is the tool's last known version-compatibility gap.
Where in the code
src/store.ts — modernStorage detection (atLeast(version, "8.7")), STANDARD_FILES (draft_content.json, draft_info.json, draft_meta_info.json, template-2.tmp), and the storage-target ordering. This is the surface the new command builds on.
src/index.ts — command dispatch + help text (see relink as a model for a repair-style verb).
src/command-specs.ts — register the new command spec.
Proposed approach
- Detect the desync: load all readable storage targets, compare the timeline that the app will actually read (mirror) against
draft_content.json.
- Reconcile: write the canonical edited timeline back into every mirror target the app reads, including
draft_info.json GUID reconciliation for the pre-open mirror case.
- Refuse to run while the editor is open (reuse the existing
editorProcesses() guard in src/draft.ts), with --force-write to override.
- Keep it read-only-safe by default: print a diff/plan, apply on confirmation or
--apply.
Acceptance criteria
Prior art
The Davidb-2107/capcut-cli fork already ships a sync-timelines command plus draft_info.json GUID reconciliation — a good reference for the reconcile logic. See #36 for the upstreaming context.
Related: #33 (root_meta_info registration), #34 (ffprobe dimension detection). See docs/version-support.md.
What
Add a
sync-timelinescommand that repairs a stale CapCut/JianYing timeline mirror, so edits made by the CLI are actually honored by the app on CapCut >= 8.7.This is the implementation task for the bug already reported in #35. That issue documents the symptom; this one scopes the fix and is a good pickup for a contributor.
Why it matters
On CapCut >= 8.7 (seen on Windows) the app drives the timeline from
template-2.tmp/draft_info.json, notdraft_content.json. The CLI writesdraft_content.jsoncorrectly, but the app renders from the mirror, so the edit is silently ignored. That is a data-loss-class failure: the user sees no error and no effect.doctoralready detects the condition. Insrc/store.tsit emits:So we detect it but have no repair path. This is the tool's last known version-compatibility gap.
Where in the code
src/store.ts—modernStoragedetection (atLeast(version, "8.7")),STANDARD_FILES(draft_content.json,draft_info.json,draft_meta_info.json,template-2.tmp), and the storage-target ordering. This is the surface the new command builds on.src/index.ts— command dispatch + help text (seerelinkas a model for a repair-style verb).src/command-specs.ts— register the new command spec.Proposed approach
draft_content.json.draft_info.jsonGUID reconciliation for the pre-open mirror case.editorProcesses()guard insrc/draft.ts), with--force-writeto override.--apply.Acceptance criteria
capcut sync-timelines <project>reconciles a draft whosetemplate-2.tmp/draft_info.jsonmirror has drifted fromdraft_content.json.--force-write.doctorpoints tosync-timelinesas the remedy instead of deferring to add-video/edit changes ignored by CapCut 8.7 (Windows): timeline may be driven by template-2.tmp + draft_meta_info.json, not draft_content.json #35.Prior art
The
Davidb-2107/capcut-clifork already ships async-timelinescommand plusdraft_info.jsonGUID reconciliation — a good reference for the reconcile logic. See #36 for the upstreaming context.Related: #33 (root_meta_info registration), #34 (ffprobe dimension detection). See
docs/version-support.md.