Skip to content

Latest commit

Β 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 

Repository files navigation

varg cli

AI video infrastructure from your terminal.

Status

🟑 Pre-release β€” Active development, looking for contributors.


Philosophy

simple things should be simple.
complex things should be possible.
everything should be inspectable.

Usage

varg <command> [target] [options]

Commands

varg run

Run a model or action.

# Smart resolve β€” figures out if it's a model or action
varg run kling --prompt "a cat dancing"
varg run image-to-video --image ./cat.png

# Explicit namespacing (when you need it)
varg run model/kling --prompt "..."
varg run action/image-to-video --image ./cat.png

# Positional args for common patterns
varg run transcribe ./video.mp4
varg run transcribe ./video.mp4 ./output.srt

# Full options
varg run kling \
  --prompt "a cat dancing on the moon" \
  --duration 10 \
  --aspect 16:9 \
  --output ./cat-dance.mp4

varg ai

Natural language interface. Let varg figure it out.

varg ai "animate this cat picture"
varg ai "make a video of a dog surfing, 10 seconds"
varg ai "transcribe my-meeting.mp4 and summarize it"
varg ai "generate 5 variations of this product shot"

Under the hood: parses intent β†’ selects model/action β†’ runs it.

varg list

Discover what's available.

varg list              # everything
varg list models       # only models
varg list actions      # only actions
varg list skills       # only skills

Output:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  varg                                                               β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

  MODELS

  kling             text/image β†’ video         fal Β· replicate
  flux              text β†’ image               fal
  wan               text/image β†’ video         replicate
  minimax           text β†’ video               fal
  runway            image β†’ video              runway
  elevenlabs        text β†’ voice               elevenlabs
  whisper           audio β†’ text               replicate Β· fal

  ACTIONS

  image-to-video    animate a still image      kling, wan, runway
  text-to-image     generate an image          flux, sdxl, ideogram
  text-to-video     generate video from text   kling, minimax
  transcribe        speech β†’ text              whisper
  voice             text β†’ speech              elevenlabs
  caption           auto-caption video         whisper + ffmpeg
  upscale           enhance resolution         topaz, real-esrgan

  SKILLS

  product-spin      image β†’ rotating video     flux β†’ kling β†’ ffmpeg
  talking-head      script β†’ avatar video      elevenlabs β†’ hedra
  batch-ads         csv β†’ ad variations        flux β†’ kling (Γ—N)

  ─────────────────────────────────────────────────────────────────────
  12 models Β· 7 actions Β· 3 skills Β· run `varg <cmd> --help` for details

varg find

Fuzzy search when you don't know exact names.

varg find "animate"
varg find "video from image"
varg find "speech"

Output:

β”Œβ”€ search: "animate" ─────────────────────────────────────────────────┐

  BEST MATCHES

  action/image-to-video     animate a still image
  model/kling               text/image β†’ video (supports animation)
  model/wan                 text/image β†’ video
  model/runway              image β†’ video (motion brush)

  ─────────────────────────────────────────────────────────────────────
  run `varg run <name> --help` for usage

varg which

Inspect what's behind an action.

varg which image-to-video

Output:

β”Œβ”€ action: image-to-video ────────────────────────────────────────────┐

  Animate a still image with AI.

  ROUTES TO

  kling         default Β· best quality Β· 5-10s
  wan           fast Β· stylized Β· 5s  
  runway        motion brush Β· premium

  SELECTION LOGIC

  - default β†’ kling (quality)
  - --fast β†’ wan
  - --provider runway β†’ runway
  - duration > 5s β†’ kling only

  ─────────────────────────────────────────────────────────────────────
  run `varg run image-to-video --help` for full options

Inspection

Every runnable has --help and --schema.

--help

Human-readable documentation.

varg run kling --help
β”Œβ”€ model: kling ──────────────────────────────────────────────────────┐

  Kling 2.5 β€” video generation by Kuaishou.
  
  USAGE
  
    varg run kling --prompt <text> [options]
    varg run kling --image <path> --prompt <text> [options]

  OPTIONS

    --prompt        what to generate                       required
    --image         input image (enables image-to-video)   optional
    --duration      5 | 10 seconds                         default: 5
    --aspect        16:9 | 9:16 | 1:1                      default: 16:9
    --provider      fal | replicate                        default: fal
    --output        output file path                       default: ./output.mp4

  EXAMPLES

    # Text to video
    varg run kling --prompt "a cat riding a skateboard in tokyo"

    # Image to video  
    varg run kling --image ./cat.png --prompt "cat starts dancing"

    # Full control
    varg run kling \
      --image ./product.png \
      --prompt "product rotates smoothly" \
      --duration 10 \
      --aspect 1:1 \
      --provider replicate \
      --output ./product-spin.mp4

--schema

Machine-readable JSON schema. For agents and tooling.

varg run kling --schema
{
  "name": "kling",
  "type": "model",
  "description": "Kling 2.5 β€” video generation by Kuaishou",
  "input": {
    "type": "object",
    "required": ["prompt"],
    "properties": {
      "prompt": {
        "type": "string",
        "description": "What to generate"
      },
      "image": {
        "type": "string",
        "format": "file-path",
        "description": "Input image for image-to-video mode"
      },
      "duration": {
        "type": "integer",
        "enum": [5, 10],
        "default": 5
      },
      "aspect": {
        "type": "string",
        "enum": ["16:9", "9:16", "1:1"],
        "default": "16:9"
      },
      "provider": {
        "type": "string",
        "enum": ["fal", "replicate"],
        "default": "fal"
      }
    }
  },
  "output": {
    "type": "string",
    "format": "file-path",
    "description": "Path to generated video"
  }
}

Resolution

varg resolves names in this order:

1. Exact match in models/
2. Exact match in actions/
3. Fuzzy match β†’ suggest

Explicit namespacing always works:

varg run model/kling        # definitely the model
varg run action/transcribe  # definitely the action

Config

Optional varg.config.ts in project root:

export default {
  defaults: {
    provider: 'fal',
    output: './generated',
  },
  models: {
    kling: {
      provider: 'replicate',  // override default provider
      duration: 10,           // override default duration
    }
  },
  aliases: {
    'v': 'image-to-video',
    'tts': 'voice',
  }
}
# With aliases
varg run v --image ./cat.png
varg run tts --text "hello world"

Output

Clean, minimal, informative.

Running:

β”Œβ”€ kling ─────────────────────────────────────────────────────────────┐
β”‚                                                                     β”‚
β”‚  prompt    "a cat dancing on the moon"                              β”‚
β”‚  duration  10s                                                      β”‚
β”‚  provider  fal                                                      β”‚
β”‚                                                                     β”‚
β”‚  ◐ generating...                                                    β”‚
β”‚                                                                     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Complete:

β”Œβ”€ kling ─────────────────────────────────────────────────────────────┐
β”‚                                                                     β”‚
β”‚  βœ“ done in 47s                                                      β”‚
β”‚                                                                     β”‚
β”‚  output  ./cat-moon-dance.mp4                                       β”‚
β”‚  cost    $0.032                                                     β”‚
β”‚                                                                     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Error:

β”Œβ”€ kling ─────────────────────────────────────────────────────────────┐
β”‚                                                                     β”‚
β”‚  βœ— failed                                                           β”‚
β”‚                                                                     β”‚
β”‚  error   content policy violation                                   β”‚
β”‚  prompt  "..." (flagged)                                            β”‚
β”‚                                                                     β”‚
β”‚  try: rephrase prompt or use --provider replicate                   β”‚
β”‚                                                                     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Piping

Unix-friendly. Compose with other tools.

# Output path to stdout for piping
varg run kling --prompt "cat" --quiet | xargs open

# JSON output for scripting
varg run kling --prompt "cat" --json

# Chain operations
varg run flux --prompt "a cat" --output ./cat.png && \
varg run image-to-video --image ./cat.png --output ./cat.mp4

# Batch from file
cat prompts.txt | xargs -I {} varg run kling --prompt "{}"

Environment

# Required for providers
FAL_KEY=...
REPLICATE_API_TOKEN=...
ELEVENLABS_API_KEY=...

# Optional
VARG_DEFAULT_PROVIDER=fal
VARG_OUTPUT_DIR=./generated
VARG_QUIET=false

Installation

# npm
npm install -g varg

# or run directly
npx varg run kling --prompt "..."

# or in project
bun add varg
bun varg run kling --prompt "..."

Skills

Skills are composable workflows β€” chains of models and actions.

varg skills

varg skills              # list all skills
varg skills create       # interactive skill builder
varg skills run <name>   # run a skill
varg skills edit <name>  # edit existing skill

Output:

β”Œβ”€ skills ────────────────────────────────────────────────────────────┐

  product-spin       image β†’ rotating video with shadow
                     flux β†’ kling β†’ ffmpeg

  talking-head       script β†’ avatar video with voice
                     elevenlabs β†’ hedra

  batch-ads          csv β†’ multiple ad variations
                     flux (Γ—N) β†’ kling (Γ—N) β†’ caption

  youtube-short      idea β†’ complete vertical video
                     gpt β†’ flux β†’ kling β†’ caption β†’ music

  ─────────────────────────────────────────────────────────────────────
  4 skills Β· run `varg skills run <name>` to execute

Skill definition

# skills/product-spin.yaml
name: product-spin
description: Create rotating product video with shadow

inputs:
  image:
    type: file
    description: Product image (transparent PNG works best)
  prompt:
    type: string
    default: "product rotates smoothly 360 degrees"

steps:
  - id: enhance
    run: action/upscale
    with:
      image: ${{ inputs.image }}

  - id: generate
    run: model/kling
    with:
      image: ${{ steps.enhance.output }}
      prompt: ${{ inputs.prompt }}
      duration: 5

  - id: loop
    run: ffmpeg
    with:
      input: ${{ steps.generate.output }}
      filter: "loop=loop=3"

output: ${{ steps.loop.output }}

Running skills

# Basic
varg skills run product-spin --image ./shoe.png

# Override defaults
varg skills run product-spin \
  --image ./shoe.png \
  --prompt "shoe floats and rotates with dramatic lighting"

# Inspect what it will do
varg skills run product-spin --image ./shoe.png --dry-run

Dry run output:

β”Œβ”€ skill: product-spin (dry-run) ─────────────────────────────────────┐

  STEPS

  1. upscale        action/upscale       ./shoe.png β†’ [upscaled]
  2. generate       model/kling          [upscaled] β†’ [video]
  3. loop           ffmpeg               [video] β†’ [looped]

  ESTIMATED

  time    ~60s
  cost    ~$0.05

  ─────────────────────────────────────────────────────────────────────
  run without --dry-run to execute

Creating skills

varg skills create

Interactive wizard:

β”Œβ”€ new skill ─────────────────────────────────────────────────────────┐

  name: my-workflow
  description: What does this skill do?
  > Creates product videos from images

  ─────────────────────────────────────────────────────────────────────

  Add steps (type 'done' to finish):

  step 1: model/flux
  step 2: model/kling  
  step 3: action/caption
  step 4: done

  ─────────────────────────────────────────────────────────────────────

  βœ“ Created skills/my-workflow.yaml
  
  Edit inputs and step config:
    code skills/my-workflow.yaml

Or create from natural language:

varg ai "create a skill that takes a product image, generates 5 angle variations, then creates videos for each"

For AI Agents

// Get all available tools as JSON schemas
const tools = await $`varg list --json`

// Use in agent
const result = await agent.run({
  tools: JSON.parse(tools),
  prompt: "create a video of a dancing cat"
})
# Schema for any tool
varg run kling --schema > tools/kling.json

# All schemas at once
varg schemas > all-tools.json

varg v0.1 Β· made with β™₯ by varg.ai

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors