CLI Guide

The LIFF CLI provides command-line access to SVG generation, batch processing, and project workflows.

Installation

npm install -g @liffai/cli

Authentication

Set your API key via environment variable or login interactively:

# Via environment variable export LIFF_API_KEY=sk-liff-... # Or login interactively liff auth login

Commands

liff generate

Generate a single SVG from a text prompt.

liff generate <prompt> [options] # Options: --model <model> Model to use (v3-pro, v3-flash) --color <hex> Enforce hex color (repeatable) --size <WxH> Output dimensions --output <path> Output file path --max-anchors <n> Maximum anchor point budget --no-alpha Disable alpha edge cleanup --json Output raw JSON response

liff batch

Generate multiple SVGs from a manifest file.

liff batch <manifest.json> [options] # Options: --concurrency <n> Parallel requests (default: 3) --output-dir <dir> Output directory --on-error <strategy> skip | retry | abort

Manifest Format

[{ "prompt": "Home icon", "model": "liff-v3-flash", "output": "icons/home.svg" }, { "prompt": "Settings gear icon", "model": "liff-v3-flash", "output": "icons/settings.svg" }]

liff redraw

Non-destructive partial redraw of an existing SVG.

liff redraw <input.svg> --region <x,y,w,h> --prompt <description> # Example: Redraw the top-right area of a logo liff redraw logo.svg --region 128,0,128,128 --prompt "Replace with a star shape" --model v3-pro --output logo-v2.svg

liff auth

liff auth login # Interactive login liff auth logout # Clear credentials liff auth status # Check current auth + quota