> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wearer.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# CLI Commands

> Overview of Transfer Learning CLI commands and their usage

# 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:

```bash theme={null}
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

```bash theme={null}
tl [command] [arguments] [options]
```

The `tl` command works exactly the same as the `transfer-learning` command, but with a shorter name. For example:

```bash theme={null}
# 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)

```bash theme={null}
# 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

<CardGroup cols={2}>
  <Card title="process-video" icon="film" color="#4f46e5" href="/cli/process-video">
    Process a local video file and extract content
  </Card>

  <Card title="generate-guide" icon="book" color="#0ea5e9" href="/cli/generate-guide">
    Generate a step-by-step guide from processed video data
  </Card>

  <Card title="process-youtube" icon="youtube" color="#ef4444" href="/cli/process-youtube">
    Process a YouTube video and extract content
  </Card>

  <Card title="youtube-guide" icon="video" color="#f97316" href="/cli/youtube-guide">
    Generate a guide directly from a YouTube video
  </Card>

  <Card title="transcribe" icon="microphone" color="#10b981" href="/cli/transcribe">
    Extract transcript from video
  </Card>

  <Card title="analyze" icon="magnifying-glass" color="#f59e0b" href="/cli/analyze">
    Analyze video content
  </Card>

  <Card title="download" icon="download" color="#8b5cf6" href="/cli/download">
    Download video from supported platforms
  </Card>

  <Card title="config" icon="gear" color="#64748b" href="/cli/utilities#config">
    Configure environment variables and settings
  </Card>
</CardGroup>

<Note>
  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
</Note>

## Command Details

### process-video

Process a local video file and extract content.

```bash theme={null}
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

```bash theme={null}
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.

```bash theme={null}
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

```bash theme={null}
transfer-learning generate-guide data/processed/tutorial --output-dir guides --model gpt-4o
```

### process-youtube

Process a YouTube video and extract content.

```bash theme={null}
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

```bash theme={null}
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.

```bash theme={null}
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

```bash theme={null}
transfer-learning youtube-guide "https://youtube.com/watch?v=VIDEO_ID" --output-dir guides
```

### transcribe

Extract transcript from video.

```bash theme={null}
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

```bash theme={null}
transfer-learning transcribe tutorial.mp4 --output-dir transcripts --model base
```

### analyze

Analyze video content.

```bash theme={null}
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

```bash theme={null}
transfer-learning analyze tutorial.mp4 --output-dir analysis
```

### download

Download video from supported platforms.

```bash theme={null}
transfer-learning download URL [OPTIONS]
```

#### Arguments

* `URL`: URL to download video from

#### Options

* `--output-dir TEXT`: Output directory for downloaded videos

#### Example

```bash theme={null}
transfer-learning download "https://youtube.com/watch?v=VIDEO_ID" --output-dir videos
```

### config

Configure environment variables and settings.

```bash theme={null}
transfer-learning config [OPTIONS]
```

#### Options

* `--show`: Show current configuration
* `--reset`: Reset configuration to defaults

#### Example

```bash theme={null}
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
