@auscera/cleoedits 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +62 -2
- package/cli.mjs +149 -0
- package/lib/dependencies.mjs +384 -0
- package/lib/run.mjs +114 -0
- package/lib/workspace.mjs +167 -0
- package/package.json +240 -3
- package/workspace/.agents/skills/cleoedits/SKILL.md +29 -0
- package/workspace/.agents/skills/cleoedits/assets/ffmpeg_templates/audiogram.json +41 -0
- package/workspace/.agents/skills/cleoedits/assets/ffmpeg_templates/facebook.json +48 -0
- package/workspace/.agents/skills/cleoedits/assets/ffmpeg_templates/linkedin.json +48 -0
- package/workspace/.agents/skills/cleoedits/assets/ffmpeg_templates/podcast.json +23 -0
- package/workspace/.agents/skills/cleoedits/assets/ffmpeg_templates/reels.json +48 -0
- package/workspace/.agents/skills/cleoedits/assets/ffmpeg_templates/shorts.json +48 -0
- package/workspace/.agents/skills/cleoedits/assets/ffmpeg_templates/tiktok.json +48 -0
- package/workspace/.agents/skills/cleoedits/assets/ffmpeg_templates/x.json +48 -0
- package/workspace/.agents/skills/cleoedits/assets/ffmpeg_templates/youtube-shorts.json +48 -0
- package/workspace/.agents/skills/cleoedits/assets/ffmpeg_templates/youtube.json +48 -0
- package/workspace/.agents/skills/cleoedits/assets/reel_effects/assets/LICENSE-SimpleIcons +30 -0
- package/workspace/.agents/skills/cleoedits/assets/reel_effects/assets/logos.json +1 -0
- package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/Anton-Regular.ttf +0 -0
- package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/ArchivoBlack-Regular.ttf +0 -0
- package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/InstrumentSerif-Italic.ttf +0 -0
- package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/Inter.ttf +0 -0
- package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/LICENSE-PermanentMarker.txt +202 -0
- package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/Montserrat.ttf +0 -0
- package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/OFL-Anton.txt +93 -0
- package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/OFL-ArchivoBlack.txt +93 -0
- package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/OFL-InstrumentSerif.txt +93 -0
- package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/OFL-Inter.txt +93 -0
- package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/OFL-Montserrat.txt +93 -0
- package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/OFL-PlayfairDisplay.txt +93 -0
- package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/OFL-Poppins.txt +93 -0
- package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/OFL-SpaceMono.txt +93 -0
- package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/PermanentMarker-Regular.ttf +0 -0
- package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/PlayfairDisplay-Italic.ttf +0 -0
- package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/PlayfairDisplay.ttf +0 -0
- package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/Poppins-Black.ttf +0 -0
- package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/Poppins-Bold.ttf +0 -0
- package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/Poppins-ExtraBold.ttf +0 -0
- package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/SpaceMono-Bold.ttf +0 -0
- package/workspace/.agents/skills/cleoedits/assets/reel_effects/models/LICENSE-MediaPipe +218 -0
- package/workspace/.agents/skills/cleoedits/assets/reel_effects/models/LICENSE-YuNet +21 -0
- package/workspace/.agents/skills/cleoedits/assets/reel_effects/models/NOTICE.md +4 -0
- package/workspace/.agents/skills/cleoedits/assets/reel_effects/models/selfie_segmenter.tflite +0 -0
- package/workspace/.agents/skills/cleoedits/assets/reel_effects/models/yunet.onnx +0 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/LICENSE +21 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/audio-app-ui/STYLE.md +65 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/blueprint/STYLE.md +53 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/blueprint/index.html +328 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/blueprint/studio.js +57 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/data-story/STYLE.md +65 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/data-story/index.html +575 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/design-app-ui/STYLE.md +68 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/editor-ui/STYLE.md +73 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/editorial-paper/STYLE.md +54 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/editorial-paper/index.html +189 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/editorial-paper/studio.js +57 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/explainer-diagram/STYLE.md +64 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/explainer-diagram/index.html +620 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/graphite-ui/STYLE.md +55 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/graphite-ui/index.html +238 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/graphite-ui/studio.js +57 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/growing-city/STYLE.md +66 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/growing-city/index.html +602 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/ink-line/STYLE.md +66 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/ink-line/index.html +777 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/midnight-grid/STYLE.md +56 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/midnight-grid/index.html +186 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/midnight-grid/studio.js +57 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/motion-app-ui/STYLE.md +68 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/paper-cut/STYLE.md +56 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/paper-cut/index.html +244 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/paper-cut/studio.js +57 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/paper-world/STYLE.md +67 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/paper-world/index.html +663 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/particle-field/STYLE.md +59 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/particle-field/index.html +395 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/poster-pop/STYLE.md +52 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/poster-pop/index.html +194 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/poster-pop/studio.js +57 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/risograph/STYLE.md +58 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/risograph/index.html +242 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/risograph/studio.js +57 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/swiss-grid/STYLE.md +53 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/swiss-grid/index.html +138 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/swiss-grid/studio.js +57 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/swiss-kinetic/STYLE.md +63 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/swiss-kinetic/index.html +599 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/time-travel/STYLE.md +65 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/time-travel/index.html +1297 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/weather-widget/STYLE.md +69 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/weather-widget/index.html +674 -0
- package/workspace/.agents/skills/cleoedits/references/audio-clearervoice-elevenlabs.md +11 -0
- package/workspace/.agents/skills/cleoedits/references/ffmpeg-and-reels.md +15 -0
- package/workspace/.agents/skills/cleoedits/references/hyperframes-workflows.md +13 -0
- package/workspace/.agents/skills/cleoedits/references/kdenlive-cli-and-mcp.md +12 -0
- package/workspace/.agents/skills/cleoedits/references/motion-design-pipeline.md +7 -0
- package/workspace/.agents/skills/cleoedits/references/motion-taste-emil.md +5 -0
- package/workspace/.agents/skills/cleoedits/references/playwright-demo-capture.md +9 -0
- package/workspace/.agents/skills/cleoedits/references/remotion-workflows.md +13 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/LICENSE +21 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_ass_overlay.py +399 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_common/__init__.py +235 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_common/alpha.py +560 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_common/asr.py +1237 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_common/color.py +540 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_common/decision.py +2452 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_common/drawtext.py +290 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_common/emit.py +1309 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_common/emoji.py +518 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_common/fonts.py +875 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_common/pacing.py +263 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_common/pacing_edit.py +432 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_common/probe.py +1613 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_common/runner.py +3994 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_common/text.py +73 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_common/timeline.py +721 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_common/wrap.py +981 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_contract.py +2454 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_platforms.py +258 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_review.html +754 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_review.py +258 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_smartcut.py +450 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/audio.py +867 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/background.py +136 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/batch.py +1409 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/broll.py +282 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/caption.py +2207 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/check.py +815 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/color.py +695 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/crop.py +91 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/cropdetect.py +214 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/cut.py +2076 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/deinterlace.py +90 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/denoise.py +94 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/export.py +1033 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/fit.py +729 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/freeze.py +197 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/graphics.py +920 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/grid.py +235 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/insert.py +142 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/join.py +1083 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/look.py +475 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/loop.py +395 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/loudness.py +397 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/metadata.py +416 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/multicam.py +414 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/overlay.py +766 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/pad.py +121 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/probe.py +145 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/proxy.py +93 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/redact.py +162 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/render.py +2424 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/report.py +354 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/reverse.py +114 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/scenes.py +439 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/sequence.py +285 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/silence.py +945 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/speedramp.py +193 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/sphere.py +137 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/stabilize.py +141 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/straighten.py +120 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/sync.py +500 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/verify.py +411 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/waveform.py +502 -0
- package/workspace/.agents/skills/cleoedits/scripts/kdenlive_builder.py +284 -0
- package/workspace/.agents/skills/cleoedits/scripts/motion/LICENSE-claude-motion +21 -0
- package/workspace/.agents/skills/cleoedits/scripts/motion/LICENSE-motion-design +21 -0
- package/workspace/.agents/skills/cleoedits/scripts/motion/_media.py +43 -0
- package/workspace/.agents/skills/cleoedits/scripts/motion/pacing_check.py +90 -0
- package/workspace/.agents/skills/cleoedits/scripts/motion/storyboard.py +77 -0
- package/workspace/.agents/skills/cleoedits/scripts/reel_effects/LICENSE +26 -0
- package/workspace/.agents/skills/cleoedits/scripts/reel_effects/fx.py +2717 -0
- package/workspace/.agents/skills/cleoedits/scripts/reel_effects/logos.py +194 -0
- package/workspace/.agents/skills/cleoedits/scripts/reel_effects/sfx.py +105 -0
- package/workspace/.agents/skills/cleoedits/scripts/reel_effects/trim.py +99 -0
- package/workspace/.agents/skills/cleoedits/scripts/reel_effects/words.py +60 -0
- package/workspace/.claude/commands/blender-3d.md +12 -0
- package/workspace/.claude/commands/business-short-form-reels.md +12 -0
- package/workspace/.claude/commands/color-grade.md +12 -0
- package/workspace/.claude/commands/cutout-grid-reel.md +12 -0
- package/workspace/.claude/commands/depth-ui-reel.md +12 -0
- package/workspace/.claude/commands/explainer-panel-reel.md +12 -0
- package/workspace/.claude/commands/freeze-frame.md +12 -0
- package/workspace/.claude/commands/glass-graph.md +12 -0
- package/workspace/.claude/commands/over-the-shoulder.md +12 -0
- package/workspace/.claude/commands/personal-short-form-reels.md +12 -0
- package/workspace/.claude/commands/ranking-format.md +12 -0
- package/workspace/.claude/commands/relight.md +12 -0
- package/workspace/.claude/commands/reverse-engineer.md +12 -0
- package/workspace/.claude/commands/text-behind.md +12 -0
- package/workspace/.claude/commands/tier-list.md +12 -0
- package/workspace/.claude-plugin/plugin.json +8 -0
- package/workspace/.npmignore +15 -0
- package/workspace/AGENTS.md +30 -0
- package/workspace/README.md +63 -0
- package/workspace/assets/fonts/TikTokSans-OFL.txt +93 -0
- package/workspace/assets/fonts/TikTokSans-Variable.ttf +0 -0
- package/workspace/assets/luts/clean_warm.cube +4917 -0
- package/workspace/assets/luts/golden_hour.cube +4917 -0
- package/workspace/assets/luts/moody_dark.cube +4917 -0
- package/workspace/assets/luts/teal_orange.cube +4917 -0
- package/workspace/assets/sfx/NOTICE.txt +1 -0
- package/workspace/assets/sfx/click.wav +0 -0
- package/workspace/assets/sfx/pop.wav +0 -0
- package/workspace/assets/sfx/riser.wav +0 -0
- package/workspace/assets/sfx/whoosh.wav +0 -0
- package/workspace/generators/hyperframes/index.html +39 -0
- package/workspace/generators/hyperframes/package.json +15 -0
- package/workspace/generators/hyperframes/pnpm-lock.yaml +1181 -0
- package/workspace/generators/hyperframes/pnpm-workspace.yaml +10 -0
- package/workspace/generators/remotion/eslint.config.mjs +3 -0
- package/workspace/generators/remotion/package.json +36 -0
- package/workspace/generators/remotion/pnpm-lock.yaml +4179 -0
- package/workspace/generators/remotion/pnpm-workspace.yaml +10 -0
- package/workspace/generators/remotion/remotion.config.ts +13 -0
- package/workspace/generators/remotion/src/Root.tsx +52 -0
- package/workspace/generators/remotion/src/index.css +1 -0
- package/workspace/generators/remotion/src/index.ts +4 -0
- package/workspace/generators/remotion/tsconfig.json +15 -0
- package/workspace/pipeline/scripts/_codec.py +28 -0
- package/workspace/pipeline/scripts/ai_media_api.py +109 -0
- package/workspace/pipeline/scripts/blender_render.py +166 -0
- package/workspace/pipeline/scripts/composite.py +49 -0
- package/workspace/pipeline/scripts/melt.sh +68 -0
- package/workspace/pipeline/scripts/normalize_audio.py +39 -0
- package/workspace/pipeline/scripts/person_matte.py +216 -0
- package/workspace/pipeline/scripts/record_demo.py +69 -0
- package/workspace/pipeline/scripts/whisper_cut.py +98 -0
- package/workspace-manifest.json +908 -0
package/README.md
CHANGED
|
@@ -1,3 +1,63 @@
|
|
|
1
|
-
|
|
1
|
+
<h1 align="center">CleoEdits</h1>
|
|
2
|
+
<p align="center">An AI video studio for video editing.</p>
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
CleoEdits gives your existing agent a local workspace for cutting footage, cleaning audio, adding captions, building motion graphics, and assembling editable timelines.
|
|
5
|
+
|
|
6
|
+
## Quick start
|
|
7
|
+
|
|
8
|
+
Node.js 22 or later and pnpm are required. Install the global CLI from npm when a release is available.
|
|
9
|
+
|
|
10
|
+
```sh
|
|
11
|
+
pnpm add -g @auscera/cleoedits
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Run `cleoedits` to create your workspace and open the interactive CLI. For one-time workspace setup, run `pnpm dlx @auscera/cleoedits setup`.
|
|
15
|
+
|
|
16
|
+
To try a local release archive, run this from the directory containing the archive.
|
|
17
|
+
|
|
18
|
+
```sh
|
|
19
|
+
pnpm dlx "$PWD/auscera-cleoedits-0.1.0.tgz" setup
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Place footage in `pipeline/raw_footage/` or pass its absolute path to your agent. To start a session from the workspace, run `cleoedits agent codex` or `cleoedits agent claude` after setting up the corresponding agent CLI. You can also open your agent from the directory printed by `cleoedits workspace`. For a local Claude Code plugin session launched manually, open a terminal in that directory and run `claude --plugin-dir .`.
|
|
23
|
+
|
|
24
|
+
Try asking, “Use CleoEdits to trim my footage into a 30-second cut and save a preview in `pipeline/exports/`.”
|
|
25
|
+
|
|
26
|
+
## Choose your tools
|
|
27
|
+
|
|
28
|
+
Setup copies the workspace and agent skill. Select additional tools by workflow. Each profile explains the dependencies it needs and reports any system tools you need to install separately.
|
|
29
|
+
|
|
30
|
+
| What you want to do | Profile |
|
|
31
|
+
| --- | --- |
|
|
32
|
+
| Inspect, trim, convert, or composite clips | `ffmpeg` |
|
|
33
|
+
| Cut silence automatically | `quick-cuts` |
|
|
34
|
+
| Transcribe or align captions to words | `transcription`, `word-captions` |
|
|
35
|
+
| Clean speech or make a voiceover | `audio-cleanup`, `clearervoice`, `kokoro`, `edge-tts`, `elevenlabs` |
|
|
36
|
+
| Record a browser walkthrough or analyze reference media | `capture`, `references` |
|
|
37
|
+
| Make reel effects, face tracking, cutouts, or 3D overlays | `reel-effects`, `reel-tracking`, `cutouts`, `blender` |
|
|
38
|
+
| Generate graphics or open an editable timeline | `remotion`, `hyperframes`, `kdenlive` |
|
|
39
|
+
| Configure optional cloud media services | `cloud-media` |
|
|
40
|
+
|
|
41
|
+
```sh
|
|
42
|
+
cleoedits doctor ffmpeg
|
|
43
|
+
cleoedits install ffmpeg
|
|
44
|
+
cleoedits run ffmpeg -- -version
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
The default workspace is `~/.cleoedits`. Set `CLEOEDITS_HOME` to use a different dedicated directory. Run `cleoedits setup` again after an upgrade or to restore missing files. Setup preserves your edited files.
|
|
48
|
+
|
|
49
|
+
FFmpeg and FFprobe are system tools. Some workflows need Python 3.12 and uv, a browser download, or external applications such as Kdenlive or Blender. Model-based workflows may download model weights on first use. Cloud features use your own provider credentials. The AppImage render helper is Linux-only.
|
|
50
|
+
|
|
51
|
+
## CLI reference
|
|
52
|
+
|
|
53
|
+
| Command | Action |
|
|
54
|
+
| --- | --- |
|
|
55
|
+
| `cleoedits` | Start the interactive CLI. Enter `/help` for its slash commands. |
|
|
56
|
+
| `cleoedits /workspace` | Open the workspace in your file manager. |
|
|
57
|
+
| `cleoedits workspace` | Print the workspace path for scripts and agents. |
|
|
58
|
+
| `cleoedits doctor` | Check the available tools. Pass a profile to narrow the check. |
|
|
59
|
+
| `cleoedits tools` | List workflow profiles and available runners. |
|
|
60
|
+
| `cleoedits install <profile>` | Install workspace dependencies for a selected workflow. |
|
|
61
|
+
| `cleoedits run <tool> -- <arguments>` | Pass arguments to a bundled runner. |
|
|
62
|
+
|
|
63
|
+
Edits go from `pipeline/raw_footage/` to `pipeline/work/` and export to `pipeline/exports/`. The [workspace guide](AGENTS.md) lists the other working directories and links the agent skill.
|
package/cli.mjs
ADDED
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import fs from "node:fs";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import { createInterface } from "node:readline/promises";
|
|
5
|
+
import { dependencyReport, installProfiles, profiles } from "./lib/dependencies.mjs";
|
|
6
|
+
import { launchAgent, openWorkspace, runnerNames, runTool } from "./lib/run.mjs";
|
|
7
|
+
import { packageRoot, prepareWorkspace, skillPath, withWorkspaceLock, workspacePath } from "./lib/workspace.mjs";
|
|
8
|
+
|
|
9
|
+
const help = `CleoEdits · AI video studio
|
|
10
|
+
|
|
11
|
+
cleoedits Open the interactive studio CLI
|
|
12
|
+
cleoedits setup Install or repair the clean user workspace
|
|
13
|
+
cleoedits workspace [--open] Print the path or open it in a file manager
|
|
14
|
+
cleoedits skill Read the bundled agent skill
|
|
15
|
+
cleoedits tools [--json] List workflow profiles and runners
|
|
16
|
+
cleoedits doctor [--json] [profile ...]
|
|
17
|
+
Check what is ready and how to set up missing tools
|
|
18
|
+
cleoedits install <profile ...> Install selected workspace dependencies
|
|
19
|
+
cleoedits agent <codex|claude> [-- <args>]
|
|
20
|
+
Launch your agent in the workspace
|
|
21
|
+
cleoedits run <tool> -- <args> Run a tool in the installed studio
|
|
22
|
+
|
|
23
|
+
In the interactive CLI, use /workspace, /tools, /doctor, /install, /agent, /skill, /run or /exit.
|
|
24
|
+
Set CLEOEDITS_HOME to use a dedicated workspace directory.`;
|
|
25
|
+
|
|
26
|
+
function noArguments(command, args) {
|
|
27
|
+
if (args.length) throw new Error(`Unexpected arguments for ${command}. See cleoedits --help.`);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function withoutSeparator(args) {
|
|
31
|
+
return args[0] === "--" ? args.slice(1) : args;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function printReport(results, json = false) {
|
|
35
|
+
if (json) {
|
|
36
|
+
console.log(JSON.stringify(results, null, 2));
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
for (const profile of results) {
|
|
40
|
+
console.log(`${profile.ready ? "Ready" : "Setup needed"} · ${profile.id} — ${profile.description}`);
|
|
41
|
+
for (const detail of profile.requirements.filter((requirement) => !requirement.ready)) {
|
|
42
|
+
console.log(` ${detail.name} · ${detail.guidance}`);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
async function dispatch(argv) {
|
|
48
|
+
const [input, ...args] = argv;
|
|
49
|
+
const command = input.replace(/^--(?=setup$|doctor$|skill$|version$|help$)/, "").replace(/^\//, "");
|
|
50
|
+
if (command === "help" || command === "-h") {
|
|
51
|
+
noArguments(command, args);
|
|
52
|
+
console.log(help);
|
|
53
|
+
return 0;
|
|
54
|
+
}
|
|
55
|
+
if (command === "version" || command === "-v") {
|
|
56
|
+
noArguments(command, args);
|
|
57
|
+
console.log(JSON.parse(fs.readFileSync(path.join(packageRoot, "package.json"), "utf8")).version);
|
|
58
|
+
return 0;
|
|
59
|
+
}
|
|
60
|
+
if (command === "tools") {
|
|
61
|
+
noArguments(command, args.filter((arg) => arg !== "--json"));
|
|
62
|
+
const catalog = Object.entries(profiles).map(([id, profile]) => ({ id, description: profile.description }));
|
|
63
|
+
if (args.includes("--json")) {
|
|
64
|
+
console.log(JSON.stringify({ profiles: catalog, runners: runnerNames }, null, 2));
|
|
65
|
+
} else {
|
|
66
|
+
for (const { id, description } of catalog) console.log(`${id.padEnd(20)} ${description}`);
|
|
67
|
+
console.log(`\nRunners · ${runnerNames.join(", ")}`);
|
|
68
|
+
}
|
|
69
|
+
return 0;
|
|
70
|
+
}
|
|
71
|
+
if (!["setup", "workspace", "skill", "doctor", "install", "agent", "run"].includes(command)) {
|
|
72
|
+
throw new Error(`Unknown command: ${input}. See cleoedits --help.`);
|
|
73
|
+
}
|
|
74
|
+
const workspace = workspacePath();
|
|
75
|
+
const conflicts = await prepareWorkspace(workspace, { repair: command === "setup" });
|
|
76
|
+
for (const file of conflicts) console.error(`Kept your existing ${file}`);
|
|
77
|
+
switch (command) {
|
|
78
|
+
case "setup":
|
|
79
|
+
noArguments(command, args);
|
|
80
|
+
console.log(`Workspace ready at ${workspace}\nRun cleoedits tools to choose which dependencies to install.`);
|
|
81
|
+
return 0;
|
|
82
|
+
case "workspace":
|
|
83
|
+
noArguments(command, args.filter((arg) => arg !== "--open"));
|
|
84
|
+
console.log(workspace);
|
|
85
|
+
return input === "/workspace" || args.includes("--open") ? openWorkspace(workspace) : 0;
|
|
86
|
+
case "skill":
|
|
87
|
+
noArguments(command, args);
|
|
88
|
+
process.stdout.write(fs.readFileSync(path.join(workspace, skillPath, "SKILL.md"), "utf8"));
|
|
89
|
+
return 0;
|
|
90
|
+
case "doctor":
|
|
91
|
+
printReport(await dependencyReport(workspace, args.filter((arg) => arg !== "--json")), args.includes("--json"));
|
|
92
|
+
return 0;
|
|
93
|
+
case "install": {
|
|
94
|
+
const results = await withWorkspaceLock(workspace, () => installProfiles(workspace, args));
|
|
95
|
+
printReport(results);
|
|
96
|
+
return results.every((profile) => profile.ready) ? 0 : 1;
|
|
97
|
+
}
|
|
98
|
+
case "run":
|
|
99
|
+
return runTool(workspace, args[0], withoutSeparator(args.slice(1)));
|
|
100
|
+
case "agent":
|
|
101
|
+
return launchAgent(workspace, args[0], withoutSeparator(args.slice(1)));
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
function commandLine(line) {
|
|
106
|
+
const tokens = line.match(/"[^"]*"|'[^']*'|[^\s"']+/g) ?? [];
|
|
107
|
+
return tokens.map((part) => /^["']/.test(part) ? part.slice(1, -1) : part);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
function reportError(error) {
|
|
111
|
+
console.error(`CleoEdits · ${error.message}`);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
async function interactive() {
|
|
115
|
+
if (!process.stdin.isTTY) return dispatch(["help"]);
|
|
116
|
+
const workspace = workspacePath();
|
|
117
|
+
await prepareWorkspace(workspace);
|
|
118
|
+
console.log(`CleoEdits · ${workspace}\nType /help for commands.\n`);
|
|
119
|
+
const terminal = createInterface({ input: process.stdin, output: process.stdout });
|
|
120
|
+
let closed = false;
|
|
121
|
+
terminal.on("close", () => { closed = true; });
|
|
122
|
+
try {
|
|
123
|
+
while (!closed) {
|
|
124
|
+
const line = await terminal.question("cleoedits> ");
|
|
125
|
+
const tokens = commandLine(line);
|
|
126
|
+
if (["/exit", "exit", "/quit", "quit"].includes(tokens[0])) break;
|
|
127
|
+
if (!tokens.length) continue;
|
|
128
|
+
terminal.pause();
|
|
129
|
+
try {
|
|
130
|
+
const exit = await dispatch(tokens);
|
|
131
|
+
if (exit) console.error(`Command exited with status ${exit}.`);
|
|
132
|
+
} catch (error) {
|
|
133
|
+
reportError(error);
|
|
134
|
+
} finally {
|
|
135
|
+
if (!closed) terminal.resume();
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
} finally {
|
|
139
|
+
terminal.close();
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
try {
|
|
144
|
+
const args = process.argv.slice(2);
|
|
145
|
+
process.exitCode = (args.length ? await dispatch(args) : await interactive()) ?? 0;
|
|
146
|
+
} catch (error) {
|
|
147
|
+
reportError(error);
|
|
148
|
+
process.exitCode = 1;
|
|
149
|
+
}
|
|
@@ -0,0 +1,384 @@
|
|
|
1
|
+
import { execFile, spawn } from "node:child_process";
|
|
2
|
+
import { accessSync, constants, realpathSync, statSync } from "node:fs";
|
|
3
|
+
import { readFile } from "node:fs/promises";
|
|
4
|
+
import { delimiter, join, resolve } from "node:path";
|
|
5
|
+
import { promisify } from "node:util";
|
|
6
|
+
|
|
7
|
+
const capture = promisify(execFile);
|
|
8
|
+
const windows = process.platform === "win32";
|
|
9
|
+
const media = ["ffmpeg", "ffprobe"];
|
|
10
|
+
const torch = "torch==2.15.0";
|
|
11
|
+
const torchaudio = "torchaudio==2.11.1";
|
|
12
|
+
const soundfile = "soundfile==0.12.1";
|
|
13
|
+
|
|
14
|
+
const tools = {
|
|
15
|
+
ffmpeg: "Install FFmpeg with the codecs your workflow uses and add it to PATH.",
|
|
16
|
+
ffprobe: "Install the FFprobe executable included with FFmpeg and add it to PATH.",
|
|
17
|
+
pnpm: "Install pnpm and add its bin directory to PATH.",
|
|
18
|
+
kdenlive: "Install Kdenlive and add its executable to PATH.",
|
|
19
|
+
blender: "Install Blender and add its executable to PATH.",
|
|
20
|
+
"eSpeak NG": "Install eSpeak NG for Kokoro's fallback phonemizer and add it to PATH.",
|
|
21
|
+
"Agent CLI": "Install an agent such as Codex, Claude Code, Cursor Agent, or Antigravity CLI.",
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export const profiles = {
|
|
25
|
+
python: {
|
|
26
|
+
description: "Run bundled Python tools that use the standard library.",
|
|
27
|
+
python: true,
|
|
28
|
+
},
|
|
29
|
+
ffmpeg: {
|
|
30
|
+
description: "Inspect, trim, grade, composite and encode media with FFmpeg.",
|
|
31
|
+
tools: media,
|
|
32
|
+
python: true,
|
|
33
|
+
},
|
|
34
|
+
"quick-cuts": {
|
|
35
|
+
description: "Remove silence and low-motion footage with Auto-Editor.",
|
|
36
|
+
packages: ["auto-editor==29.3.1"],
|
|
37
|
+
tools: media,
|
|
38
|
+
},
|
|
39
|
+
transcription: {
|
|
40
|
+
description: "Transcribe speech with Faster-Whisper on CPU. Models download on first use.",
|
|
41
|
+
packages: ["faster-whisper==1.2.1"],
|
|
42
|
+
tools: media,
|
|
43
|
+
},
|
|
44
|
+
"word-captions": {
|
|
45
|
+
description: "Align words and cut retakes with WhisperX. Models download on first use.",
|
|
46
|
+
packages: ["whisperx==3.7.2", torch, torchaudio],
|
|
47
|
+
isolated: true,
|
|
48
|
+
pytorch: true,
|
|
49
|
+
tools: media,
|
|
50
|
+
},
|
|
51
|
+
"audio-cleanup": {
|
|
52
|
+
description: "Reduce steady background noise with Noisereduce and read or write audio with SoundFile.",
|
|
53
|
+
packages: ["noisereduce==3.0.3", soundfile],
|
|
54
|
+
tools: media,
|
|
55
|
+
},
|
|
56
|
+
clearervoice: {
|
|
57
|
+
description: "Enhance dialogue with ClearerVoice. Model weights download on first use.",
|
|
58
|
+
packages: ["clearvoice==0.1.2", torch, torchaudio, "torchvision==0.29.2"],
|
|
59
|
+
isolated: true,
|
|
60
|
+
pytorch: true,
|
|
61
|
+
tools: media,
|
|
62
|
+
},
|
|
63
|
+
kokoro: {
|
|
64
|
+
description: "Synthesize narration with Kokoro. Model weights download on first use.",
|
|
65
|
+
packages: ["kokoro==0.9.4", soundfile, torch],
|
|
66
|
+
isolated: true,
|
|
67
|
+
pytorch: true,
|
|
68
|
+
},
|
|
69
|
+
"edge-tts": {
|
|
70
|
+
description: "Generate cloud narration and subtitles with Edge TTS.",
|
|
71
|
+
packages: ["edge-tts==6.1.7"],
|
|
72
|
+
},
|
|
73
|
+
elevenlabs: {
|
|
74
|
+
description: "Generate narration or sound effects through the optional ElevenLabs API.",
|
|
75
|
+
packages: ["elevenlabs==2.80.0"],
|
|
76
|
+
credential: "ELEVENLABS_API_KEY",
|
|
77
|
+
},
|
|
78
|
+
capture: {
|
|
79
|
+
description: "Record browser demos with Playwright and its Chromium browser.",
|
|
80
|
+
packages: ["playwright==1.65.2"],
|
|
81
|
+
chromium: true,
|
|
82
|
+
},
|
|
83
|
+
references: {
|
|
84
|
+
description: "Download reference media with yt-dlp.",
|
|
85
|
+
packages: ["yt-dlp==2026.11.23"],
|
|
86
|
+
tools: media,
|
|
87
|
+
},
|
|
88
|
+
"reel-effects": {
|
|
89
|
+
description: "Run the bundled OpenCV and Pillow reel effects.",
|
|
90
|
+
packages: ["numpy==2.5.4", "opencv-python-headless==4.14.0.94", "pillow==13.0.0"],
|
|
91
|
+
tools: media,
|
|
92
|
+
},
|
|
93
|
+
"reel-tracking": {
|
|
94
|
+
description: "Add face tracking and background segmentation for the locked-on reel effect.",
|
|
95
|
+
packages: ["mediapipe==1.2.3"],
|
|
96
|
+
tools: media,
|
|
97
|
+
},
|
|
98
|
+
cutouts: {
|
|
99
|
+
description: "Create person masks, stickers and background replacements using rembg on CPU.",
|
|
100
|
+
packages: [
|
|
101
|
+
"rembg[cpu]==2.0.88", "opencv-python-headless==4.14.0.94",
|
|
102
|
+
"numpy==2.5.4", "pillow==13.0.0",
|
|
103
|
+
],
|
|
104
|
+
isolated: true,
|
|
105
|
+
tools: media,
|
|
106
|
+
},
|
|
107
|
+
remotion: {
|
|
108
|
+
description: "Build React video compositions with Remotion. Its browser installs when first needed.",
|
|
109
|
+
engine: "remotion",
|
|
110
|
+
tools: ["pnpm"],
|
|
111
|
+
},
|
|
112
|
+
hyperframes: {
|
|
113
|
+
description: "Render HTML and GSAP overlays with HyperFrames. Its browser installs when first needed.",
|
|
114
|
+
engine: "hyperframes",
|
|
115
|
+
tools: ["pnpm"],
|
|
116
|
+
},
|
|
117
|
+
kdenlive: {
|
|
118
|
+
description: "Build editable Kdenlive timelines and open them in the native editor.",
|
|
119
|
+
packages: ["lxml==6.1.3"],
|
|
120
|
+
tools: [...media, "kdenlive"],
|
|
121
|
+
},
|
|
122
|
+
"kdenlive-appimage": {
|
|
123
|
+
description: "Render timelines headlessly with the Kdenlive AppImage on Linux.",
|
|
124
|
+
appimage: true,
|
|
125
|
+
},
|
|
126
|
+
blender: {
|
|
127
|
+
description: "Render 3D titles and transparent overlays using Blender and FFmpeg.",
|
|
128
|
+
tools: [...media, "blender"],
|
|
129
|
+
python: true,
|
|
130
|
+
},
|
|
131
|
+
"cloud-media": {
|
|
132
|
+
description: "Enable optional paid relighting, lip sync and video effects through fal.ai.",
|
|
133
|
+
python: true,
|
|
134
|
+
credential: "FAL_KEY",
|
|
135
|
+
},
|
|
136
|
+
agent: {
|
|
137
|
+
description: "Run a separately installed agent with the CleoEdits skill and workspace.",
|
|
138
|
+
tools: ["Agent CLI"],
|
|
139
|
+
},
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
function executable(file) {
|
|
143
|
+
try {
|
|
144
|
+
accessSync(file, constants.X_OK);
|
|
145
|
+
return statSync(file).isFile();
|
|
146
|
+
} catch {
|
|
147
|
+
return false;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
function onPath(command) {
|
|
152
|
+
const suffixes = windows ? [".exe", ".com", ".cmd", ".bat"] : [""];
|
|
153
|
+
for (const directory of (process.env.PATH ?? "").split(delimiter).filter(Boolean)) {
|
|
154
|
+
for (const suffix of suffixes) {
|
|
155
|
+
const file = resolve(directory, command + suffix);
|
|
156
|
+
if (executable(file)) return file;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
return null;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
export function pythonEnvironment(workspace, id) {
|
|
163
|
+
return profiles[id]?.isolated
|
|
164
|
+
? join(workspace, ".cleoedits", "runtime", id)
|
|
165
|
+
: join(workspace, ".venv");
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
function venvPython(venv) {
|
|
169
|
+
return windows ? join(venv, "Scripts", "python.exe") : join(venv, "bin", "python");
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
export function workspacePython(workspace, id) {
|
|
173
|
+
const file = venvPython(pythonEnvironment(workspace, id));
|
|
174
|
+
return executable(file) ? file : null;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
export function systemPython() {
|
|
178
|
+
return ["python3.12", "python3", "python"].map(onPath).find(Boolean) ?? null;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
function toolAvailable(name) {
|
|
182
|
+
if (name === "Agent CLI") {
|
|
183
|
+
return ["codex", "claude", "cursor-agent", "agent", "agy"].some(onPath);
|
|
184
|
+
}
|
|
185
|
+
if (name === "eSpeak NG") return Boolean(onPath("espeak-ng"));
|
|
186
|
+
return Boolean(onPath(name));
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
function generatorReady(workspace, name) {
|
|
190
|
+
const shim = join(workspace, "generators", name, "node_modules", ".bin", name);
|
|
191
|
+
return executable(windows ? shim + ".cmd" : shim);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
function appImageReady() {
|
|
195
|
+
if (process.platform !== "linux") return false;
|
|
196
|
+
if (process.env.KDENLIVE_APPIMAGE) return executable(process.env.KDENLIVE_APPIMAGE);
|
|
197
|
+
const kdenlive = onPath("kdenlive");
|
|
198
|
+
if (!kdenlive) return false;
|
|
199
|
+
try {
|
|
200
|
+
return realpathSync(kdenlive).endsWith(".AppImage");
|
|
201
|
+
} catch {
|
|
202
|
+
return false;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
async function hasCredential(workspace, key) {
|
|
207
|
+
if (process.env[key]?.trim()) return true;
|
|
208
|
+
const env = join(workspace, ".env");
|
|
209
|
+
try {
|
|
210
|
+
const content = await readFile(env, "utf8");
|
|
211
|
+
return content.split(/\r?\n/).some((line) => {
|
|
212
|
+
const entry = line.trim();
|
|
213
|
+
if (!entry.startsWith(key + "=")) return false;
|
|
214
|
+
return Boolean(entry.slice(key.length + 1).trim().replace(/^["']|["']$/g, ""));
|
|
215
|
+
});
|
|
216
|
+
} catch (error) {
|
|
217
|
+
if (error.code !== "ENOENT") throw error;
|
|
218
|
+
return false;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
const probeScript = `
|
|
223
|
+
import importlib.metadata as metadata
|
|
224
|
+
import json, pathlib, sys
|
|
225
|
+
|
|
226
|
+
versions = {}
|
|
227
|
+
for name in sys.argv[2:]:
|
|
228
|
+
try:
|
|
229
|
+
versions[name] = metadata.version(name)
|
|
230
|
+
except metadata.PackageNotFoundError:
|
|
231
|
+
pass
|
|
232
|
+
|
|
233
|
+
chromium = False
|
|
234
|
+
if sys.argv[1] == "chromium" and "playwright" in versions:
|
|
235
|
+
try:
|
|
236
|
+
from playwright.sync_api import sync_playwright
|
|
237
|
+
with sync_playwright() as playwright:
|
|
238
|
+
chromium = pathlib.Path(playwright.chromium.executable_path).is_file()
|
|
239
|
+
except Exception:
|
|
240
|
+
pass
|
|
241
|
+
print(json.dumps({"version": list(sys.version_info[:2]), "packages": versions, "chromium": chromium}))
|
|
242
|
+
`;
|
|
243
|
+
|
|
244
|
+
function packageName(spec) {
|
|
245
|
+
return spec.split(/[=[\]]/, 1)[0];
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
function matchesVersion(spec, version) {
|
|
249
|
+
if (!version) return false;
|
|
250
|
+
const [, expected] = spec.split("==");
|
|
251
|
+
return !expected || version.split("+")[0] === expected;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
async function probePython(python, packages, chromium) {
|
|
255
|
+
if (!python) return null;
|
|
256
|
+
try {
|
|
257
|
+
const { stdout } = await capture(
|
|
258
|
+
python, ["-I", "-c", probeScript, chromium ? "chromium" : "", ...packages.map(packageName)],
|
|
259
|
+
{ timeout: 8000, windowsHide: true },
|
|
260
|
+
);
|
|
261
|
+
return JSON.parse(stdout);
|
|
262
|
+
} catch {
|
|
263
|
+
return null;
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
function selectedProfiles(ids) {
|
|
268
|
+
const selection = [...new Set(ids ?? Object.keys(profiles))];
|
|
269
|
+
for (const id of selection) {
|
|
270
|
+
if (!Object.hasOwn(profiles, id)) throw new Error(`Unknown dependency profile: ${id}`);
|
|
271
|
+
}
|
|
272
|
+
return selection;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
async function reportProfile(workspace, id, defaultPython) {
|
|
276
|
+
const profile = profiles[id];
|
|
277
|
+
const requirements = (profile.tools ?? []).map((name) => ({
|
|
278
|
+
name, ready: toolAvailable(name), guidance: tools[name],
|
|
279
|
+
}));
|
|
280
|
+
if (profile.python || profile.packages) {
|
|
281
|
+
const python = workspacePython(workspace, id) ?? (profile.python ? defaultPython : null);
|
|
282
|
+
const probe = await probePython(python, profile.packages ?? [], profile.chromium);
|
|
283
|
+
if (profile.python) {
|
|
284
|
+
requirements.push({
|
|
285
|
+
name: "Python 3.10+",
|
|
286
|
+
ready: probe?.version[0] === 3 && probe.version[1] >= 10,
|
|
287
|
+
guidance: "Install Python 3.12 and add it to PATH.",
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
for (const spec of profile.packages ?? []) {
|
|
291
|
+
const name = packageName(spec);
|
|
292
|
+
const version = probe?.packages[name];
|
|
293
|
+
requirements.push({
|
|
294
|
+
name, ready: matchesVersion(spec, version), version,
|
|
295
|
+
guidance: `Run cleoedits install ${id} to install ${spec} with Python 3.12 and uv.`,
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
if (profile.chromium) {
|
|
299
|
+
requirements.push({
|
|
300
|
+
name: "Playwright Chromium", ready: Boolean(probe?.chromium),
|
|
301
|
+
guidance: "Run cleoedits install capture to download the browser for Playwright.",
|
|
302
|
+
});
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
if (profile.engine) {
|
|
306
|
+
requirements.push({
|
|
307
|
+
name: `${profile.engine} workspace dependencies`,
|
|
308
|
+
ready: generatorReady(workspace, profile.engine),
|
|
309
|
+
guidance: `Run cleoedits install ${id} after installing pnpm.`,
|
|
310
|
+
});
|
|
311
|
+
}
|
|
312
|
+
if (profile.credential) {
|
|
313
|
+
requirements.push({
|
|
314
|
+
name: profile.credential, ready: await hasCredential(workspace, profile.credential),
|
|
315
|
+
guidance: `Supply your own ${profile.credential} to use this optional service.`,
|
|
316
|
+
});
|
|
317
|
+
}
|
|
318
|
+
if (profile.appimage) {
|
|
319
|
+
requirements.push({
|
|
320
|
+
name: "Linux Kdenlive AppImage", ready: appImageReady(),
|
|
321
|
+
guidance: "On Linux, set KDENLIVE_APPIMAGE to the path of your executable AppImage.",
|
|
322
|
+
});
|
|
323
|
+
}
|
|
324
|
+
return { id, description: profile.description, ready: requirements.every((item) => item.ready), requirements };
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
export function dependencyReport(workspace, ids) {
|
|
328
|
+
const defaultPython = systemPython();
|
|
329
|
+
return Promise.all(selectedProfiles(ids).map((id) => reportProfile(workspace, id, defaultPython)));
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
function run(binary, args, cwd, useWindowsShell = false) {
|
|
333
|
+
return new Promise((resolveRun, reject) => {
|
|
334
|
+
const child = spawn(binary, args, { cwd, stdio: "inherit", shell: useWindowsShell });
|
|
335
|
+
child.once("error", reject);
|
|
336
|
+
child.once("close", (code, signal) => {
|
|
337
|
+
if (code === 0) resolveRun();
|
|
338
|
+
else reject(new Error(`${binary} exited with ${signal ?? `status ${code}`}`));
|
|
339
|
+
});
|
|
340
|
+
});
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
async function installPythonProfile(workspace, id, profile) {
|
|
344
|
+
let python = workspacePython(workspace, id);
|
|
345
|
+
const install = async () => {
|
|
346
|
+
const uv = onPath("uv");
|
|
347
|
+
if (!uv) throw new Error("Install uv and Python 3.12 before selecting Python dependencies.");
|
|
348
|
+
if (!python) {
|
|
349
|
+
await run(uv, ["venv", "--python", "3.12", "--no-python-downloads", "--allow-existing",
|
|
350
|
+
pythonEnvironment(workspace, id)], workspace);
|
|
351
|
+
python = workspacePython(workspace, id);
|
|
352
|
+
}
|
|
353
|
+
const probe = await probePython(python, [], false);
|
|
354
|
+
if (probe?.version.join(".") !== "3.12") {
|
|
355
|
+
throw new Error(`Python 3.12 is required in ${pythonEnvironment(workspace, id)}.`);
|
|
356
|
+
}
|
|
357
|
+
const index = profile.pytorch && process.platform !== "darwin"
|
|
358
|
+
? ["--index", "https://download.pytorch.org/whl/cpu"]
|
|
359
|
+
: [];
|
|
360
|
+
await run(uv, ["pip", "install", "--python", python, ...index, ...profile.packages], workspace);
|
|
361
|
+
};
|
|
362
|
+
const probe = await probePython(python, profile.packages, profile.chromium);
|
|
363
|
+
if (!profile.packages.every((spec) => matchesVersion(spec, probe?.packages[packageName(spec)]))) await install();
|
|
364
|
+
if (profile.chromium && !probe?.chromium) {
|
|
365
|
+
await run(python, ["-m", "playwright", "install", "chromium"], workspace);
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
export async function installProfiles(workspace, ids) {
|
|
370
|
+
if (!ids?.length) throw new Error("Choose at least one dependency profile to install.");
|
|
371
|
+
const selection = selectedProfiles(ids);
|
|
372
|
+
for (const id of selection) {
|
|
373
|
+
const profile = profiles[id];
|
|
374
|
+
if (profile.packages) await installPythonProfile(workspace, id, profile);
|
|
375
|
+
if (profile.engine && !generatorReady(workspace, profile.engine)) {
|
|
376
|
+
const pnpm = onPath("pnpm");
|
|
377
|
+
if (!pnpm) throw new Error(tools.pnpm);
|
|
378
|
+
const shell = windows && /\.(cmd|bat)$/i.test(pnpm);
|
|
379
|
+
const directory = join(workspace, "generators", profile.engine);
|
|
380
|
+
await run(shell ? "pnpm" : pnpm, ["install", "--frozen-lockfile"], directory, shell);
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
return dependencyReport(workspace, selection);
|
|
384
|
+
}
|