Skip to main content
The varg CLI provides commands for authentication, rendering, and quick generation.

Installation

The CLI is included with the vargai package:
bun install vargai ai
Or use directly with bunx:
bunx vargai <command>

Authentication Commands

Login

Sign in to varg.ai and save your API key:
bunx vargai login
Two modes:
  • Email — enter email, receive a 6-digit code, verify. Creates account + API key automatically.
  • API key — paste an existing key from the dashboard.
Credentials are saved to ~/.varg/credentials.

Logout

Clear saved credentials:
bunx vargai logout

Check Balance

View your credit balance:
bunx vargai balance

Top Up

Open the billing page to add credits:
bunx vargai topup

Project Commands

Initialize Project

Set up a new varg project:
bunx vargai init
This runs login (if needed), installs the varg-ai Agent Skill, creates hello.tsx, output directories, and .gitignore.

Create Hello World

Generate the hello world starter:
bunx vargai hello
Creates hello.tsx with a minimal working example.

Render Video

Render a TSX file to video:
bunx vargai render <file.tsx>
Options:
FlagDescriptionDefault
--output, -oOutput file pathoutput/video.mp4
--previewFree preview with placeholders-
--verbose, -vShow detailed progress-
--no-cacheSkip cache (regenerate everything)-
--cacheCache directory.cache/ai
Examples:
bunx vargai render video.tsx --preview      # Free preview
bunx vargai render video.tsx --verbose      # Full render
bunx vargai render video.tsx -o output/my-video.mp4 -v
bunx vargai render video.tsx --no-cache     # Force regeneration

# Background rendering
nohup bunx vargai render video.tsx --verbose > output/render.log 2>&1 &

Generation Commands

Run individual generation actions:
bunx vargai run <action> [options]

Generate Image

bunx vargai run image --prompt "sunset over mountains"
bunx vargai run image --prompt "cute cat" --model nano-banana-pro --aspect-ratio 16:9
FlagDescriptionDefault
--prompt, -pImage descriptionrequired
--model, -mModel namenano-banana-pro
--aspect-ratio, -aOutput ratio1:1
--output, -oOutput path-

Generate Video

bunx vargai run video --prompt "ocean waves" --duration 5
bunx vargai run video --prompt "cat waving" --image media/cat.jpg --duration 5
FlagDescriptionDefault
--prompt, -pVideo descriptionrequired
--image, -iInput image (image-to-video)-
--duration, -dDuration in seconds5
--model, -mModel namekling-v3
--output, -oOutput path-

Generate Voice

bunx vargai run voice --text "Hello world" --voice rachel
FlagDescriptionDefault
--text, -tText to speakrequired
--voice, -vVoice namerachel
--model, -mTTS model-
--output, -oOutput path-

Generate Music

bunx vargai run music --prompt "upbeat electronic" --duration 30

Transcribe Audio

bunx vargai run transcribe audio.mp3

List Actions

bunx vargai list

Environment

The CLI reads VARG_API_KEY from:
  1. Environment variable: export VARG_API_KEY=varg_xxx
  2. .env file: VARG_API_KEY=varg_xxx
  3. Global credentials: ~/.varg/credentials

Output Formats

Default

[image] Generating with nano-banana-pro...
[image] Generated: output/image.png

Quiet (--quiet)

output/image.png

JSON (--json)

{
  "url": "output/image.png",
  "model": "nano-banana-pro",
  "prompt": "sunset over mountains",
  "duration_ms": 2340
}