montaj 2.0.0__tar.gz

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.
Files changed (204) hide show
  1. montaj-2.0.0/LICENSE +21 -0
  2. montaj-2.0.0/MANIFEST.in +18 -0
  3. montaj-2.0.0/Montaj.jpeg +0 -0
  4. montaj-2.0.0/PKG-INFO +256 -0
  5. montaj-2.0.0/README.md +204 -0
  6. montaj-2.0.0/cli/__init__.py +1 -0
  7. montaj-2.0.0/cli/commands/__init__.py +1 -0
  8. montaj-2.0.0/cli/commands/analyze_media.py +34 -0
  9. montaj-2.0.0/cli/commands/approve.py +160 -0
  10. montaj-2.0.0/cli/commands/caption.py +32 -0
  11. montaj-2.0.0/cli/commands/create_step.py +64 -0
  12. montaj-2.0.0/cli/commands/credentials.py +225 -0
  13. montaj-2.0.0/cli/commands/doctor.py +155 -0
  14. montaj-2.0.0/cli/commands/extract_audio.py +31 -0
  15. montaj-2.0.0/cli/commands/fetch.py +31 -0
  16. montaj-2.0.0/cli/commands/filler.py +32 -0
  17. montaj-2.0.0/cli/commands/generate_image.py +42 -0
  18. montaj-2.0.0/cli/commands/generate_music.py +39 -0
  19. montaj-2.0.0/cli/commands/generate_voiceover.py +50 -0
  20. montaj-2.0.0/cli/commands/init.py +27 -0
  21. montaj-2.0.0/cli/commands/install.py +348 -0
  22. montaj-2.0.0/cli/commands/kling_generate.py +43 -0
  23. montaj-2.0.0/cli/commands/lyrics_render.py +67 -0
  24. montaj-2.0.0/cli/commands/lyrics_sync.py +38 -0
  25. montaj-2.0.0/cli/commands/materialize_cut.py +45 -0
  26. montaj-2.0.0/cli/commands/mcp.py +22 -0
  27. montaj-2.0.0/cli/commands/models.py +60 -0
  28. montaj-2.0.0/cli/commands/normalize.py +29 -0
  29. montaj-2.0.0/cli/commands/probe.py +27 -0
  30. montaj-2.0.0/cli/commands/profile.py +92 -0
  31. montaj-2.0.0/cli/commands/regen.py +230 -0
  32. montaj-2.0.0/cli/commands/remove_bg.py +50 -0
  33. montaj-2.0.0/cli/commands/render.py +30 -0
  34. montaj-2.0.0/cli/commands/resize.py +31 -0
  35. montaj-2.0.0/cli/commands/rm_nonspeech.py +38 -0
  36. montaj-2.0.0/cli/commands/run.py +56 -0
  37. montaj-2.0.0/cli/commands/serve.py +51 -0
  38. montaj-2.0.0/cli/commands/snapshot.py +42 -0
  39. montaj-2.0.0/cli/commands/status.py +60 -0
  40. montaj-2.0.0/cli/commands/stem_separation.py +38 -0
  41. montaj-2.0.0/cli/commands/step.py +87 -0
  42. montaj-2.0.0/cli/commands/transcribe.py +34 -0
  43. montaj-2.0.0/cli/commands/update.py +86 -0
  44. montaj-2.0.0/cli/commands/validate.py +34 -0
  45. montaj-2.0.0/cli/commands/validate_step.py +24 -0
  46. montaj-2.0.0/cli/commands/waveform_trim.py +47 -0
  47. montaj-2.0.0/cli/commands/workflow.py +133 -0
  48. montaj-2.0.0/cli/deps.py +33 -0
  49. montaj-2.0.0/cli/help.py +68 -0
  50. montaj-2.0.0/cli/main.py +121 -0
  51. montaj-2.0.0/cli/mcp_schema.py +155 -0
  52. montaj-2.0.0/cli/output.py +39 -0
  53. montaj-2.0.0/connectors/__init__.py +11 -0
  54. montaj-2.0.0/connectors/gemini.py +403 -0
  55. montaj-2.0.0/connectors/kling.py +528 -0
  56. montaj-2.0.0/connectors/openai.py +110 -0
  57. montaj-2.0.0/docs/ARCHITECTURE.md +804 -0
  58. montaj-2.0.0/docs/CLI.md +412 -0
  59. montaj-2.0.0/docs/CONNECTORS.md +153 -0
  60. montaj-2.0.0/docs/PROFILES.md +191 -0
  61. montaj-2.0.0/docs/RENDER.md +203 -0
  62. montaj-2.0.0/docs/UI.md +199 -0
  63. montaj-2.0.0/docs/plans/2026-04-19-music-structure.md +454 -0
  64. montaj-2.0.0/docs/plans/2026-04-21-pypi-release.md +41 -0
  65. montaj-2.0.0/docs/plans/todo.md +44 -0
  66. montaj-2.0.0/docs/schemas/lyric-phrase.md +164 -0
  67. montaj-2.0.0/docs/schemas/overlay.md +136 -0
  68. montaj-2.0.0/docs/schemas/project.md +668 -0
  69. montaj-2.0.0/docs/schemas/step.md +247 -0
  70. montaj-2.0.0/docs/schemas/workflow.md +254 -0
  71. montaj-2.0.0/engine/__init__.py +0 -0
  72. montaj-2.0.0/engine/resolve_workflow.py +162 -0
  73. montaj-2.0.0/engine/validate.py +186 -0
  74. montaj-2.0.0/engine/validate_step.py +125 -0
  75. montaj-2.0.0/lib/__init__.py +1 -0
  76. montaj-2.0.0/lib/ai_video.py +300 -0
  77. montaj-2.0.0/lib/common.py +166 -0
  78. montaj-2.0.0/lib/credentials.py +96 -0
  79. montaj-2.0.0/lib/models.py +145 -0
  80. montaj-2.0.0/lib/normalize.py +214 -0
  81. montaj-2.0.0/lib/trim_spec.py +97 -0
  82. montaj-2.0.0/lib/types/__init__.py +1 -0
  83. montaj-2.0.0/lib/types/kling.py +40 -0
  84. montaj-2.0.0/lib/types/project.py +42 -0
  85. montaj-2.0.0/lib/workflow.py +41 -0
  86. montaj-2.0.0/montaj.egg-info/PKG-INFO +256 -0
  87. montaj-2.0.0/montaj.egg-info/SOURCES.txt +202 -0
  88. montaj-2.0.0/montaj.egg-info/dependency_links.txt +1 -0
  89. montaj-2.0.0/montaj.egg-info/entry_points.txt +3 -0
  90. montaj-2.0.0/montaj.egg-info/requires.txt +29 -0
  91. montaj-2.0.0/montaj.egg-info/top_level.txt +7 -0
  92. montaj-2.0.0/profiles/__init__.py +0 -0
  93. montaj-2.0.0/profiles/analyze.py +347 -0
  94. montaj-2.0.0/profiles/schema.json +49 -0
  95. montaj-2.0.0/project/__init__.py +0 -0
  96. montaj-2.0.0/project/init.py +271 -0
  97. montaj-2.0.0/project/render.py +30 -0
  98. montaj-2.0.0/pyproject.toml +68 -0
  99. montaj-2.0.0/schema/enums.yaml +43 -0
  100. montaj-2.0.0/serve/__init__.py +0 -0
  101. montaj-2.0.0/serve/server.py +1448 -0
  102. montaj-2.0.0/serve/sse.py +30 -0
  103. montaj-2.0.0/serve/watcher.py +97 -0
  104. montaj-2.0.0/setup.cfg +4 -0
  105. montaj-2.0.0/skills/ai-video-generate/SKILL.md +556 -0
  106. montaj-2.0.0/skills/ai-video-plan/SKILL.md +297 -0
  107. montaj-2.0.0/skills/animation-sections/SKILL.md +109 -0
  108. montaj-2.0.0/skills/camera-vocabulary/SKILL.md +138 -0
  109. montaj-2.0.0/skills/edit-session/SKILL.md +207 -0
  110. montaj-2.0.0/skills/eval-scenes/SKILL.md +170 -0
  111. montaj-2.0.0/skills/lyrics-video/SKILL.md +363 -0
  112. montaj-2.0.0/skills/mcp/SKILL.md +36 -0
  113. montaj-2.0.0/skills/onboarding/SKILL.md +113 -0
  114. montaj-2.0.0/skills/overlay/SKILL.md +99 -0
  115. montaj-2.0.0/skills/parallel/SKILL.md +92 -0
  116. montaj-2.0.0/skills/select-takes/SKILL.md +170 -0
  117. montaj-2.0.0/skills/serve/SKILL.md +86 -0
  118. montaj-2.0.0/skills/style-profile/SKILL.md +189 -0
  119. montaj-2.0.0/skills/waveform-silence/SKILL.md +136 -0
  120. montaj-2.0.0/skills/workflow-builder/SKILL.md +194 -0
  121. montaj-2.0.0/skills/write-overlay/SKILL.md +451 -0
  122. montaj-2.0.0/steps/audio/extract_audio.json +21 -0
  123. montaj-2.0.0/steps/audio/extract_audio.py +30 -0
  124. montaj-2.0.0/steps/audio/stem_separation.json +27 -0
  125. montaj-2.0.0/steps/audio/stem_separation.py +115 -0
  126. montaj-2.0.0/steps/audio/waveform_image.json +28 -0
  127. montaj-2.0.0/steps/audio/waveform_image.py +83 -0
  128. montaj-2.0.0/steps/audio/waveform_trim.json +29 -0
  129. montaj-2.0.0/steps/audio/waveform_trim.py +86 -0
  130. montaj-2.0.0/steps/edit/cross_cut.json +39 -0
  131. montaj-2.0.0/steps/edit/cross_cut.py +134 -0
  132. montaj-2.0.0/steps/edit/jump_cut.json +39 -0
  133. montaj-2.0.0/steps/edit/jump_cut.py +129 -0
  134. montaj-2.0.0/steps/edit/montage.json +39 -0
  135. montaj-2.0.0/steps/edit/montage.py +124 -0
  136. montaj-2.0.0/steps/generate/generate_image.json +23 -0
  137. montaj-2.0.0/steps/generate/generate_image.py +60 -0
  138. montaj-2.0.0/steps/generate/generate_music.json +24 -0
  139. montaj-2.0.0/steps/generate/generate_music.py +61 -0
  140. montaj-2.0.0/steps/generate/generate_voiceover.json +31 -0
  141. montaj-2.0.0/steps/generate/generate_voiceover.py +84 -0
  142. montaj-2.0.0/steps/generate/kling_generate.json +27 -0
  143. montaj-2.0.0/steps/generate/kling_generate.py +244 -0
  144. montaj-2.0.0/steps/lyrics/caption.json +21 -0
  145. montaj-2.0.0/steps/lyrics/caption.py +81 -0
  146. montaj-2.0.0/steps/lyrics/lyrics_render.json +75 -0
  147. montaj-2.0.0/steps/lyrics/lyrics_render.py +467 -0
  148. montaj-2.0.0/steps/lyrics/lyrics_sync.json +36 -0
  149. montaj-2.0.0/steps/lyrics/lyrics_sync.py +263 -0
  150. montaj-2.0.0/steps/media/analyze_media.json +19 -0
  151. montaj-2.0.0/steps/media/analyze_media.py +45 -0
  152. montaj-2.0.0/steps/media/fetch.json +32 -0
  153. montaj-2.0.0/steps/media/fetch.py +58 -0
  154. montaj-2.0.0/steps/media/normalize.json +29 -0
  155. montaj-2.0.0/steps/media/normalize.py +64 -0
  156. montaj-2.0.0/steps/media/probe.json +13 -0
  157. montaj-2.0.0/steps/media/probe.py +45 -0
  158. montaj-2.0.0/steps/media/snapshot.json +60 -0
  159. montaj-2.0.0/steps/media/snapshot.py +139 -0
  160. montaj-2.0.0/steps/speech/rm_fillers.json +21 -0
  161. montaj-2.0.0/steps/speech/rm_fillers.py +111 -0
  162. montaj-2.0.0/steps/speech/rm_nonspeech.json +37 -0
  163. montaj-2.0.0/steps/speech/rm_nonspeech.py +115 -0
  164. montaj-2.0.0/steps/speech/transcribe.json +27 -0
  165. montaj-2.0.0/steps/speech/transcribe.py +84 -0
  166. montaj-2.0.0/steps/transform/crop_spec.json +21 -0
  167. montaj-2.0.0/steps/transform/crop_spec.py +123 -0
  168. montaj-2.0.0/steps/transform/materialize_cut.json +57 -0
  169. montaj-2.0.0/steps/transform/materialize_cut.py +192 -0
  170. montaj-2.0.0/steps/transform/remove_bg.json +64 -0
  171. montaj-2.0.0/steps/transform/remove_bg.py +444 -0
  172. montaj-2.0.0/steps/transform/resize.json +21 -0
  173. montaj-2.0.0/steps/transform/resize.py +32 -0
  174. montaj-2.0.0/steps/transform/rvm/__init__.py +0 -0
  175. montaj-2.0.0/steps/transform/rvm/decoder.py +209 -0
  176. montaj-2.0.0/steps/transform/rvm/deep_guided_filter.py +61 -0
  177. montaj-2.0.0/steps/transform/rvm/fast_guided_filter.py +76 -0
  178. montaj-2.0.0/steps/transform/rvm/lraspp.py +29 -0
  179. montaj-2.0.0/steps/transform/rvm/mobilenetv3.py +72 -0
  180. montaj-2.0.0/steps/transform/rvm/model.py +79 -0
  181. montaj-2.0.0/steps/transform/rvm/resnet.py +45 -0
  182. montaj-2.0.0/steps/transform/virtual_to_original.json +27 -0
  183. montaj-2.0.0/steps/transform/virtual_to_original.py +122 -0
  184. montaj-2.0.0/tests/test_ai_video_lib.py +177 -0
  185. montaj-2.0.0/tests/test_common.py +130 -0
  186. montaj-2.0.0/tests/test_connectors_gemini.py +665 -0
  187. montaj-2.0.0/tests/test_connectors_kling.py +416 -0
  188. montaj-2.0.0/tests/test_connectors_openai.py +216 -0
  189. montaj-2.0.0/tests/test_credentials.py +126 -0
  190. montaj-2.0.0/tests/test_engine.py +488 -0
  191. montaj-2.0.0/tests/test_init.py +349 -0
  192. montaj-2.0.0/tests/test_install_cli.py +103 -0
  193. montaj-2.0.0/tests/test_models.py +163 -0
  194. montaj-2.0.0/tests/test_remove_bg.py +122 -0
  195. montaj-2.0.0/tests/test_server_intake.py +66 -0
  196. montaj-2.0.0/tests/test_server_reserve_path.py +103 -0
  197. montaj-2.0.0/tests/test_trim_spec.py +42 -0
  198. montaj-2.0.0/workflows/ai_video.json +53 -0
  199. montaj-2.0.0/workflows/animations.json +10 -0
  200. montaj-2.0.0/workflows/clean_cut.json +15 -0
  201. montaj-2.0.0/workflows/explainer.json +17 -0
  202. montaj-2.0.0/workflows/floating_head.json +17 -0
  203. montaj-2.0.0/workflows/lyrics_video.json +24 -0
  204. montaj-2.0.0/workflows/overlays.json +16 -0
montaj-2.0.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Sam Padilla
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,18 @@
1
+ include LICENSE
2
+ include README.md
3
+ include Montaj.jpeg
4
+
5
+ # Step executables + JSON schemas
6
+ recursive-include steps *.py *.json
7
+
8
+ # Workflow definitions
9
+ recursive-include workflows *.json
10
+
11
+ # Agent skills
12
+ recursive-include skills *.md
13
+
14
+ # Schema definitions
15
+ recursive-include schema *.yaml *.json
16
+
17
+ # Docs (for offline reference)
18
+ recursive-include docs *.md
Binary file
montaj-2.0.0/PKG-INFO ADDED
@@ -0,0 +1,256 @@
1
+ Metadata-Version: 2.4
2
+ Name: montaj
3
+ Version: 2.0.0
4
+ Summary: Video editing toolkit for AI agents — CLI-first, agent-native, open source
5
+ Author-email: Sam Padilla <sam@bycrux.com>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/theSamPadilla/montaj
8
+ Project-URL: Repository, https://github.com/theSamPadilla/montaj
9
+ Project-URL: Issues, https://github.com/theSamPadilla/montaj/issues
10
+ Keywords: video,editing,ai,agent,cli,ffmpeg,montaj
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: Environment :: Console
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Operating System :: MacOS
15
+ Classifier: Operating System :: POSIX :: Linux
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
+ Classifier: Topic :: Multimedia :: Video
22
+ Classifier: Topic :: Software Development :: Libraries
23
+ Requires-Python: >=3.10
24
+ Description-Content-Type: text/markdown
25
+ License-File: LICENSE
26
+ Requires-Dist: Pillow>=10.0
27
+ Requires-Dist: yt-dlp>=2026.3
28
+ Requires-Dist: curl_cffi>=0.7
29
+ Requires-Dist: fastapi>=0.110
30
+ Requires-Dist: uvicorn[standard]>=0.29
31
+ Requires-Dist: watchdog>=4.0
32
+ Requires-Dist: httpx>=0.27
33
+ Requires-Dist: python-multipart>=0.0.9
34
+ Requires-Dist: static-ffmpeg>=2.5
35
+ Provides-Extra: test
36
+ Requires-Dist: pytest>=8; extra == "test"
37
+ Requires-Dist: pytest-timeout; extra == "test"
38
+ Provides-Extra: rvm
39
+ Requires-Dist: torch>=2.0; extra == "rvm"
40
+ Requires-Dist: torchvision>=0.15; extra == "rvm"
41
+ Requires-Dist: av>=12.0; extra == "rvm"
42
+ Provides-Extra: demucs
43
+ Requires-Dist: demucs>=4.0; extra == "demucs"
44
+ Requires-Dist: torch>=2.0; extra == "demucs"
45
+ Requires-Dist: torchaudio>=2.0; extra == "demucs"
46
+ Provides-Extra: connectors
47
+ Requires-Dist: pyjwt>=2.8.0; extra == "connectors"
48
+ Requires-Dist: requests>=2.31.0; extra == "connectors"
49
+ Requires-Dist: google-genai>=0.3.0; extra == "connectors"
50
+ Requires-Dist: openai>=1.75.0; extra == "connectors"
51
+ Dynamic: license-file
52
+
53
+ <p align="center">
54
+ <img src="Montaj.jpeg" alt="Montaj" width="200" />
55
+ </p>
56
+
57
+ # Montaj
58
+
59
+ > A video editing CLIP for AI agents. CLI-first, agent-native, open source.
60
+
61
+ Montaj is a **CLIP** — a CLI Program for agents. It clips onto your existing AI agent (Claude Code, OpenClaw, Cursor, or any harness) and gives it the specialized tools to edit video. Built-in steps cover the full editing pipeline. The agent decides what to run, in what order, and with what parameters.
62
+
63
+ **The fundamental dependency is an agent.** Montaj doesn't edit on its own. It provides the tools; the agent makes the creative decisions.
64
+
65
+ ## Quick install
66
+ Send this to your agent:
67
+ ```
68
+ Install Montaj from https://github.com/theSamPadilla/montaj, then read skills/onboarding/SKILL.md to get us started.
69
+ ```
70
+
71
+ ## Install
72
+
73
+ **PyPI:**
74
+ ```bash
75
+ pip install montaj
76
+ # install Node.js >=18 separately: https://nodejs.org
77
+ montaj install whisper # whisper-cpp binary + model weights
78
+ montaj install ui # npm deps + UI build
79
+ ```
80
+
81
+ **Homebrew (macOS)** — installs Node.js and all Python deps including bundled ffmpeg:
82
+ ```bash
83
+ brew install theSamPadilla/montaj/montaj
84
+ ```
85
+
86
+ **From source:**
87
+ ```bash
88
+ git clone https://github.com/theSamPadilla/montaj
89
+ cd montaj
90
+ pip install -e ".[connectors]"
91
+ montaj install whisper
92
+ montaj install ui
93
+ ```
94
+
95
+ Optional extras:
96
+ ```bash
97
+ pip install "montaj[connectors]" # Kling, Gemini, OpenAI API connectors
98
+ pip install "montaj[rvm]" # background removal (torch + RVM)
99
+ pip install "montaj[demucs]" # audio stem separation
100
+ montaj install all # whisper + ui + rvm
101
+ ```
102
+
103
+ ## Quick Start
104
+
105
+ ```bash
106
+ # Headless — agent edits, renders, done
107
+ montaj run ./clips --prompt "tight cuts, remove filler, 9:16"
108
+
109
+ # With UI — watch the agent work live, tweak the result
110
+ montaj serve
111
+
112
+ # AI video generation — agent creates from a text prompt via Kling
113
+ montaj serve # then create an ai_video project in the UI
114
+ ```
115
+
116
+ ## What's Inside
117
+
118
+ ```
119
+ steps/ Step executables + JSON schemas (probe, trim, transcribe, generate, etc.)
120
+ workflows/ Editing plans (clean_cut, overlays, ai_video, lyrics_video, etc.)
121
+ skills/ Agent skill contracts (onboarding, edit-session, ai-video-plan, ai-video-generate, etc.)
122
+ connectors/ API connectors (Kling, Gemini, OpenAI)
123
+
124
+ render/ React + Puppeteer + ffmpeg render engine
125
+ serve/ Local HTTP + SSE server (montaj serve)
126
+ ui/ Browser UI (Vite + React + Tailwind)
127
+ docs/ Architecture, CLI reference, UI design, schemas
128
+ ```
129
+
130
+ ## How It Works
131
+
132
+ ```
133
+ 1. Upload clips + write an editing prompt (or describe an AI video)
134
+ 2. montaj creates project.json [pending]
135
+ 3. Agent picks it up, reads the workflow, calls steps as tools
136
+ 4. Agent writes project.json as it works → UI updates live via SSE
137
+ 5. Agent marks project [draft]
138
+ 6. Human reviews in browser (optional) → tweaks → marks [final]
139
+ 7. Render engine → final MP4
140
+ ```
141
+
142
+ ## CLI
143
+
144
+ Every operation is available from the terminal. `montaj` is the full command, `mtj` is the short alias.
145
+
146
+ ```bash
147
+ montaj run ./clips --prompt "tight cuts, upbeat pacing"
148
+ montaj serve
149
+ montaj render
150
+ montaj fetch https://youtube.com/watch?v=...
151
+ ```
152
+
153
+ See the [CLI Reference](https://docs.montaj.ag/cli) for the full documentation.
154
+
155
+ ## Steps & Workflows
156
+
157
+ **Steps** are individual editing operations — Python executables with JSON schemas, callable as agent tools, CLI commands, or API calls. Native steps ship with Montaj; custom steps are any executable that follows the output convention.
158
+
159
+ | Category | Steps |
160
+ |----------|-------|
161
+ | **Inspect** | `probe`, `snapshot`, `analyze_media` |
162
+ | **Clean** | `waveform_trim`, `rm_fillers`, `rm_nonspeech` |
163
+ | **Edit** | `materialize_cut`, `resize`, `extract_audio`, `crop_spec` |
164
+ | **Enrich** | `transcribe`, `caption`, `normalize`, `lyrics_sync`, `lyrics_render` |
165
+ | **Generate** | `kling_generate`, `generate_image`, `eval_scene` |
166
+ | **VFX** | `remove_bg`, `stem_separation` |
167
+ | **Acquire** | `fetch` — download from any URL via yt-dlp |
168
+
169
+ **Workflows** are suggested editing plans — which steps to use and with what default params. The agent reads the plan, reads the prompt, and decides the actual execution.
170
+
171
+ | Workflow | Description |
172
+ |----------|-------------|
173
+ | `clean_cut` | Trim, remove filler, clean audio |
174
+ | `overlays` | Add animated overlays and titles |
175
+ | `ai_video` | Generate video from text via Kling + storyboard |
176
+ | `lyrics_video` | Sync lyrics to audio with animated captions |
177
+ | `animations` | Custom JSX animation compositions |
178
+ | `explainer` | Educational/explainer video style |
179
+ | `floating_head` | Speaker overlay on background footage |
180
+
181
+ Custom steps and workflows are discovered automatically — no registration needed. See the [Steps Reference](https://docs.montaj.ag/steps) and [Core Concepts](https://docs.montaj.ag/concepts) for details.
182
+
183
+ ## Skills
184
+
185
+ Skills are agent-readable contracts that teach the agent how to approach a specific editing task. Each skill describes the goal, the steps to use, the parameter choices, and the quality criteria.
186
+
187
+ Available skills: `onboarding`, `edit-session`, `ai-video-plan`, `ai-video-generate`, `eval-scenes`, `overlay`, `write-overlay`, `animation-sections`, `lyrics-video`, `style-profile`, `serve`, `parallel`, `select-takes`, `waveform-silence`, `camera-vocabulary`, `workflow-builder`, `mcp`.
188
+
189
+ ## Connectors
190
+
191
+ API connectors for external services. Installed via `pip install "montaj[connectors]"`.
192
+
193
+ | Connector | Used for |
194
+ |-----------|----------|
195
+ | **Kling** | AI video generation (v3-omni, video-o1) |
196
+ | **Gemini** | Media analysis, scene evaluation, image generation |
197
+ | **OpenAI** | Image generation, analysis |
198
+
199
+ ## Render Engine
200
+
201
+ React + Puppeteer + ffmpeg. Reads `project.json [final]`, renders captions and overlays frame-by-frame via headless Chrome, composites with source footage via ffmpeg → final MP4.
202
+
203
+ See the [Render Engine](https://docs.montaj.ag/render) docs for the full breakdown.
204
+
205
+ ## UI
206
+
207
+ Optional browser interface. Upload → watch the agent work live → review → render.
208
+
209
+ ```bash
210
+ montaj serve # http://localhost:3000
211
+ ```
212
+
213
+ - **Editor** — timeline, preview player, caption editor, overlay editor
214
+ - **Storyboard** — AI video scene planning with image/style references
215
+ - **Workflows** — n8n-style node graph for building editing plans
216
+ - **Overlays** — live animated preview of custom JSX overlays
217
+ - **Profiles** — view creator style profiles (pacing, color palette, editorial direction)
218
+
219
+ The UI is a layer on top of the CLI, not a separate system. Every action maps to a CLI command.
220
+
221
+ ## Project JSON
222
+
223
+ The single format that flows through the entire pipeline. One file, three states:
224
+
225
+ | State | Who writes | Contents |
226
+ |-------|-----------|----------|
227
+ | `pending` | `montaj serve` / `montaj run` | Clip paths, prompt, workflow name |
228
+ | `draft` | Agent | Trim points, ordering, captions, overlays — complete edit |
229
+ | `final` | Human (via UI) | Reviewed and tweaked, ready to render |
230
+
231
+ For AI video projects, the storyboard (scenes, image refs, style refs) lives inside the same `project.json`.
232
+
233
+ See the [Core Concepts](https://docs.montaj.ag/concepts) page and [docs/schemas/project.md](docs/schemas/project.md) for the full schema.
234
+
235
+ ## Docs
236
+
237
+ Full documentation at **[docs.montaj.ag](https://docs.montaj.ag)**:
238
+
239
+ - [Installation](https://docs.montaj.ag/installation) — Homebrew, PyPI, source
240
+ - [Quick Start](https://docs.montaj.ag/quickstart) — first project in 2 minutes
241
+ - [CLI Reference](https://docs.montaj.ag/cli) — full command list
242
+ - [Steps Reference](https://docs.montaj.ag/steps) — all 27+ built-in steps
243
+ - [Core Concepts](https://docs.montaj.ag/concepts) — architecture, project.json, trim specs, workflows
244
+ - [Render Engine](https://docs.montaj.ag/render) — the compositing pipeline
245
+ - [Agent Integration](https://docs.montaj.ag/agents) — MCP, HTTP API, skills
246
+ - [Connectors](https://docs.montaj.ag/connectors) — Kling, Gemini, OpenAI setup
247
+ - [Extending](https://docs.montaj.ag/extending) — custom steps, workflows, connectors
248
+
249
+ Internal references (for contributors):
250
+ - [Architecture](docs/ARCHITECTURE.md) — deep implementation details
251
+ - [Project JSON Schema](docs/schemas/project.md) — field-level schema reference
252
+ - [Overlay Contract](docs/schemas/overlay.md) — render component spec
253
+
254
+ ## License
255
+
256
+ MIT — do whatever you want. See [LICENSE](LICENSE).
montaj-2.0.0/README.md ADDED
@@ -0,0 +1,204 @@
1
+ <p align="center">
2
+ <img src="Montaj.jpeg" alt="Montaj" width="200" />
3
+ </p>
4
+
5
+ # Montaj
6
+
7
+ > A video editing CLIP for AI agents. CLI-first, agent-native, open source.
8
+
9
+ Montaj is a **CLIP** — a CLI Program for agents. It clips onto your existing AI agent (Claude Code, OpenClaw, Cursor, or any harness) and gives it the specialized tools to edit video. Built-in steps cover the full editing pipeline. The agent decides what to run, in what order, and with what parameters.
10
+
11
+ **The fundamental dependency is an agent.** Montaj doesn't edit on its own. It provides the tools; the agent makes the creative decisions.
12
+
13
+ ## Quick install
14
+ Send this to your agent:
15
+ ```
16
+ Install Montaj from https://github.com/theSamPadilla/montaj, then read skills/onboarding/SKILL.md to get us started.
17
+ ```
18
+
19
+ ## Install
20
+
21
+ **PyPI:**
22
+ ```bash
23
+ pip install montaj
24
+ # install Node.js >=18 separately: https://nodejs.org
25
+ montaj install whisper # whisper-cpp binary + model weights
26
+ montaj install ui # npm deps + UI build
27
+ ```
28
+
29
+ **Homebrew (macOS)** — installs Node.js and all Python deps including bundled ffmpeg:
30
+ ```bash
31
+ brew install theSamPadilla/montaj/montaj
32
+ ```
33
+
34
+ **From source:**
35
+ ```bash
36
+ git clone https://github.com/theSamPadilla/montaj
37
+ cd montaj
38
+ pip install -e ".[connectors]"
39
+ montaj install whisper
40
+ montaj install ui
41
+ ```
42
+
43
+ Optional extras:
44
+ ```bash
45
+ pip install "montaj[connectors]" # Kling, Gemini, OpenAI API connectors
46
+ pip install "montaj[rvm]" # background removal (torch + RVM)
47
+ pip install "montaj[demucs]" # audio stem separation
48
+ montaj install all # whisper + ui + rvm
49
+ ```
50
+
51
+ ## Quick Start
52
+
53
+ ```bash
54
+ # Headless — agent edits, renders, done
55
+ montaj run ./clips --prompt "tight cuts, remove filler, 9:16"
56
+
57
+ # With UI — watch the agent work live, tweak the result
58
+ montaj serve
59
+
60
+ # AI video generation — agent creates from a text prompt via Kling
61
+ montaj serve # then create an ai_video project in the UI
62
+ ```
63
+
64
+ ## What's Inside
65
+
66
+ ```
67
+ steps/ Step executables + JSON schemas (probe, trim, transcribe, generate, etc.)
68
+ workflows/ Editing plans (clean_cut, overlays, ai_video, lyrics_video, etc.)
69
+ skills/ Agent skill contracts (onboarding, edit-session, ai-video-plan, ai-video-generate, etc.)
70
+ connectors/ API connectors (Kling, Gemini, OpenAI)
71
+
72
+ render/ React + Puppeteer + ffmpeg render engine
73
+ serve/ Local HTTP + SSE server (montaj serve)
74
+ ui/ Browser UI (Vite + React + Tailwind)
75
+ docs/ Architecture, CLI reference, UI design, schemas
76
+ ```
77
+
78
+ ## How It Works
79
+
80
+ ```
81
+ 1. Upload clips + write an editing prompt (or describe an AI video)
82
+ 2. montaj creates project.json [pending]
83
+ 3. Agent picks it up, reads the workflow, calls steps as tools
84
+ 4. Agent writes project.json as it works → UI updates live via SSE
85
+ 5. Agent marks project [draft]
86
+ 6. Human reviews in browser (optional) → tweaks → marks [final]
87
+ 7. Render engine → final MP4
88
+ ```
89
+
90
+ ## CLI
91
+
92
+ Every operation is available from the terminal. `montaj` is the full command, `mtj` is the short alias.
93
+
94
+ ```bash
95
+ montaj run ./clips --prompt "tight cuts, upbeat pacing"
96
+ montaj serve
97
+ montaj render
98
+ montaj fetch https://youtube.com/watch?v=...
99
+ ```
100
+
101
+ See the [CLI Reference](https://docs.montaj.ag/cli) for the full documentation.
102
+
103
+ ## Steps & Workflows
104
+
105
+ **Steps** are individual editing operations — Python executables with JSON schemas, callable as agent tools, CLI commands, or API calls. Native steps ship with Montaj; custom steps are any executable that follows the output convention.
106
+
107
+ | Category | Steps |
108
+ |----------|-------|
109
+ | **Inspect** | `probe`, `snapshot`, `analyze_media` |
110
+ | **Clean** | `waveform_trim`, `rm_fillers`, `rm_nonspeech` |
111
+ | **Edit** | `materialize_cut`, `resize`, `extract_audio`, `crop_spec` |
112
+ | **Enrich** | `transcribe`, `caption`, `normalize`, `lyrics_sync`, `lyrics_render` |
113
+ | **Generate** | `kling_generate`, `generate_image`, `eval_scene` |
114
+ | **VFX** | `remove_bg`, `stem_separation` |
115
+ | **Acquire** | `fetch` — download from any URL via yt-dlp |
116
+
117
+ **Workflows** are suggested editing plans — which steps to use and with what default params. The agent reads the plan, reads the prompt, and decides the actual execution.
118
+
119
+ | Workflow | Description |
120
+ |----------|-------------|
121
+ | `clean_cut` | Trim, remove filler, clean audio |
122
+ | `overlays` | Add animated overlays and titles |
123
+ | `ai_video` | Generate video from text via Kling + storyboard |
124
+ | `lyrics_video` | Sync lyrics to audio with animated captions |
125
+ | `animations` | Custom JSX animation compositions |
126
+ | `explainer` | Educational/explainer video style |
127
+ | `floating_head` | Speaker overlay on background footage |
128
+
129
+ Custom steps and workflows are discovered automatically — no registration needed. See the [Steps Reference](https://docs.montaj.ag/steps) and [Core Concepts](https://docs.montaj.ag/concepts) for details.
130
+
131
+ ## Skills
132
+
133
+ Skills are agent-readable contracts that teach the agent how to approach a specific editing task. Each skill describes the goal, the steps to use, the parameter choices, and the quality criteria.
134
+
135
+ Available skills: `onboarding`, `edit-session`, `ai-video-plan`, `ai-video-generate`, `eval-scenes`, `overlay`, `write-overlay`, `animation-sections`, `lyrics-video`, `style-profile`, `serve`, `parallel`, `select-takes`, `waveform-silence`, `camera-vocabulary`, `workflow-builder`, `mcp`.
136
+
137
+ ## Connectors
138
+
139
+ API connectors for external services. Installed via `pip install "montaj[connectors]"`.
140
+
141
+ | Connector | Used for |
142
+ |-----------|----------|
143
+ | **Kling** | AI video generation (v3-omni, video-o1) |
144
+ | **Gemini** | Media analysis, scene evaluation, image generation |
145
+ | **OpenAI** | Image generation, analysis |
146
+
147
+ ## Render Engine
148
+
149
+ React + Puppeteer + ffmpeg. Reads `project.json [final]`, renders captions and overlays frame-by-frame via headless Chrome, composites with source footage via ffmpeg → final MP4.
150
+
151
+ See the [Render Engine](https://docs.montaj.ag/render) docs for the full breakdown.
152
+
153
+ ## UI
154
+
155
+ Optional browser interface. Upload → watch the agent work live → review → render.
156
+
157
+ ```bash
158
+ montaj serve # http://localhost:3000
159
+ ```
160
+
161
+ - **Editor** — timeline, preview player, caption editor, overlay editor
162
+ - **Storyboard** — AI video scene planning with image/style references
163
+ - **Workflows** — n8n-style node graph for building editing plans
164
+ - **Overlays** — live animated preview of custom JSX overlays
165
+ - **Profiles** — view creator style profiles (pacing, color palette, editorial direction)
166
+
167
+ The UI is a layer on top of the CLI, not a separate system. Every action maps to a CLI command.
168
+
169
+ ## Project JSON
170
+
171
+ The single format that flows through the entire pipeline. One file, three states:
172
+
173
+ | State | Who writes | Contents |
174
+ |-------|-----------|----------|
175
+ | `pending` | `montaj serve` / `montaj run` | Clip paths, prompt, workflow name |
176
+ | `draft` | Agent | Trim points, ordering, captions, overlays — complete edit |
177
+ | `final` | Human (via UI) | Reviewed and tweaked, ready to render |
178
+
179
+ For AI video projects, the storyboard (scenes, image refs, style refs) lives inside the same `project.json`.
180
+
181
+ See the [Core Concepts](https://docs.montaj.ag/concepts) page and [docs/schemas/project.md](docs/schemas/project.md) for the full schema.
182
+
183
+ ## Docs
184
+
185
+ Full documentation at **[docs.montaj.ag](https://docs.montaj.ag)**:
186
+
187
+ - [Installation](https://docs.montaj.ag/installation) — Homebrew, PyPI, source
188
+ - [Quick Start](https://docs.montaj.ag/quickstart) — first project in 2 minutes
189
+ - [CLI Reference](https://docs.montaj.ag/cli) — full command list
190
+ - [Steps Reference](https://docs.montaj.ag/steps) — all 27+ built-in steps
191
+ - [Core Concepts](https://docs.montaj.ag/concepts) — architecture, project.json, trim specs, workflows
192
+ - [Render Engine](https://docs.montaj.ag/render) — the compositing pipeline
193
+ - [Agent Integration](https://docs.montaj.ag/agents) — MCP, HTTP API, skills
194
+ - [Connectors](https://docs.montaj.ag/connectors) — Kling, Gemini, OpenAI setup
195
+ - [Extending](https://docs.montaj.ag/extending) — custom steps, workflows, connectors
196
+
197
+ Internal references (for contributors):
198
+ - [Architecture](docs/ARCHITECTURE.md) — deep implementation details
199
+ - [Project JSON Schema](docs/schemas/project.md) — field-level schema reference
200
+ - [Overlay Contract](docs/schemas/overlay.md) — render component spec
201
+
202
+ ## License
203
+
204
+ MIT — do whatever you want. See [LICENSE](LICENSE).
@@ -0,0 +1 @@
1
+ # cli package
@@ -0,0 +1 @@
1
+ # commands package
@@ -0,0 +1,34 @@
1
+ #!/usr/bin/env python3
2
+ """montaj analyze-media — analyze a media file (video, audio, or image) with Gemini Flash."""
3
+ import os, subprocess, sys
4
+ from cli.main import MONTAJ_ROOT, add_global_flags, find_step
5
+ from cli.output import emit, emit_error
6
+
7
+
8
+ def register(subparsers):
9
+ p = subparsers.add_parser("analyze-media", help="Analyze a media file (video, audio, or image) with Gemini Flash (API)")
10
+ p.add_argument("input", help="Media file (video, audio, or image)")
11
+ p.add_argument("--prompt", required=True, help="Question or instruction")
12
+ p.add_argument("--model", default="gemini-2.5-flash")
13
+ p.add_argument("--json-output", dest="json_output", action="store_true",
14
+ help="Ask the model to return structured JSON")
15
+ add_global_flags(p)
16
+ p.set_defaults(func=handle)
17
+
18
+
19
+ def handle(args):
20
+ if not os.path.isfile(args.input):
21
+ emit_error("not_found", f"File not found: {args.input}")
22
+
23
+ cmd = [
24
+ sys.executable,
25
+ find_step("analyze_media"),
26
+ "--input", args.input,
27
+ "--prompt", args.prompt,
28
+ "--model", args.model,
29
+ ]
30
+ if args.json_output: cmd += ["--json-output"]
31
+ if args.out: cmd += ["--out", args.out]
32
+
33
+ result = subprocess.run(cmd, capture_output=True, text=True)
34
+ emit(result, as_json=args.json, quiet=args.quiet)