Skip to content
explainroo
AI and coding agents

How to Make Videos with Gemini CLI

Updated 8 min read

With explainroo How to Make a Narrated Explainer Video with Claude Code and explainroo
On this page
  1. What Gemini CLI Does in the Video Workflow
  2. Prepare Gemini CLI and explainroo
  3. Create a Video with One Gemini CLI Prompt
  4. How explainroo Synchronizes Scenes with Speech
  5. Choose the Video Size and Visual Style
  6. Make a Product Demo from Code or a Website
  7. Let the Agent Check the Finished Video
  8. Add Music, Sound Effects, and Captions
  9. Review the Files Gemini Creates
  10. Publish Through Gemini CLI
  11. Know When Gemini CLI and explainroo Are the Wrong Fit

Gemini CLI is a command-line coding agent: you describe a task in a terminal, and Gemini can write files, run shell commands, and work with local projects. It does not provide a documented, built-in command that turns a text prompt directly into a finished video file.

For narrated explainer videos and product demos, use Gemini CLI as the agent and explainroo as the local video-making kit. explainroo is free, open source, and licensed under MIT. Gemini writes the video plan and scene code, while explainroo renders the scenes, synchronizes them with narration, adds sound, checks the result, and creates an MP4.

The shortest workflow is:

  1. Install Gemini CLI and the prerequisites for explainroo.
  2. Ask Gemini CLI to clone explainroo and follow its AGENTS.md instructions.
  3. Give Gemini a topic or product to demonstrate.
  4. Review the generated script.md, scenes.js, and validation output.
  5. Retrieve the finished file from videos/<name>/out/video.mp4.

This workflow suits tutorials, product walkthroughs, technical explainers, onboarding videos, and social clips. It does not edit existing camera footage or create talking avatars.

What Gemini CLI Does in the Video Workflow

Gemini CLI turns a topic into narration, writes JavaScript to draw scenes, runs the required tools, and revises the video when you describe a problem.

explainroo makes the video on your computer using the files Gemini creates:

  • script.md contains the narrator’s spoken words.
  • scenes.js contains JavaScript that draws each scene.
  • video.json controls settings such as the visual style, size, and playback pace.

explainroo combines these files into an MP4 and syncs the images with the narration for you.

Gemini CLI and Google’s video-generation products serve different purposes. Google’s Gemini Enterprise Agent Platform supports text-to-video generation through Gemini Omni Flash or Veo, while Veo 3 image-to-video is available in the Gemini app for Pro and Ultra subscribers. Those services are separate from the local explainroo workflow. Gemini CLI acts as the coding agent that operates explainroo.

Prepare Gemini CLI and explainroo

Install a current version of Node.js, FFmpeg, and Chrome or Chromium before asking Gemini CLI to make a video. FFmpeg is a command-line tool that combines video and audio with images and timing to create a final media file. Chrome or Chromium runs the browser-based canvas renderer that draws each frame.

During the first setup, explainroo downloads the voice and timing models. No graphics card is required. explainroo is developed on Linux, and its tests run on Linux, macOS, and Windows.

If you want to install explainroo yourself, run:

git clone <explainroo-repository-url>
cd explainroo
npm install
node bin/explainroo.js doctor --fetch

The doctor --fetch command checks the local dependencies and downloads the required models. The explainroo documentation contains the current setup details.

After that, start Gemini CLI in a directory where you want the project created. Gemini CLI needs permission to run shell commands. It uses them to install dependencies, generate scenes, render frames, and inspect explainroo’s checks.

Create a Video with One Gemini CLI Prompt

The supported explainroo workflow starts with a prompt that tells Gemini to use the repository instructions:

Make me a short explainer video about [your topic]. Use explainroo for it: clone https://github.com/vincentsch/explainroo, read its AGENTS.md and follow the steps.

Replace [your topic] with a specific subject. For example:

Make me a short explainer video about how password managers store and retrieve credentials. Use explainroo for it: clone https://github.com/vincentsch/explainroo, read its AGENTS.md and follow the steps.

A focused topic helps Gemini write a clear script and plan the scenes. Instead of “make a video about databases,” specify “explain how an index speeds up a database lookup for new developers.” The second request gives the narration a clear audience and a visual mechanism to show.

Gemini then sets up explainroo, writes the script and scene code, renders the video, runs the checks, and saves an MP4 file. The output is saved at:

videos/<name>/out/video.mp4

Ask Gemini for revisions in the same session or from the project directory. Useful requests include:

Make the narration shorter and replace the third scene with a database lookup diagram.

Use the clean look and a widescreen layout.

Move the code example lower so it does not overlap the heading.

Make the narration quicker.

The agent changes the relevant files and runs the rendering process again.

How explainroo Synchronizes Scenes with Speech

explainroo keeps the narration and scene drawings in separate files. Gemini can revise either one without editing a timeline.

Kokoro, an open voice model, reads script.md aloud. It includes English voices with American and British options. You can use the voice without an account or API key, and narration is in English and seven other languages.

Whisper analyzes the recording and marks when each word is spoken. Whisper is a speech-recognition model used here for word-level timing. explainroo uses those timings to show a drawing when the narration reaches the chosen word. For example, a lock icon can appear when the narrator says “encrypted,” or a database table can appear when the script reaches “index.”

Chrome runs in the background and draws each frame on an HTML canvas, a browser surface for programmatically drawing text and shapes. It also supports images and animations. Scenes can use hand-drawn lines through Rough.js and Lucide icons. They can also include charts, code, and screenshots.

FFmpeg then combines the rendered frames, narration, music, and sound effects into the MP4.

Choose the Video Size and Visual Style

Choose a video format that matches where you will publish it:

  • Use a widescreen format for standard YouTube videos.
  • Use a vertical format for YouTube Shorts, TikTok, and Instagram Reels.
  • Use 4:5 for Instagram and LinkedIn posts.
  • Use 1:1 for square placements.

Word-by-word captions appear on videos in tall, 4:5, and square formats. The tall layout also keeps text away from the areas where social platforms place buttons and other controls.

explainroo provides six visual looks: paper, clean, and chalk. The other three are blueprint, midnight, and editorial. Change the look with one setting in video.json. Give Gemini a direct instruction when you want a particular style:

Use the blueprint look, 16:9 format, and captions suitable for a technical tutorial.

The pace setting in video.json controls the voice, pauses, and animations. Values range from 0.7 to 1.6. Use a slower value for dense technical material and a faster value for a short social clip.

Make a Product Demo from Code or a Website

explainroo also supports product demonstrations. Tell Gemini which product to show and provide the location of its code or website. The agent rebuilds the product screens with matching colors, fonts, and button labels. It can animate a mouse pointer clicking through screens and typing into fields while the narration explains each step.

For example:

Make a product demo for [product name]. Use explainroo for it: clone https://github.com/vincentsch/explainroo, read its AGENTS.md and follow the steps. Use the product code at [local path or repository URL]. Show a user completing [specific task].

A strong product-demo request names one user goal, such as creating a project, finding a report, or submitting a form. It also tells Gemini where to find the product source. A broad request to “show the whole product” produces a less focused sequence than a request centered on one task.

Use real screenshots when an exact interface matters. explainroo can include screenshots alongside charts, code, icons, and generated drawings.

Let the Agent Check the Finished Video

Gemini CLI cannot watch a video like a person. explainroo creates checks that Gemini can inspect:

  • Still images for each scene
  • A contact sheet of small frames from the video
  • A layout check for cut-off text and overlapping elements
  • A speech check for words the voice pronounced incorrectly

Ask Gemini to review those outputs before accepting the MP4:

Review the scene stills, contact sheet, layout check, and speech check. Fix any cut-off text, overlaps, or incorrect spoken words, then render the video again.

Reviewing these outputs catches problems that code inspection alone misses. A scene can contain valid JavaScript while placing text beyond the canvas boundary. A script can contain the right spelling while the voice model pronounces a technical term incorrectly. The stills and speech check expose those issues before publication.

Add Music, Sound Effects, and Captions

explainroo creates background music for each video, adds small sound effects, and lowers the music while the narrator speaks. This lowers the music under the narration, so the voice is easier to hear without manual audio mixing.

Captions appear automatically for the vertical, 4:5, and square formats, with words lighting up as they are spoken. For a technical audience, keep captions readable and avoid placing dense code behind them. Ask Gemini to shorten a caption-heavy scene or move visual details to a later scene when the screen becomes crowded.

Optional AI illustrations are available through OpenRouter and are paid for per image. The rest of the explainroo video pipeline costs nothing per video with built-in voices. The coding agent itself is a separate service with its own pricing.

Review the Files Gemini Creates

Before making final revisions, inspect the two main source files:

script.md
scenes.js

Read script.md when the explanation is too long, too vague, or aimed at the wrong audience. Read scenes.js when the narration works but a diagram, label, chart, or interface element needs to move.

Keeping the files separate makes revisions predictable: script edits affect narration and word timing, while scene-code edits affect drawings and layout. Adjusting the pace setting changes timing for the complete video without requiring every scene animation to be rewritten.

Publish Through Gemini CLI

Gemini CLI can also manage YouTube publishing when connected to a service such as the Hermoso MCP server. MCP, or Model Context Protocol, lets an agent use tools from another service. Hermoso provides YouTube actions for uploading and scheduling videos, managing thumbnails and metadata, and handling comments and analytics.

A finished video can be uploaded with a title, description, tags, thumbnail, and unlisted visibility in one terminal session. Unlisted means viewers with the link can watch the video while it remains out of public search and channel listings. YouTube’s API does not create Studio drafts, so unlisted is the closest review state.

Check publishing permissions before you let the agent upload a video. Hermoso is a third-party dependency with no affiliation with or endorsement by Google. Its --trust option skips confirmations, including before publishing, risking unintended uploads, so review the video and metadata manually before allowing a publish action.

YouTube also applies account and project restrictions. Custom thumbnails require a phone-verified channel, and an unverified Google project has videos.insert locked to private. These restrictions apply when publishing through YouTube’s API. They do not affect creating the MP4 locally.

Know When Gemini CLI and explainroo Are the Wrong Fit

The Gemini CLI and explainroo workflow is designed for generated explainer scenes and product demos. Choose another production approach to edit existing camera footage or create a talking avatar. Do the same if you need to generate live-action footage or arrange clips in a drag-and-drop editor.

explainroo works by having you describe the video to a coding agent. Gemini writes or changes the files, and explainroo renders the result. This approach gives you editable source code and lets you render the video locally again. It requires you to work with prompts, files, shell commands, and repeated reviews.

For supported use cases, the main decision is straightforward: use Gemini CLI as the agent, and use explainroo to turn the agent’s script and scene code into a checked MP4.

Free and open source

Let your AI agent make the video

explainroo lets a coding agent like Claude Code or Codex make narrated explainer videos and product demos. The voice, the word timing and the rendering run on your own computer, with no API key and no cost per video. Optional outside services use your own key.

Copy this into your AI agent

Make me a short explainer video about [your topic]. Use explainroo for it: run npx --yes explainroo docs and follow what it prints.

Getting started Example videos GitHub

Made with explainroo: How explainroo makes a video

More on ai and coding agents

All guides on ai and coding agents