What It Does
Content Machine is a CLI tool that generates short-form videos (TikTok, Reels, Shorts) from a topic in 4 automated stages:
The 4-stage pipeline: topic → script → audio → visuals → video
- Script Generation - AI writes a script with hooks, scenes, and visual directions
- Audio Synthesis - Local TTS generates speech with word-level timestamps
- Visual Matching - Stock footage is matched to each scene via keyword extraction
- Video Rendering - Remotion composites everything with TikTok-style captions
# Generate a complete video from a topic
cm generate "5 productivity hacks for developers" --archetype listicle
# Or run stages independently
cm script "topic" --archetype howto
cm audio ./script.json --tts-engine kokoro
cm visuals ./audio-manifest.json --provider pexels
cm render ./visuals-manifest.json --template tiktok-captions
Architecture
content-machine/
├── src/
│ ├── cli/ # 24+ commands (generate, script, audio, etc.)
│ ├── pipelines/ # Stage orchestration
│ ├── llm/ # OpenAI, Anthropic, Google AI adapters
│ ├── audio/ # Kokoro TTS + Whisper ASR
│ ├── visuals/ # Pexels, gameplay clips
│ ├── render/ # Remotion compositions
│ └── schemas/ # Zod validation for all artifacts
├── remotion/ # Video templates and caption components
└── tests/ # 193 test files, 1400+ tests
Technical Highlights
Local Audio Pipeline (No API Costs)
- TTS: Kokoro-js runs locally on quantized ONNX models (11 voices)
- ASR: Whisper.cpp generates word-level timestamps
- Reconciliation: Custom algorithm realigns Whisper output to original script for 4.4x better sync accuracy
Script Archetypes
Six built-in content formats:
listicle- “5 things you didn’t know about…”versus- “X vs Y - which is better?”howto- Step-by-step tutorialsmyth- “Myth vs Reality”story- Narrative formathot-take- Opinion pieces
Video Templates
// Built-in Remotion templates
const templates = [
'tiktok-captions', // Word-highlighted captions
'capcut', // CapCut style
'hormozi', // Alex Hormozi style
'karaoke', // Karaoke-style highlights
'gameplay-top', // Split-screen with gameplay
'gameplay-bottom', // Gameplay on bottom half
];
Quality Gates
Every video is scored before export:
- Caption sync accuracy (target: 99%+)
- Audio quality rating
- Visual coverage validation
- Automated retry on quality failures
Research Integration
Optional research stage pulls from multiple sources:
cm research "AI agents" --sources hackernews,reddit,tavily --time-range week
- Hacker News trending
- Reddit discussions
- Tavily web search
- Brave Search API
Research findings are injected as evidence into scripts.
Current Status
v0.2.2 - Early development, actively maintained
Working:
- Full end-to-end pipeline
- All 1,400+ tests passing
- NPM package published
- Demo videos generated
Roadmap:
- Review queue UI
- Multi-platform scheduling
- Analytics dashboard
- Trend detection via MCP
Demo Videos
Split-Screen Gameplay + Content (Brainrot Template)
Minecraft gameplay (top) + Subway Surfers (bottom) with AI-generated script overlay
Subway Surfers-Style with TikTok Captions
Full-screen gameplay with word-highlighted TikTok-style captions
Latest News Listicle
Auto-generated listicle with numbered badges, TikTok chunk captions, and Pexels stock footage
Why CLI-First?
Export-first design means:
- Human review before publishing
- CI/CD integration for batch generation
- No platform API verification required
- Full control over output quality