2026-06-29 16:22:01 +08:00
PYTHON_VERSION ?= 3.10
VENV_DIR ?= .venv
BASE_PYTHON ?= $( shell command -v python$( PYTHON_VERSION) 2>/dev/null || command -v python3 2>/dev/null || command -v python 2>/dev/null)
RUN_PYTHON = $( shell for dir in " $$ VIRTUAL_ENV " " $$ CONDA_PREFIX " " $( VENV_DIR) " ; do if [ -n " $$ dir " ] && [ -x " $$ dir/bin/python " ] ; then printf "%s/bin/python" " $$ dir " ; exit 0; elif [ -n " $$ dir " ] && [ -x " $$ dir/Scripts/python.exe " ] ; then printf "%s/Scripts/python.exe" " $$ dir " ; exit 0; fi ; done ; if [ " $( OS) " = "Windows_NT" ] ; then printf "%s/Scripts/python.exe" " $( VENV_DIR) " ; else printf "%s/bin/python" " $( VENV_DIR) " ; fi )
PIP = $( RUN_PYTHON) -m pip
.DEFAULT_GOAL := setup
.PHONY : setup install install -dev install -gpu test test -contracts lint clean preflight demo demo -list hyperframes -doctor hyperframes -warm venv ensure -venv
# ---- Virtual environment ----
ensure-venv :
@if [ -n " $$ VIRTUAL_ENV " ] && { [ -x " $$ VIRTUAL_ENV/bin/python " ] || [ -x " $$ VIRTUAL_ENV/Scripts/python.exe " ] ; } ; then \
echo " ==> Using active virtual environment: $$ VIRTUAL_ENV " ; \
elif [ -n " $$ CONDA_PREFIX " ] && { [ -x " $$ CONDA_PREFIX/bin/python " ] || [ -x " $$ CONDA_PREFIX/Scripts/python.exe " ] ; } ; then \
echo " ==> Using active conda environment: $$ CONDA_PREFIX " ; \
elif [ -x " $( VENV_DIR) /bin/python " ] || [ -x " $( VENV_DIR) /Scripts/python.exe " ] ; then \
echo " ==> Using existing virtual environment: $( VENV_DIR) " ; \
elif command -v uv >/dev/null 2>& 1; then \
echo " ==> Creating virtual environment with uv (Python $( PYTHON_VERSION) +): $( VENV_DIR) " ; \
uv venv --python $( PYTHON_VERSION) " $( VENV_DIR) " ; \
else \
if [ -z " $( BASE_PYTHON) " ] ; then \
echo " ERROR: Python $( PYTHON_VERSION) + is required, but no python executable was found. " ; \
exit 1; \
fi ; \
" $( BASE_PYTHON) " -c " import sys; required=tuple(map(int, ' $( PYTHON_VERSION) '.split('.')[:2])); raise SystemExit(0 if sys.version_info[:2] >= required else 1) " || { \
echo " ERROR: OpenMontage requires Python $( PYTHON_VERSION) +. " ; \
echo " Install uv or Python $( PYTHON_VERSION) +, then run make again. " ; \
exit 1; \
} ; \
echo " ==> Creating virtual environment with Python venv: $( VENV_DIR) " ; \
" $( BASE_PYTHON) " -m venv " $( VENV_DIR) " || { \
echo " ERROR: Could not create $( VENV_DIR) . Install uv or ensure python venv support is available. " ; \
exit 1; \
} ; \
fi
@$( RUN_PYTHON) -c " import sys; required=tuple(map(int, ' $( PYTHON_VERSION) '.split('.')[:2])); raise SystemExit(0 if sys.version_info[:2] >= required else 1) " || { \
echo " ERROR: OpenMontage requires Python $( PYTHON_VERSION) +. " ; \
echo " Current interpreter is $$ ( $( RUN_PYTHON) -c 'import sys; print(\".\".join(map(str, sys.version_info[:3])))' 2>/dev/null || echo unavailable): $( RUN_PYTHON) " ; \
echo " Activate a compatible environment or remove it so make can create $( VENV_DIR) . " ; \
exit 1; \
}
@$( RUN_PYTHON) -m pip --version >/dev/null 2>& 1 || $( RUN_PYTHON) -m ensurepip --upgrade >/dev/null
venv : ensure -venv
@echo "==> Virtual environment ready."
@echo " Python: $( RUN_PYTHON) "
@if [ -z " $$ VIRTUAL_ENV " ] && [ -z " $$ CONDA_PREFIX " ] ; then if [ " $( OS) " = "Windows_NT" ] ; then echo " Activate with: $( VENV_DIR) \\Scripts\\Activate.ps1 " ; else echo " Activate with: source $( VENV_DIR) /bin/activate " ; fi ; fi
Initial release — OpenMontage: the first open-source agentic video production system
11 production pipelines, 47 tools, 124 agent skills.
Supports cloud APIs (fal.ai, OpenAI, ElevenLabs, Suno, HeyGen, Runway) and
free local providers (diffusers, Piper TTS, WAN 2.1, Hunyuan, CogVideo).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-29 08:25:17 -07:00
# ---- One-command setup ----
2026-06-29 16:22:01 +08:00
setup : ensure -venv
Initial release — OpenMontage: the first open-source agentic video production system
11 production pipelines, 47 tools, 124 agent skills.
Supports cloud APIs (fal.ai, OpenAI, ElevenLabs, Suno, HeyGen, Runway) and
free local providers (diffusers, Piper TTS, WAN 2.1, Hunyuan, CogVideo).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-29 08:25:17 -07:00
@echo "==> Installing Python dependencies..."
2026-06-29 16:22:01 +08:00
$( PIP) install -r requirements.txt
Initial release — OpenMontage: the first open-source agentic video production system
11 production pipelines, 47 tools, 124 agent skills.
Supports cloud APIs (fal.ai, OpenAI, ElevenLabs, Suno, HeyGen, Runway) and
free local providers (diffusers, Piper TTS, WAN 2.1, Hunyuan, CogVideo).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-29 08:25:17 -07:00
@echo ""
@echo "==> Installing Remotion composer..."
cd remotion-composer && npm install
@echo ""
@echo "==> Installing free offline TTS (Piper)..."
2026-06-29 16:22:01 +08:00
$( PIP) install piper-tts || echo " [skip] piper-tts install failed — TTS will use cloud providers instead"
Initial release — OpenMontage: the first open-source agentic video production system
11 production pipelines, 47 tools, 124 agent skills.
Supports cloud APIs (fal.ai, OpenAI, ElevenLabs, Suno, HeyGen, Runway) and
free local providers (diffusers, Piper TTS, WAN 2.1, Hunyuan, CogVideo).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-29 08:25:17 -07:00
@echo ""
2026-04-18 18:37:00 -07:00
@echo "==> Installing HyperFrames runtime (cache-warm via npx)..."
@echo " Pulls the 'hyperframes' npm package into the local npx cache so the"
@echo " first render doesn't pay a 30-60s cold-fetch penalty. ~20MB of disk."
@npx --yes hyperframes --version >/dev/null 2>& 1 && echo " HyperFrames CLI cached (npx)" || echo " [skip] HyperFrames cache-warm failed — offline or npm unavailable; first render will fetch on demand"
2026-06-29 16:22:01 +08:00
@$( RUN_PYTHON) -c "from tools.video.hyperframes_compose import HyperFramesCompose; HyperFramesCompose._npm_resolve_cache=None; c=HyperFramesCompose()._runtime_check(); print(f' HyperFrames runtime_available={c[\"runtime_available\"]}, npm={c.get(\"npm_package_version\") or c.get(\"npm_resolve_error\")}'); [print(f' note: {r}') for r in c['reasons']]" || echo " [skip] HyperFrames check failed — runtime can be set up later"
2026-04-18 18:37:00 -07:00
@echo ""
2026-06-29 16:22:01 +08:00
$( RUN_PYTHON) -c "import shutil, os; e=os.path.exists('.env'); shutil.copy('.env.example','.env') if not e else None; print('==> Created .env from .env.example — add your API keys there.' if not e else '==> .env already exists — skipping.')"
Initial release — OpenMontage: the first open-source agentic video production system
11 production pipelines, 47 tools, 124 agent skills.
Supports cloud APIs (fal.ai, OpenAI, ElevenLabs, Suno, HeyGen, Runway) and
free local providers (diffusers, Piper TTS, WAN 2.1, Hunyuan, CogVideo).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-29 08:25:17 -07:00
@echo ""
@echo "Done! Open this project in your AI coding assistant and start creating."
@echo " Optional: add API keys to .env to unlock cloud providers."
@echo " Optional: run 'make install-gpu' if you have an NVIDIA GPU."
2026-04-18 18:37:00 -07:00
@echo " Optional: run 'make hyperframes-doctor' to fully validate the HyperFrames runtime."
@echo " Optional: run 'make hyperframes-warm' anytime to refresh the npx cache to the latest hyperframes version."
Initial release — OpenMontage: the first open-source agentic video production system
11 production pipelines, 47 tools, 124 agent skills.
Supports cloud APIs (fal.ai, OpenAI, ElevenLabs, Suno, HeyGen, Runway) and
free local providers (diffusers, Piper TTS, WAN 2.1, Hunyuan, CogVideo).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-29 08:25:17 -07:00
# ---- Individual installs ----
2026-06-29 16:22:01 +08:00
install : ensure -venv
$( PIP) install -r requirements.txt
Initial release — OpenMontage: the first open-source agentic video production system
11 production pipelines, 47 tools, 124 agent skills.
Supports cloud APIs (fal.ai, OpenAI, ElevenLabs, Suno, HeyGen, Runway) and
free local providers (diffusers, Piper TTS, WAN 2.1, Hunyuan, CogVideo).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-29 08:25:17 -07:00
2026-06-29 16:22:01 +08:00
install-dev : ensure -venv
$( PIP) install -r requirements-dev.txt
Initial release — OpenMontage: the first open-source agentic video production system
11 production pipelines, 47 tools, 124 agent skills.
Supports cloud APIs (fal.ai, OpenAI, ElevenLabs, Suno, HeyGen, Runway) and
free local providers (diffusers, Piper TTS, WAN 2.1, Hunyuan, CogVideo).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-29 08:25:17 -07:00
2026-06-29 16:22:01 +08:00
install-gpu : ensure -venv
$( PIP) install -r requirements-gpu.txt
$( PIP) install diffusers transformers accelerate
Initial release — OpenMontage: the first open-source agentic video production system
11 production pipelines, 47 tools, 124 agent skills.
Supports cloud APIs (fal.ai, OpenAI, ElevenLabs, Suno, HeyGen, Runway) and
free local providers (diffusers, Piper TTS, WAN 2.1, Hunyuan, CogVideo).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-29 08:25:17 -07:00
# ---- Testing ----
2026-06-29 16:22:01 +08:00
test : ensure -venv
$( RUN_PYTHON) -m pytest tests/ -v
Initial release — OpenMontage: the first open-source agentic video production system
11 production pipelines, 47 tools, 124 agent skills.
Supports cloud APIs (fal.ai, OpenAI, ElevenLabs, Suno, HeyGen, Runway) and
free local providers (diffusers, Piper TTS, WAN 2.1, Hunyuan, CogVideo).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-29 08:25:17 -07:00
2026-06-29 16:22:01 +08:00
test-contracts : ensure -venv
$( RUN_PYTHON) -m pytest tests/contracts/ -v
Initial release — OpenMontage: the first open-source agentic video production system
11 production pipelines, 47 tools, 124 agent skills.
Supports cloud APIs (fal.ai, OpenAI, ElevenLabs, Suno, HeyGen, Runway) and
free local providers (diffusers, Piper TTS, WAN 2.1, Hunyuan, CogVideo).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-29 08:25:17 -07:00
# ---- Utilities ----
2026-06-29 16:22:01 +08:00
preflight : ensure -venv
$( RUN_PYTHON) -c "from tools.tool_registry import registry; import json; registry.discover(); print(json.dumps(registry.provider_menu(), indent=2))"
Initial release — OpenMontage: the first open-source agentic video production system
11 production pipelines, 47 tools, 124 agent skills.
Supports cloud APIs (fal.ai, OpenAI, ElevenLabs, Suno, HeyGen, Runway) and
free local providers (diffusers, Piper TTS, WAN 2.1, Hunyuan, CogVideo).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-29 08:25:17 -07:00
2026-06-29 16:22:01 +08:00
hyperframes-doctor : ensure -venv
2026-04-18 18:37:00 -07:00
@echo "==> Probing HyperFrames runtime (node/ffmpeg/npx + hyperframes doctor)..."
2026-06-29 16:22:01 +08:00
$( RUN_PYTHON) -c "from tools.video.hyperframes_compose import HyperFramesCompose; r=HyperFramesCompose().execute({'operation':'doctor'}); import json; print(json.dumps(r.data, indent=2)); print('OK' if r.success else f'FAIL: {r.error}')"
2026-04-18 18:37:00 -07:00
hyperframes-warm :
@echo "==> Refreshing the HyperFrames npx cache to latest..."
@echo " Uses --prefer-online so npx picks up new releases since your last run."
npx --yes --prefer-online hyperframes --version
@echo "==> Cache warm complete."
2026-06-29 16:22:01 +08:00
demo : ensure -venv
2026-03-30 13:23:28 -07:00
@echo "==> Rendering zero-key demo videos (no API keys needed)..."
@echo " These use only Remotion components — animated charts, text, data viz."
@echo ""
2026-06-29 16:22:01 +08:00
$( RUN_PYTHON) render_demo.py
2026-03-30 13:23:28 -07:00
2026-06-29 16:22:01 +08:00
demo-list : ensure -venv
$( RUN_PYTHON) render_demo.py --list
2026-03-30 13:23:28 -07:00
2026-06-29 16:22:01 +08:00
lint : ensure -venv
$( RUN_PYTHON) -m py_compile tools/base_tool.py
$( RUN_PYTHON) -m py_compile tools/tool_registry.py
$( RUN_PYTHON) -m py_compile tools/cost_tracker.py
$( RUN_PYTHON) -m py_compile tools/analysis/composition_validator.py
Initial release — OpenMontage: the first open-source agentic video production system
11 production pipelines, 47 tools, 124 agent skills.
Supports cloud APIs (fal.ai, OpenAI, ElevenLabs, Suno, HeyGen, Runway) and
free local providers (diffusers, Piper TTS, WAN 2.1, Hunyuan, CogVideo).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-29 08:25:17 -07:00
clean :
2026-06-29 16:22:01 +08:00
$( BASE_PYTHON) -c " import pathlib, shutil; excluded=[pathlib.Path(' $( VENV_DIR) '), pathlib.Path('venv')]; skip=lambda p: any(p == root or root in p.parents for root in excluded); roots=[p for p in pathlib.Path('.').rglob('__pycache__') if not skip(p)]; [shutil.rmtree(p) for p in roots]; files=[p for p in pathlib.Path('.').rglob('*.pyc') if not skip(p)]; [p.unlink() for p in files] "