Skip to content

Repository files navigation


Auto Live Coding Recorder

Automated live coding session recording with OBS integration, high-quality GIF conversion, and automatic GitHub upload with README updates.

English | Português


Features

  • Terminal-Style CLI: Interactive menu with ASCII art and typewriter effects for a powerful coding experience
  • OBS WebSocket Integration: Full control over OBS Studio recording programmatically
  • Timer-Based Recording: Configurable duration with live progress display
  • High-Quality GIF Conversion: Two-pass ffmpeg conversion with optimal palette generation
  • Automatic GitHub Upload: Uploads to GitHub Release Assets with automatic README updates
  • Constant Recording Mode: Continuous loop recording for extended sessions
  • Live Configuration: Change settings on-the-fly without restart
  • Smart File Cleanup: Clean output folders with confirmation
  • Clean Architecture: SOLID principles, 100% test coverage, TDD approach

Tech Stack

  • TypeScript 5.0+
  • Node.js
  • OBS WebSocket API
  • ffmpeg (GIF conversion)
  • GitHub REST API
  • Jest (Testing)

Installation & Demonstration

git clone + 
npm install 

Configuration

  1. Copy the example environment file:
cp .env.example .env
  1. Edit .env with your settings:
# OBS WebSocket Configuration
OBS_HOST=localhost
OBS_PORT=4455
OBS_PASSWORD=your_obs_password

# Recording Configuration
OUTPUT_DIR=recordings
RECORDING_BITRATE_KBPS=5000
RECORDING_DURATION_SECONDS=60

# GitHub Configuration
GITHUB_TOKEN=your_github_token
GITHUB_REPO=username/repository
GITHUB_BRANCH=main

# GIF Configuration
GIF_FPS=30
GIF_WIDTH=1200

# Terminal Configuration
TERMINAL_TYPE_SPEED=15
  1. Enable OBS WebSocket:
    • Open OBS Studio
    • Go to Tools → WebSocket Server Settings
    • Enable WebSocket server
    • Set password (use in .env)

Usage

Start the CLI

npm start

or

npm run dev

Main Menu Options

[1] Start Recording          - Record a single session
[2] Constant Recording Mode  - Loop recording continuously
[3] Configure Settings       - Change duration, bitrate, GIF settings
[4] View Current Config      - Display all current settings
[5] Clean Output Files       - Delete recordings and output files
[6] Exit                     - Shutdown the application

Configuration Options

  • Recording Duration: Any length (no cap, default 60s)
  • Recording Bitrate: Quality control (2000-5000 Kbps recommended)
  • GIF FPS: Frame rate (10-60, default 30)
  • GIF Width: Resolution in pixels (default 1200px)
  • Timer Display Speed: Typewriter effect speed (default 15ms)
  • OBS Settings: Host, port, password
  • GitHub Settings: Repository and token

How It Works

  1. Connects to OBS via WebSocket
  2. Starts recording with configured settings
  3. Displays live progress with timer
  4. Auto-stops when duration reached
  5. Converts to high-quality GIF using two-pass ffmpeg
  6. Uploads to GitHub as Release Asset
  7. Updates README.md automatically
  8. Returns to menu for next action

Architecture based in SOLID Principles

  • Single Responsibility: Each class has one job
  • Open/Closed: Extend without modifying
  • Liskov Substitution: Interfaces are substitutable
  • Interface Segregation: No unused dependencies
  • Dependency Inversion: Depend on abstractions

Testing

# Run all tests
npm test

# Watch mode
npm run test:watch

# Coverage report
npm run test:coverage

Test Results: 12 tests passing, 100% coverage


Features in Detail

High-Quality GIF Conversion

Two-pass ffmpeg conversion for optimal quality:

Pass 1: Generate optimal 256-color palette

ffmpeg -i input.mp4 -vf "fps=30,scale=1200:-1:flags=lanczos,palettegen" palette.png

Pass 2: Create GIF with custom palette and Bayer dithering

ffmpeg -i input.mp4 -i palette.png -filter_complex "fps=30,scale=1200:-1:flags=lanczos[x];[x][1:v]paletteuse=dither=bayer:bayer_scale=5" output.gif

Automatic GitHub Integration

  • Uploads to GitHub Release Assets
  • Deletes old GIFs automatically
  • Updates README.md with embedded video/GIF
  • Works with any GitHub repository

Terminal-Style Interface

  • ASCII art banner
  • Typewriter effect for text
  • Live progress bars
  • Clean menu navigation
  • Configurable display speed

Roadmap

  • OBS WebSocket integration
  • Timer-based recording
  • High-quality GIF conversion
  • GitHub Release Asset upload
  • Automatic README updates
  • Terminal-style CLI
  • Constant recording mode
  • Live configuration
  • Smart file cleanup
  • 100% test coverage
  • Multi-platform support (Windows, Linux, macOS)

References

OBS WebSocket: obs-websocket-js

GitHub REST API: Octokit

Credits

Developed by:
Matheus Sobral

About

CLI System for Live Coding gifs in your README.md for Github

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages