CLI

Command-line interface for Google Labs AI media generation

CLI

The glabs CLI provides terminal-based access to all SDK features — image generation, video generation, project management, Whisk, and an OpenAI-compatible server.

Installation

npm install -g @getvrex/glabs-cli

Verify installation:

glabs --version

Configuration

The CLI reads from ~/.glabs/config.json with environment variable overrides.

Quick Setup

# Extract tokens automatically
glabs auth extract --email [email protected] --password "pass" --save
 
# Or set tokens manually
glabs config set --bearer-token "tok" --session-token "stok" --account-tier pro

Set Config Values

glabs config set --bearer-token "your-bearer-token"
glabs config set --session-token "your-session-token"
glabs config set --account-tier pro
glabs config set --recaptcha-provider chrome
glabs config set --recaptcha-api-key "your-api-key"
glabs config set --output-dir ./output

Multiple values in one command:

glabs config set \
  --bearer-token "your-token" \
  --session-token "your-session-token" \
  --account-tier pro \
  --recaptcha-provider chrome

View Config

glabs config show

Displays all values with sensitive tokens masked.

Environment Variable Overrides

Environment variables take precedence over the config file:

VariableConfig Key
GLABS_BEARER_TOKENbearerToken
GLABS_SESSION_TOKENsessionToken
GLABS_ACCOUNT_TIERaccountTier
GLABS_PROJECT_IDprojectId
GLABS_RECAPTCHA_PROVIDERrecaptchaProvider
GLABS_RECAPTCHA_API_KEYrecaptchaApiKey
GLABS_WHISK_COOKIEwhiskCookie
GLABS_OUTPUT_DIRoutputDir
GLABS_GOOGLE_EMAILgoogleEmail
GLABS_GOOGLE_PASSWORDgooglePassword
GLABS_BROWSERLESS_TOKENbrowserlessToken

Commands

Auth

auth extract

Extract bearer + session tokens via browser automation:

glabs auth extract --email [email protected] --password "pass" --save
glabs auth extract --email [email protected] --password "pass" --browserless-token "tok"
OptionDescription
--email <email>Google email (or GLABS_GOOGLE_EMAIL)
--password <password>Google password (or GLABS_GOOGLE_PASSWORD)
--browserless-token <tok>Browserless.io token (omit for local browser)
--saveSave tokens to ~/.glabs/config.json

Images

images generate

glabs images generate -p "A sunset over mountains" -a 16:9
glabs images generate -p "A cute robot" -n 4 -a 1:1 -o ./my-images
glabs images generate -p "A landscape" -m nanobanana2 --seed 42
OptionDescription
-p, --promptImage prompt (required)
-a, --aspect-ratio16:9 | 9:16 | 1:1 (default: 1:1)
-n, --countNumber of images 1-4 (default: 1)
-m, --modelnanobanana | nanobananapro | nanobanana2
--seedRandom seed
--reference-media-idReference media ID (repeatable)
-o, --output-dirOutput directory (default: ./output)
--jsonOutput raw JSON

images upload

glabs images upload -f photo.jpg
OptionDescription
-f, --fileImage file path (required)
--jsonOutput raw JSON

images upsample

glabs images upsample --media-id "abc123" --resolution 4K
OptionDescription
--media-idMedia ID to upsample (required)
--resolution2K | 4K (default: 4K)
-o, --output-dirOutput directory
--jsonOutput raw JSON

images credits

glabs images credits

Videos

videos generate (text-to-video)

glabs videos generate -p "A cinematic drone shot" -a 16:9
glabs videos generate -p "A cityscape" --mode fast
OptionDescription
-p, --promptVideo prompt (required)
-a, --aspect-ratio16:9 | 9:16 | 1:1 (default: 16:9)
--modequality | fast
--account-tierOverride tier
--seedRandom seed
--jsonOutput raw JSON

videos i2v (image-to-video)

glabs videos i2v -p "Camera pans slowly" --start-media-id "abc123"
glabs videos i2v -p "Motion" --start-media-id "abc" --end-media-id "xyz"
OptionDescription
-p, --promptVideo prompt (required)
--start-media-idStart frame media ID (required)
--end-media-idEnd frame media ID (first+last frame mode)
-a, --aspect-ratio16:9 | 9:16 | 1:1
--seedRandom seed

videos r2v (reference-images-to-video)

glabs videos r2v -p "A scene with these characters" --ref-media-id abc --ref-media-id def
OptionDescription
-p, --promptVideo prompt (required)
--ref-media-idReference image media ID (required, repeatable, 1-3)
-a, --aspect-ratio16:9 | 9:16 | 1:1
--modequality | fast
--seedRandom seed

videos extend

glabs videos extend --media-id "abc123" -p "Continue the scene with a sunset"
OptionDescription
--media-idVideo media ID (required)
-p, --promptExtension prompt (required)
-a, --aspect-ratio16:9 | 9:16 | 1:1

videos reshoot

glabs videos reshoot --media-id "abc123" --motion-type RESHOOT_MOTION_TYPE_FORWARD
OptionDescription
--media-idVideo media ID (required)
--motion-typeCamera motion type (required)
-a, --aspect-ratio16:9 | 9:16 | 1:1

Motion types (all prefixed RESHOOT_MOTION_TYPE_):

  • Camera: UP, DOWN, LEFT_TO_RIGHT, RIGHT_TO_LEFT, FORWARD, BACKWARD, DOLLY_IN_ZOOM_OUT, DOLLY_OUT_ZOOM_IN_LARGE
  • Stationary: STATIONARY_UP, STATIONARY_DOWN, STATIONARY_LEFT_LARGE, STATIONARY_RIGHT_LARGE, STATIONARY_DOLLY_IN_ZOOM_OUT, STATIONARY_DOLLY_OUT_ZOOM_IN_LARGE

videos upsample

glabs videos upsample --media-id "abc123" --resolution 4k
OptionDescription
--media-idVideo media ID (required)
--resolution1080p | 4k (default: 4k)

videos status

glabs videos status --operation-name "operations/xyz"
glabs videos status --media-id "abc123"

videos poll

Polls until completion and auto-downloads the video:

glabs videos poll --operation-name "operations/xyz" -o ./videos
glabs videos poll --media-id "abc123"
OptionDescription
--operation-nameOperation name
--media-idMedia ID
--project-idProject ID
-o, --output-dirOutput directory (default: ./output)

Projects

glabs projects list
glabs projects list --page-size 50 --json
glabs projects get <project-id>

Whisk

Generate images via Google Whisk API (Imagen 3.5):

glabs whisk generate -p "A cute robot" -a LANDSCAPE -o ./whisk-output
OptionDescription
-p, --promptImage prompt (required)
-a, --aspect-ratioSQUARE | PORTRAIT | LANDSCAPE (also accepts 1:1, 9:16, 16:9)
--seedRandom seed
-o, --output-dirOutput directory
--jsonOutput raw JSON

Requires whiskCookie set in config: glabs config set --whisk-cookie "cookie"

Serve (OpenAI Server)

Start an OpenAI-compatible HTTP server:

glabs serve
glabs serve --port 3000 --host 127.0.0.1 --api-key "sk-my-key" --max-concurrent 8
OptionDescription
--portListen port (default: 8000)
--hostBind host (default: 0.0.0.0)
--api-keyOptional API key for auth
--max-concurrentMax concurrent tasks (default: 4)

Endpoints: POST /v1/chat/completions, GET /v1/models

Typical Workflow

# 1. Setup
glabs auth extract --email [email protected] --password "pass" --save
 
# 2. Generate an image
glabs images generate -p "A mountain landscape" -a 16:9
 
# 3. Upload for video use
glabs images upload -f output/image-1709123456.png
 
# 4. Generate video from image
glabs videos i2v -p "Camera slowly pans right" --start-media-id "abc123"
 
# 5. Poll and download
glabs videos poll --operation-name "operations/xyz" -o ./videos
 
# 6. Upscale to 4K
glabs videos upsample --media-id "def456" --resolution 4k

Output Files

Default output dir: ./output (or --output-dir / config outputDir).

TypeFilename Pattern
Imagesimage-{timestamp}.png
Videosvideo-{timestamp}.mp4
Whiskwhisk-{timestamp}.png
Upsampledupsample-{timestamp}.png

Use --json on any command to output raw JSON to stdout instead.