Skip to main content

Generate video tutorials from automated tests using LLMs

Project description

Codevid

Codevid Logo

Turn your automated tests into professional video tutorials.

Codevid is a CLI tool that uses AI to convert your existing Python Playwright tests into narrated, captioned video tutorials. It analyzes your test code, generates a natural language script, records the execution, and automatically edits everything into a polished video.

🎬 How It Works

demo2.webm

Generated Tutorial

Here's the result - a fully narrated video tutorial generated from the test above:

https://github.com/user-attachments/assets/4f67a0cd-6702-41a5-80ea-c289e092b12a

🚀 Features

  • Automated Scriptwriting: Uses LLMs (OpenAI/Anthropic) to explain why an action is happening, not just what is happening.
  • Real Execution: Records your actual app in a browser to ensure the video matches reality.
  • AI Voiceovers: Integrated Text-to-Speech (OpenAI/Edge TTS) for professional narration.
  • Smart Editing: Automatically synchronizes video speed with audio narration and adds captions.

📋 Prerequisites

  • Python 3.11+
  • OpenAI API Key: Codevid requires access to an LLM to generate the narration script.

🛠️ Installation

  1. Install Codevid (assuming it is available via pip or from source):

    pip install codevid
    
  2. Install Playwright Browsers:

    playwright install chromium
    

🔑 Configuration

You must provide your OpenAI API key for the tool to function.

export OPENAI_API_KEY="sk-..."

(Alternatively, you can configure Anthropic/Claude keys if you prefer that provider in the config).

⚡ Quick Start

  1. Initialize a project (optional, creates a codevid.yaml config file):

    codevid init
    
  2. Generate a video: Pass your Playwright test file to the generate command.

    codevid generate examples/test_login.py -o login_tutorial.mp4
    

📖 Usage Examples

Basic Generation

Uses default settings (Anthropic/Edge TTS if not configured otherwise) to generate a video.

codevid generate tests/my_test.py

Using OpenAI for Everything

Specify the LLM and TTS provider explicitly via CLI flags.

codevid generate tests/my_test.py \
    --llm openai \
    --tts openai \
    --voice alloy \
    --output tutorial.mp4

Preview Script Only

Want to see what the AI will say before recording? Use preview mode.

codevid preview tests/my_test.py

List Available Voices

See which voices are available for your chosen provider.

codevid list-voices openai

⚠️ Current Limitations

  • Audio-video sync: A major limitation right now is the video and audio sync - But I am working on improving it :)
  • Framework Support: Currently, Codevid only supports Python Playwright tests.
  • Structure: Tests must be written as standard functions or Pytest functions (e.g., def test_example(page):).

📄 License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

codevid-1.2.0.tar.gz (3.2 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

codevid-1.2.0-py3-none-any.whl (54.2 kB view details)

Uploaded Python 3

File details

Details for the file codevid-1.2.0.tar.gz.

File metadata

  • Download URL: codevid-1.2.0.tar.gz
  • Upload date:
  • Size: 3.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for codevid-1.2.0.tar.gz
Algorithm Hash digest
SHA256 e2ea3a29581f57743875ea1e8a73d1b40ae4fc44765217e19f7b4e34e6ae2f4f
MD5 49b06ad72c495e959e2358178db1e453
BLAKE2b-256 808eb675e62b0995b931060bb1b2aea73cdf4940e5a1bb3185f36d17020b827d

See more details on using hashes here.

Provenance

The following attestation bundles were made for codevid-1.2.0.tar.gz:

Publisher: release.yml on MStaniaszek1998/codevid

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file codevid-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: codevid-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 54.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for codevid-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2aa5e0f4dd5ca745f949f4f36b9bc3b2dfc8fab5502e51650c10ca9f9fefbf77
MD5 c68b6b08b2332836d7bcc7c187c247b1
BLAKE2b-256 4cf99284e453dbbce2b16a05abf91185f0342dc398b328f0aba8305f17c0fd45

See more details on using hashes here.

Provenance

The following attestation bundles were made for codevid-1.2.0-py3-none-any.whl:

Publisher: release.yml on MStaniaszek1998/codevid

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page