How codevideo/codevideo-cli works
Project type and purpose
• This is an open-source CLI tool (“codevideo-cli”) written in Go, with a small Node.js helper (“puppeteer-runner”).
• Its purpose is to generate “CodeVideos” by driving a headless browser (via Puppeteer) against an embedded static web UI, capturing frames, stitching them into a video, and optionally uploading or emailing results.
File structure
• Top-level:
– Dockerfile, .github/workflows (CI/CD), go.mod/go.sum
– main.go: entrypoint that parses flags (mode, project data, serve, etc.)
– cli/: the core subpackages for the interactive command:
• config/: load .env and CLI flags
• detector/: detect input type (actions, lesson, course, Git repo)
• generator/: orchestrate video generation steps
• renderer/: assemble images/frames into MP4
• staticserver/: embed and serve the Gatsby-produced static UI
– puppeteer-runner/: Node.js script that Puppeteer uses to visit pages and record frames
– server/: HTTP server mode (–mode=serve) that exposes REST endpoints for generating videos
– cloud/, mail/, files/: modules for optional upload, email, file management
– elevenlabs/: wrapper for ElevenLabs TTS API
– utils/: helper conversions, hashing, port discovery, resource usage
– data/: sample JSON for actions, lessons, courses
– types/, constants/: shared data types and constants
README for additional insights
• Describes installation (brew, binaries, build-from-source)
• CLI usage patterns: local generation, server mode, Docker
• Explains how to swap out the static “public” folder for custom UI
• Mentions external dependency: ElevenLabs API key