/gflow:gflow-clifrom gflow-cli
Drives Google Flow (Veo video, Imagen image generation) and creates local TTS narration from the terminal via the `gflow` CLI. Useful for batch pipelines, scene composition, and chained video generation.
Ships in gflow-cli. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
gflow-cli is a Python CLI that drives Google Flow — Veo (T2V/I2V) and Imagen / Nano Banana — from the terminal by automating the real Flow web UI in a headed Chrome session (Playwright), not by bypassing it. Source: https://github.com/ffroliva/gflow-cli. Canonical command reference: docs/USAGE.md.
The user wants to:
gflow character)gflow scene)gflow video chain)gflow audio narrate)Do NOT use this skill when:
Before any gflow-cli invocation, verify:
python --version).uv --version). If not, install: curl -LsSf https://astral.sh/uv/install.sh | sh (or Windows equivalent from https://docs.astral.sh/uv/).uvx --from gflow-cli gflow --help (no install)uv tool install gflow-cli && gflow --helpuvx --from gflow-cli playwright install chromium (~150 MB), for Flow commands. gflow audio narrate does not need Chromium.gflow auth status should print Flow session verified and exit 0 (it probes the live session, with no credits, and may open a short-lived headless browser; exit 1 means dead or missing session). If not, run gflow auth login and walk the user through the one-time browser sign-in. gflow audio narrate does not need a Flow profile or account.gflow image upload returns 403, missing Flow access is the cause.# Auth (one-time)
gflow auth login # opens Chromium, user signs in
gflow auth status # confirms session
gflow auth renew [--profile NAME | --all] [--json] # headless cookie refresh, no re-login
gflow auth # bare: list profiles or trigger first login
gflow auth logout # delete a saved session
# Veo video-credit balance (read-only; image models use separate daily quotas).
# Reads the balance Flow itself shows: directly (no browser) when the saved session is accepted,
# otherwise in the profile's browser. GFLOW_CLI_WIRE_READS=0 always uses the browser; the
# direct read is also off by default on macOS and skipped while any proxy is configured.
# Exit 4/6 = Flow is throttling the account (429/503): wait, do not retry in a loop.
# (Under the opt-in GFLOW_CLI_EXIT_CODES=2 these are 40/42; see docs/ERRORS.md.)
# Exit 3 = sign-in page (fix: --refresh); 31 = /about or no balance reply (NOT an auth
# problem, do not loop on login); 11 = profile in use; 7 = unrecognised reply. Tier fields are null.
gflow credits user [--profile NAME] [--refresh] [--json]
gflow credits list [--refresh] [--json] # all saved profiles; --refresh renews signed-out sessions
# What this gflow can drive (no call to Flow; yes/no/partial/unknown per key, notes on partial).
# cancel.server and idempotent_submit are "no": a submitted generation runs and may still be charged.
# MCP twin: resource capabilities://self (same document; generation is "no" on a no-spend server). Keys: docs/CAPABILITIES.md
gflow capabilities [--json]
# Image generation (Imagen / Nano Banana)
gflow image upload <path> # → asset UUID + dimensions
gflow image t2i "<prompt>" [--model {nano2|nano2-lite|nano-pro|image4}] \
[--aspect {9:16|16:9|1:1|4:3|3:4}] \
[-n 1..4] [--out DIR]
gflow image i2i "<prompt>" --ref PATH_OR_UUID [--ref ...] [...same as t2i]
gflow image generate "<prompt>" [--ref ...] [...] # bridge: no --ref -> t2i, --ref -> i2i (#1193); --json adds "mode"
gflow image upscale <mediaId> --scale {2k|4k} [--project ID] [--out DIR] # 4K is Ultra-only
gflow image batch <manifest.tsv|manifest.json> [-n 1..4] [--aspect ...] [--out DIR] # shared project, up to 5 prompts; refuses any row ref (exit 11, like any manifest error)
gflow run --config <batch.json> [--project ID] # JSON image batch; a row's "ref" may be "batch:N" (an earlier
# row's image, in place, no upload) or a local file (uploaded once);
# --project (or "project" in the config) reuses an existing project
gflow run --config <batch.json> --project ID --resume # skip rows already on disk + in the catalog (#934)
# For accounts Flow serves flow.google.com (#639), t2i, i2i, and upscale are ported (a project is
# created when --project is omitted, #864): i2i accepts local --ref files only, all
# five aspects. Images take a character by name (@Name, or --reference-entity with
# --reference-entity-name; #723). UUID references, an entity id without a name,
# Imagen 4 (image4), image batch, and characters on t2v/i2v are refused there (exit 36);
# local-file video r2v takes --reference-entity with --reference-entity-name (#723).
# `gflow video extend` runs there one segment per call (accepts a Flow media UUID with
# --project or a local video file with auto-created project, optional --duration 3..10,
# up to 3 --ref images, and --max-credits pre-submit quote enforcement); -n > 1,
# --scene/--resume-from, --seed and an --aspect other than the source clip's exit 36.
# An agent-only composer (#799) is different: t2i and t2v only;
# i2i, i2v, r2v and character references exit 36 there, after up to
# three free page reloads in case Flow serves the classic composer (#1142).
# A run without --project creates a new Flow project, unless GFLOW_CLI_PROJECT=<id> is set
# (#1039): t2i/i2i/t2v/i2v/r2v, `gflow run` and the MCP generate tools then use that
# project. Set it once when looping, instead of leaving one project per call.
# Video generation (Veo 3.1)
gflow video t2v "<prompt>" [--project ID] [--model ...] [--duration 3..15] [--resolution 360p|720p] [--out-dir DIR] [--aspect ...] # --resolution: Omni models only; without --project a project is created first, on either host (#864); durations: 4/6/8 Veo, 4/6/8/10 omni-flash, 3-15 omni-1.2-flash
# Flow retires omni-flash, veo-fast and veo-quality on 2026-12-05 (`retires_on` in `gflow models --json`): use veo-lite or omni-1.2
gflow video i2v --initial-frame <image|media-UUID> "<prompt>" [--end-frame <image>] [--out-dir DIR] [...same as t2v] # UUID = in-project asset, no re-upload (#287; pair with --project); --end-frame caps omni-1.2-flash at 10s
gflow video generate "<prompt>" [--initial-frame F | --ref IMG] [...] # bridge: none -> t2v, frame -> i2v, --ref -> r2v; frame AND --ref = exit 2 (#1193)
gflow video edit <file|media-UUID> "<prompt>" [--ref IMG ...] [--model omni-1.2|omni-flash] [--aspect 9:16|16:9] [--resolution 360p|720p] [--max-credits N] [--project ID] [--json] # flow.google.com V2V edit (jIps6), 0-5 --ref (local file only) images, single clip; MCP: gflow_edit_video
gflow video upscale <mediaId> --scale {4k|1080p|720p|270p} [--project ID] [--out DIR] # 4k = Ultra 2160p (spends credits), 1080p = Full HD, 720p = original, 270p = GIF; Flow lists 1080p for some models only (exit 22 otherwise)
gflow video assemble <clip|catalog-id>... --out-file <path.mp4> [--music FILE] [--voiceover FILE] [--clip-volume 0..1] [--music-volume 0..1] [--voiceover-volume 0..1] [--duck|--no-duck] # local, credit-free, needs gflow-cli[chain]; normalizes to first clip's size and frame rate
gflow video transcribe <file|media-UUID> [--out-file FILE.srt] [--language CODE] [--json] # configured Whisper-compatible endpoint; no Flow credits
gflow video captions <file|media-UUID> [--srt FILE.srt] [--out-file FILE.mp4] [--position bottom|top|middle] [--margin PX] [--font-size PX] [--box-opacity 0..1] [--json] # local PyAV/Pillow burn-in (gflow-cli[chain]); auto-transcribes when --srt omitted; no Flow credits
gflow media trash <media-UUID|asset-id> [--project ID] --yes [--json] # moves a generated item to Flow's Trash; 0 credits; MCP: gflow_media_trash(confirm=true)
gflow media restore <media-UUID|asset-id> [--project ID] [--json] # brings it back; 0 credits; MCP: gflow_media_restore
# `gflow video` has no `batch` subcommand — that stub never worked and was
# removed. For multi-clip runs, loop `gflow video t2v`/`i2v` from the shell.
gflow video chain <manifest.jsonl> [--out-dir DIR] [--dry-run] \
[--max-links N] [--resume-from N] # last-frame I2V chaining; veo models only
# --out-file out/clip.mp4 writes link i to out/clip_<i>.mp4 (#1293)
# Audio narration (no Flow account/browser/credits; text is sent to the selected provider)
gflow audio narrate "A clear voice speaks." --out-file voice.mp3 [--voice ID] # Edge: MP3
gflow audio narrate "A clear voice speaks." --out-file voice.wav --provider gemini [--voice ID] # Gemini: WAV
# Edge is keyless but requires `gflow-cli[tts]`; Gemini requires GFLOW_CLI_GEMINI_TTS_API_KEY.
# Edge uses Microsoft's unofficial Read Aloud endpoint; Gemini rejects custom --rate/--pitch.
# Characters (reusable, project-scoped subjects)
gflow character create --project <id> --name "<name>" --face-prompt "<prompt>" \
[--body-prompt "<prompt>"] [--voice <id>] [--personality "<text>"] \
[--model {nano2|nanopro}]
gflow character create --project <id> --name "<name>" --image <face.png> [--body-image <body.png>] [--voice <name>] [--personality "<text>"]
# from your own images, flow.google.com; generates nothing (FREE); MCP: gflow_character_create
# a failure after the portrait upload is not retryable: run `character list` before re-running
gflow character list --project <id>
gflow character show <character-id> --project <id>
gflow character rm --project <id> (--id <character-id> | --name "<name>") [--yes] # delete (FREE)
gflow character voices # list the Gemini voice catalog
# Scenes (Add Clip / compose ordered clips)
gflow scene create --project <id> <clip-id> [<clip-id> ...] \
[--out-file extended.mp4] # --out-file = credit-free server-side concat
gflow scene show <scene-id> --project <id>
# Agent instructions (project brief cards, credits-free setup) — --project is REQUIRED
gflow instructions add TITLE --text TEXT [--ref REF]... --project ID [--disabled]
gflow instructions list --project ID [--json]
gflow instructions enable (TITLE | --id ID) --project ID
gflow instructions disable (TITLE | --id ID) --project ID
gflow instructions rm (TITLE | --id ID) --project ID
gflow instructions apply FILE --project ID # declarative full-sync (TOML/JSON)
gflow instructions toggle-mode (--on | --off) --project ID # toggle master agent switch
# Discover every command, its params and whether it spends credits (stable JSON, #1203)
gflow --help --json # also: gflow <group> [<cmd>] --help --json
# Keeping gflow-cli current (other commands show a banner when a newer release exists)
gflow update [--check] [-v|--verbose] [--json] # upgrades via uv tool / pipx / pip; source installs refused (exit 11); on Windows pip, exit 11 also when another gflow process holds a launcher (nothing changed: close it, retry); a Windows pip install at <=0.99.0 upgrades once by hand: close every gflow process, then `<venv>\Scripts\python.exe -m pip install --upgrade gflow-cli` (with any installed extras, e.g. `"gflow-cli[patchright]"`; docs/USAGE.md#gflow-update); -v streams the installer output
gflow docs [TOPIC] [--search TERM] [--json]
# Usage statistics and weekly telemetry (local counters; upload after interactive notice)
gflow data stats [--weeks N] [--json]
gflow telemetry on
gflow telemetry off [--delete]
gflow telemetry status [--json]
gflow telemetry show
# Abort a queued job (local only; MCP twin: tasks/cancel). No --profile: task ids are global
gflow cancel TASK_ID [--json] # not yet submitted -> cancelled, exit 0, nothing charged;
# already submitted -> abandoned, exit 22: Flow cannot cancel it,
# it may still be charged (cancel.server: no)
Every subcommand accepts --profile <name> (per-subcommand, not global) to drive multiple Google accounts side-by-side.
Credit cap: Add --max-credits N to a billed video command, or set
GFLOW_CLI_MAX_CREDITS=N as its default. Flow's own pre-submit quote is checked; a missing
quote or one above the cap refuses with exit 45. Chain, extend and movie commands share the
same cap across submissions. Use --no-max-credits to ignore the environment default for a
single CLI command. MCP calls cannot clear the environment default per call. Image commands
do not use this option.
gflow image t2i "a hot air balloon over Tokyo at sunrise" --aspect 16:9
gflow image t2i "variations of a minimalist fox logo" -n 4 --aspect 1:1 --out ./logos/
gflow image i2i "make it cinematic, golden hour" --ref hero.png
UUID=$(gflow image upload hero.png | awk '/Asset UUID:/ {print $3}')
gflow image i2i "stylize this asset" --ref "$UUID"
gflow video i2v --initial-frame ./input.png "Slow cinematic push-in, soft golden light at sunset" --out-dir outputs
There is no manifest-driven video batch command — that stub never worked and
was removed. Loop gflow video t2v/i2v from the shell instead:
mkdir -p out
for img in ./inputs/*.png; do
name=$(basename "$img" .png)
gflow video i2v --initial-frame "$img" "Cinematic push-in" --out-dir out
done
New-Item -ItemType Directory -Force -Path out | Out-Null
Get-ChildItem ./inputs/*.png | ForEach-Object {
gflow video i2v --initial-frame $_.FullName "Cinematic push-in" --out-dir out
}
# A Character is a named, project-scoped subject reused across generations.
gflow character create --project "$PROJECT_ID" --name "Joaquim" \
--face-prompt "weathered fisherman, grey beard, kind eyes" \
--body-prompt "tall, broad-shouldered, wearing a navy wool sweater" \
--voice <voice-id> --model nano2
gflow character voices # discover valid --voice ids first
gflow character list --project "$PROJECT_ID"
See docs/CHARACTER.md for the full domain model, wire protocol, and the crash-recoverable persist-before-spend saga.
# Concatenate ordered clips server-side via runVideoFxConcatenation — no local ffmpeg, no credits.
gflow scene create --project "$PROJECT_ID" "$CLIP_A" "$CLIP_B" --out-file extended.mp4
# manifest.jsonl: one JSON object per line. Link 0 = t2v; later links = i2v seeded by the
# previous clip's last frame. Each link is a pending video operation; credit
# use varies by model/duration/tier — check Flow. veo models only.
gflow video chain ./story.jsonl --out-dir ./out/ --dry-run # preview the plan first
gflow video chain ./story.jsonl --out-dir ./out/ # then run for real
# 1. Discover project ID from Flow editor URL (.../project/<id>/...) or create one.
# 2. Set up the brief cards (credits-free setup).
gflow instructions apply brief.toml --project 6b714c4e-...
# 3. Generate using that project context (steers via reasoning path).
gflow image t2i "a bicycle" --project 6b714c4e-...
import asyncio
from pathlib import Path
from gflow_cli.api.client import FlowApiClient
from gflow_cli.paths import profile_dir
async def make_clip(image: Path, prompt: str, out: Path) -> None:
async with FlowApiClient(profile_dir=profile_dir("default")) as client:
project = await client.create_project(title="gflow-cli demo")
asset = await client.upload_image(image, project.project_id)
op = await client.generate_video(
project_id=project.project_id,
prompt=prompt,
start_asset=asset,
aspect="9:16",
)
# Poll op.workflow_id with client.poll_video_status(...) and
# client.download_video(...) when status reaches succeeded.
asyncio.run(make_clip(Path("in.png"), "Push-in", Path("out.mp4")))
The gflow-cli supports a 3-layer pipeline for persistent generation context (Agent Mode brief cards):
gflow instructions add or gflow instructions apply.--project <id>. Enabled brief cards are automatically resolved and folded into the prompt via the agent's reasoning path.movie.toml [[scene.instructions.card]] or [scene.instructions] disable blocks..../project/<id>/...) or create one.-i / --instruction option for anything you want to reuse; it creates a new card every call. Prefer persistent gflow instructions cards.gflow instructions toggle-mode --on) for cards to steer output.| Error | Cause | Fix |
|---|---|---|
No session for profile 'default' | First run, no auth | gflow auth login |
403 Forbidden from upload / generate | Account doesn't have Flow access | Verify in labs.google/fx/tools/flow |
| reCAPTCHA refuses to mint a token (headless detected) | Google bot-detection | Set GFLOW_CLI_HEADLESS=false and re-run; a headed window passes detection. With --json, a mint failure has type …/errors/recaptcha-mint and exits 1; re-run only when retryable is true |
Playwright Executable doesn't exist | Chromium not downloaded | uvx --from gflow-cli playwright install chromium |
| Generations all fail with the same UUID | Stale Flow session | gflow auth login again to refresh cookies |
| Quota exceeded | Burned through monthly credits | Wait for reset, or upgrade subscription |
| Every page step times out, but auth/HTTP calls work | Network reaches Google only through a proxy; the browser ignores HTTPS_PROXY | Set GFLOW_CLI_BROWSER_PROXY=http://host:port (no credentials: a password-protected proxy is refused, exit 11) |
Exit 7 RpcResponseUnavailableError ("outcome unknown") | A create/rename/upload was sent but its result was never seen | Do NOT re-run blindly: check the project on flow.google.com first (a re-run can duplicate), then pass --project <id> |
| No progress lines any more | Default log level is WARNING since v0.88.0 | GFLOW_CLI_LOG_LEVEL=INFO or -v |
| Any error, unsure whether it cost anything | Every error envelope (--json, MCP) carries charged (yes/no/maybe) and next_action | Follow next_action: retry is safe; reconcile means check the project in Flow before re-running (a billed request is never resent); reauth means sign in again. See docs/ERRORS.md |
gflow credits; image generation uses separate per-model daily quotas. Confirm before running batches.%LOCALAPPDATA%\gflow-cli\profile_*; macOS: ~/Library/Application Support/gflow-cli/profile_*; Linux: ~/.local/share/gflow-cli/profile_*) and contains Google session cookies — treat as secrets.--profile names for parallel work.Documented errors agents commonly make — negative examples for the SkillOpt training loop:
| Mistake | Correct behaviour |
|---|---|
gflow video create | gflow video generate (alias gen; mode read from the inputs), or the mode verb itself: gflow video t2v (text→video) / gflow video i2v (image→video) |
Passing file path to -o/--output or --output DIR | -o/--output selects output format (json|table|id); --out-file PATH is an explicit FILE path (single-prompt only); use --out DIR (image) / --out-dir DIR (video) for directory output. |
An absolute MCP out_file / out_dir outside the output dir, or a path as MCP profile | MCP tools write only inside GFLOW_CLI_OUTPUT_DIR (v0.92.0+): pass out_file relative to it; anything else returns 400 Invalid Output / Invalid out_dir. profile is a plain name (400 Invalid Profile). The CLI --out-file is unchanged |
gflow auth bare or gflow login to sign in | gflow auth login — bare gflow auth only lists profiles |
gflow auth refresh (doesn't exist), or gflow auth login as the first move on an expired session | gflow auth renew renews an expired session headlessly with no sign-in; gflow auth login only when renew reports the session could not be renewed (revoked) |
playwright install or playwright install --all | uvx --from gflow-cli playwright install chromium (Chromium only, ~150 MB) |
Running two generations on the same --profile in parallel | Use different --profile names — Chromium refuses two persistent contexts on the same dir |
GFLOW_CLI_HEADLESS=true to fix reCAPTCHA failures | GFLOW_CLI_HEADLESS=false — headless mode causes bot-detection, not prevents it |
Calling gflow image upload again for an already-uploaded UUID | Pass the UUID directly to --ref UUID (i2i) or --initial-frame/--end-frame UUID (i2v, with --project) — no re-upload needed |
--model imagen / --model quality / --model high | --model image4 (Imagen 4, no longer in Flow's menu), --model nano-pro (Nano Banana Pro), --model nano2 (Nano Banana 2.1; nano2.1 also works). gflow models lists each model's Flow name; gflow models show <alias> prints one model's limits |
Python: client = FlowApiClient(...) then method calls | Must use async with FlowApiClient(...) as client: — it's an async context manager |
Python: from gflow_cli import FlowApiClient | from gflow_cli.api.client import FlowApiClient |
gflow video t2v/i2v/r2v with an unported UUID/entity reference or model on an account served flow.google.com (exit 36) | Pass local files instead — migrated hosts support video t2v, local-file i2v/r2v, single-segment video extend, and image t2i/i2i (local refs, a same---project catalogued UUID ref (#995), plus @Character mentions on images, #723), and r2v with a named character (--reference-entity + --reference-entity-name, #723) only — and an agent-only composer (#799) image t2i and video t2v only; exit 36 is non-retryable, GFLOW_CLI_FLOW_HOST=labs.google is the kill switch (see USAGE § gflow video t2v / i2v / r2v and image sections) |
Telling a user on flow.google.com whose run exits 25 to retry, switch profile or pass --ui-mode classic | On an agent-only composer gflow drives image t2i and video t2v through the agent (#799); exit 25 there means the agent went off-script — a credit confirmation quoting more than asked (rejected, nothing approved) or one whose count gflow cannot read, a second confirmation, more results than asked, or a turn that made nothing (retryable: false). Read the envelope's detail; rephrase the prompt rather than re-running blind, and check the project first — a video may still be rendering. Other forms on that composer exit 36. Exit 25 on labs.google IS the retryable A/B cohort — check the host before advising |
Suggesting a native batch subcommand under gflow video | It doesn't exist — that stub never worked and was removed. Loop gflow video t2v/i2v from the shell for multi-clip runs (gflow image batch manifest.tsv|json is the real, working batch command, but it's image-only) |
gflow-cli is not affiliated with Google. Reverse-engineered; may break when Google changes Flow's private API. Read the DISCLAIMER before deploying in any sensitive setting.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
2 skills in this plugin
npx claudepluginhub ffroliva/gflow-cli --plugin gflowOther plugins' skills for the same job