Skip to main content

CLI Commands

Transfer Learning provides a powerful command-line interface for processing videos and generating step-by-step guides. This page provides an overview of all available commands and their options.

Command Structure

All Transfer Learning commands follow this general structure:
transfer-learning [command] [arguments] [options]

Command Alias

Transfer Learning provides a convenient command alias tl that can be used instead of typing out the full transfer-learning command. The tl command is available through shell scripts in the scripts directory:
  • For Unix-like systems (macOS/Linux): scripts/tl
  • For Windows: scripts/tl.bat

Usage

tl [command] [arguments] [options]
The tl command works exactly the same as the transfer-learning command, but with a shorter name. For example:
# Using the full command
transfer-learning process-video video.mp4

# Using the alias
tl process-video video.mp4

Global Installation

To make the tl command available globally:

Unix-like Systems (macOS/Linux)

# Create a symbolic link in /usr/local/bin
sudo ln -s "$(pwd)/scripts/tl" /usr/local/bin/tl

Windows

Add the scripts directory to your PATH environment variable or create a symbolic link in a directory that’s already in your PATH.

Available Commands

process-video

Process a local video file and extract content

generate-guide

Generate a step-by-step guide from processed video data

process-youtube

Process a YouTube video and extract content

youtube-guide

Generate a guide directly from a YouTube video

transcribe

Extract transcript from video

analyze

Analyze video content

download

Download video from supported platforms

config

Configure environment variables and settings
The Transfer Learning CLI provides seven core actions for video processing and guide generation:
  • Process-video: Process local video files
  • Generate Guide: Create guides from processed local videos
  • Process Youtube: Process videos from YouTube
  • Youtube-guide: Generate guides directly from YouTube videos
  • Transcribe: Extract transcripts from videos
  • Analyze: Analyze video content
  • Download: Download videos from supported platforms

Command Details

process-video

Process a local video file and extract content.
transfer-learning process-video PATH [OPTIONS]

Arguments

  • PATH: Path to video file or directory

Options

  • --output-dir TEXT: Output directory for results
  • --batch-size INTEGER: Number of frames to process in each batch
  • --max-concurrent INTEGER: Maximum number of concurrent batches

Example

transfer-learning process-video tutorial.mp4 --output-dir data/processed --batch-size 30

generate-guide

Generate a step-by-step guide from processed video data.
transfer-learning generate-guide PATH [OPTIONS]

Arguments

  • PATH: Path to processed video data

Options

  • --output-dir TEXT: Output directory for guides
  • --model TEXT: Model to use for guide generation
  • --temperature FLOAT: Temperature for generation
  • --user-directive TEXT: User directive to customize guide generation
  • --skip-cache: Skip cache and force regeneration

Example

transfer-learning generate-guide data/processed/tutorial --output-dir guides --model gpt-4o

process-youtube

Process a YouTube video and extract content.
transfer-learning process-youtube URL [OPTIONS]

Arguments

  • URL: YouTube video URL

Options

  • --output-dir TEXT: Output directory for results
  • --batch-size INTEGER: Number of frames to process in each batch
  • --max-concurrent INTEGER: Maximum number of concurrent batches

Example

transfer-learning process-youtube "https://youtube.com/watch?v=VIDEO_ID" --output-dir data/youtube

youtube-guide

Generate a guide directly from a YouTube video.
transfer-learning youtube-guide URL [OPTIONS]

Arguments

  • URL: YouTube video URL

Options

  • --output-dir TEXT: Output directory for guides
  • --model TEXT: Model to use for guide generation
  • --temperature FLOAT: Temperature for generation
  • --batch-size INTEGER: Number of frames to process in each batch
  • --max-concurrent INTEGER: Maximum number of concurrent batches
  • --user-directive TEXT: User directive to customize guide generation
  • --skip-cache: Skip cache and force regeneration

Example

transfer-learning youtube-guide "https://youtube.com/watch?v=VIDEO_ID" --output-dir guides

transcribe

Extract transcript from video.
transfer-learning transcribe PATH [OPTIONS]

Arguments

  • PATH: Path to video file or YouTube URL

Options

  • --output-dir TEXT: Output directory for transcripts
  • --model TEXT: Whisper model to use
  • --device TEXT: Device to use for transcription

Example

transfer-learning transcribe tutorial.mp4 --output-dir transcripts --model base

analyze

Analyze video content.
transfer-learning analyze PATH [OPTIONS]

Arguments

  • PATH: Path to video file or YouTube URL

Options

  • --output-dir TEXT: Output directory for analysis results
  • --batch-size INTEGER: Number of frames to process in each batch
  • --max-concurrent INTEGER: Maximum number of concurrent batches
  • --model TEXT: Whisper model to use for transcription
  • --device TEXT: Device to use for transcription

Example

transfer-learning analyze tutorial.mp4 --output-dir analysis

download

Download video from supported platforms.
transfer-learning download URL [OPTIONS]

Arguments

  • URL: URL to download video from

Options

  • --output-dir TEXT: Output directory for downloaded videos

Example

transfer-learning download "https://youtube.com/watch?v=VIDEO_ID" --output-dir videos

config

Configure environment variables and settings.
transfer-learning config [OPTIONS]

Options

  • --show: Show current configuration
  • --reset: Reset configuration to defaults

Example

transfer-learning config --show

Global Options

These options are available for all commands:
  • --help: Show help message and exit
  • --version: Show version and exit

Environment Variables

Transfer Learning uses the following environment variables:
  • OPENAI_API_KEY: OpenAI API key for vision and guide generation
  • FRAME_EXTRACTION_INTERVAL: Interval between frame extractions
  • MAX_FRAMES_PER_VIDEO: Maximum number of frames to extract per video
  • BATCH_SIZE: Number of frames to process in each batch
  • MAX_CONCURRENT_BATCHES: Maximum number of concurrent batches
  • WHISPER_MODEL: Whisper model to use for transcription
  • WHISPER_DEVICE: Device to use for transcription (cpu/cuda)
  • ENABLE_MONITORING: Enable or disable monitoring (true/false)
  • LOG_LEVEL: Logging level (INFO, DEBUG, WARNING, ERROR)
These can be set in a .env file in the project root directory.

CLI Overview

The Transfer Learning CLI provides a comprehensive set of tools for processing videos and generating step-by-step guides. It features intelligent video handling, automatic compression, and AI-powered analysis.

Key Features

  • Smart Video Processing
    • Automatic size management and compression
    • Frame extraction at configurable intervals
    • Support for multiple video formats
    • Progress tracking and monitoring
  • File Management
    • Automatic compression for large files
    • Quality-preserving size reduction
    • Temporary file handling
    • Configurable size limits