Star 历史趋势
数据来源: GitHub API · 生成自 Stargazers.cn
README.md

gflow-cli: MCP server and CLI for Google Flow (Veo 3.1, Omni, Nano Banana)

English | 简体中文

gflow-cli is an open-source MCP server and command-line tool that automates Google Flow. It generates Veo 3.1 and Omni video and Nano Banana and Imagen images from Claude Code, Claude Desktop, Cursor, Codex, VS Code or your terminal, billed to your own Google account's Flow credits. Use it as a Google Flow CLI or a Veo MCP server. Install it from PyPI with uv tool install gflow-cli (MIT, macOS, Windows and Linux).

PyPI version CI Python versions PyPI downloads License: MIT Status: beta Coverage OpenSSF Scorecard Listed on mcpservers.org

An independent project, not affiliated with Google. It drives your own signed-in Flow session in a real Chrome window, so Google's terms apply to your account: read the DISCLAIMER and ACCOUNT_SAFETY.

gflow-cli at a glance

What it isOne Python package that is both a CLI (gflow) and an MCP server (gflow mcp run, gflow serve) for Google Flow
Agent surface29 MCP tools plus resources and prompts, over stdio and Streamable HTTP; listed in the official MCP Registry as io.github.ffroliva/gflow-cli
Terminal surface70+ commands with typed exit codes, most with --json output; gflow --help --json prints the whole tree for agents
Video modelsVeo 3.1 Lite, Fast and Quality; Omni Flash and Omni 1.2 Flash (up to 15 s, up to 7 reference images)
Image modelsNano Banana 2.1, Nano Banana Pro, Nano Banana 2 Lite, Imagen 4
Works withClaude Code (plugin), Claude Desktop, Cursor, VS Code, Codex, any MCP client, shell scripts and CI
CostFree and MIT-licensed. Video bills your own Flow credits; images spend no credits (they count against a daily image quota)
MaturityReleases are listed in the changelog; every release since v0.54.0 is live-verified against real Google Flow before it ships

What can gflow-cli do?

  • Generate video: text-to-video, image-to-video with a start and an end frame, and reference-to-video, on Veo 3.1 and Omni (gflow video t2v | i2v | r2v, or gflow video generate to pick the mode for you).
  • Make long videos: gflow video extend --segments N continues a clip past Flow's 8 s limit with a continuous join, gflow video chain links shots frame to frame, and gflow scene create stitches clips server-side for free.
  • Generate images: text-to-image and image-to-image, 1–4 per call, five aspect ratios (gflow image t2i | i2i).
  • Keep characters consistent: gflow character create makes a reusable Flow Character (face, body, voice), and prompts can mention it as @Name.
  • Upscale: video to 4K where Flow offers it for the item, 1080p or a GIF; images to 2K, or 4K on an Ultra plan.
  • Run batches and pipelines: JSON batch runs where a row can build on an earlier row (gflow run), multi-scene films from a manifest (gflow movie run), and persistent Agent-Mode briefs (gflow instructions).
  • Rewrite prompts: --tool creative-director and two other built-in prompt tools (reverse-engineer, storyboard), or your own (TOOLS).
  • Track spend and media: the Veo credit balance (gflow credits), a local media catalog (gflow data), a health check (gflow doctor), and output to S3, MinIO or Google Cloud Storage.

Features on the way are tracked in #1367.

How do I connect Claude Code, Cursor or Codex to Google Flow?

Install gflow-cli and sign in once, then register the MCP server with your client.

uv tool install gflow-cli
gflow auth login --browser chrome
ClientOne step
Claude Code/plugin marketplace add ffroliva/gflow-cli then /plugin install gflow@gflow-cli (adds the MCP server plus the gflow-cli and video-production skills)
Claude Desktopgflow mcp setup
Cursorgflow mcp setup --target cursor
VS Codegflow mcp setup --target vscode
CodexSkills: from a clone, codex plugin marketplace add . then codex plugin add gflow@gflow-cli; MCP: register gflow mcp run as a stdio server
Any MCP clientcommand uvx, arguments gflow-cli mcp run; or gflow serve for Streamable HTTP at /mcp
OpenAI SDK codegflow serve, then base_url="http://127.0.0.1:8000/v1": POST /v1/images/generations with Flow image models, b64_json responses (docs/MCP.md)

The Claude Code plugin ships disabled, because enabling it starts a server that can spend your Veo credits. For a hard guarantee, register gflow mcp run --no-spend, which never registers the credit-spending tools. Full setup: docs/MCP.md.

60-second quick start

Before you install, check that you have:

  • Python 3.11 or newer (uv tool install fetches it) and uv;
  • Google Chrome (sign-in and generation drive a real Chrome window);
  • a display for the one-time sign-in (on Linux servers, Xvfb);
  • a Google account with Flow access, in a region where Google offers Flow.

If PyPI, the Chromium download or Google is not reachable directly, read Behind a proxy or a package mirror first.

Compatible with macOS (Apple Silicon & Intel), Windows, and Linux (x86_64 / Xvfb).

# 1 · Install (uv recommended; also: pip install gflow-cli)
uv tool install gflow-cli
uv tool run --from gflow-cli playwright install chromium     # one-time, ~150 MB
# optional extras: 'gflow-cli[tts]' for `audio narrate` (Edge), 'gflow-cli[chain]' for `video chain`/`assemble`/`captions`
# later: `gflow update` upgrades in place (other commands show a banner when a newer release is out)
# Windows pip install at 0.99.0 or older? Upgrade once by hand first (#1298):
#   close every gflow process, then <venv>\Scripts\python.exe -m pip install --upgrade gflow-cli
#   (keep your extras in the spec, e.g. "gflow-cli[patchright]", or their pins stay behind)
#   (a --user install: py -3.X -m pip install --user --upgrade gflow-cli; see https://github.com/ffroliva/gflow-cli/blob/main/docs/USAGE.md#gflow-update)

# 2 · Authenticate (one-time, opens a real Chrome window)
# Behind a proxy (e.g. Clash)? Set GFLOW_CLI_BROWSER_PROXY=http://127.0.0.1:7897 first; mirrors and details: docs/USER_GUIDE.md#15-behind-a-proxy-or-a-package-mirror
gflow auth login --browser chrome

# Check the session (spends nothing)
gflow auth status
gflow credits user          # Veo credit balance (no browser when the direct read is on and the saved session is accepted; spends nothing)
gflow capabilities          # what gflow can drive here: yes/no/partial per capability (no call to Flow)
gflow models list           # image and video models, aliases, durations (no call to Flow)
gflow doctor                # read-only pre-flight check; exit 33 means it found something to fix, not a crash
# Every error says whether Flow may have charged you and what to do next: docs/ERRORS.md

# 3 · Generate
gflow image t2i "a hot air balloon over Tokyo at sunrise"
# or:
gflow video t2v "Slow cinematic push-in on a sunlit forest clearing" --aspect 16:9
# or mint a reusable Character (face + body reference); it needs a project id:
# `gflow project create` makes a project; `gflow project list` shows the projects recorded in the local catalog
gflow character create --project <project-id> --name "Aria" --face-prompt "..." --body-prompt "..."

Outputs land under $GFLOW_CLI_OUTPUT_DIR (default: gflow-cli in your platform's Downloads folder, typically ~/Downloads/gflow-cli), or you can route them to S3, MinIO, or Google Cloud Storage with GFLOW_CLI_STORAGE_URI. The first call takes 30 to 90 seconds while Chromium warms up; later calls reuse the warm session.

To save one result at an exact path, pass --out-file PATH (for example gflow image t2i "..." --out-file hero.png). Use -o/--output to select the output format (json|table|id). Non-format arguments to -o fail fast with exit 2 reminding you to use --out-file. See USAGE.

Scripts that branch on exit codes can opt in to the stable core now (0 ok, 1 error, 2 usage, 3 auth, 130 interrupted) by setting GFLOW_CLI_EXIT_CODES=2. It becomes the default in a later release. See ERRORS: the stable core.

Why --browser chrome? It is the only strategy that marks the profile as a real-Chrome profile, which is what later generation runs open it with. The default auto picks it whenever Chrome is installed — see docs/AUTHENTICATION.md.

Installing from a local checkout? uv tool install <path> ignores uv.lock and resolves dependencies from the pyproject.toml ranges, so it can hand you a Playwright build this project has never tested. Playwright ships the browser driver, and an untested minor can wedge a generation silently. Carry the locked version explicitly:

uv tool install --force --with playwright==1.61.0 .

Installing from PyPI (uv tool install gflow-cli) is unaffected — the published range is upper-bounded. Check what you actually have with uv tool run --from gflow-cli python -c "import importlib.metadata as m; print(m.version('playwright'))".

For the full 10-minute walkthrough with troubleshooting and multi-account setup, see USER_GUIDE: Journey 1.

Which Google Flow models does gflow-cli support?

gflow models list prints the full list from the installed version (including veo-lite-lp, a lower-priority Veo 3.1 Lite), with no call to Flow. Its retires on column shows the models Flow has said it will retire.

KindModelAliasMax length / refs
VideoOmni 1.2 Flashomni-1.215 s, 7 reference images
VideoOmni Flash (1.1)omni-flash10 s, 7 reference images; Flow retires it on 2026-12-05
VideoVeo 3.1 Qualityveo-quality8 s; Flow retires it on 2026-12-05
VideoVeo 3.1 Fastveo-fast8 s, 3 reference images; Flow retires it on 2026-12-05
VideoVeo 3.1 Liteveo-lite8 s, 3 reference images
ImageNano Banana 2.1nano210 reference images
ImageNano Banana Pronano-pro10 reference images
ImageNano Banana 2 Litenano2-lite3 reference images
ImageImagen 4 (not in Flow's own menu)imagen43 reference images

For the three models Flow retires on 2026-12-05, use veo-lite or omni-1.2 instead (known issue).

Video comes in 16:9 and 9:16; images in 16:9, 4:3, 1:1, 3:4 and 9:16. Which models and durations your account sees depends on your Flow plan; gflow capabilities reports what this install can drive.

How does gflow-cli protect my Flow credits and my account?

  • Only video spends credits. Image generation spends no credits (it counts against a daily image quota), and Scene stitching is free.
  • A server that cannot spend. gflow mcp run --no-spend never registers the credit-spending tools, so an agent cannot call them at all.
  • Cost before commitment on multi-clip runs. video chain, video extend and movie run take --dry-run to show the plan without submitting anything, and chain and extend ask before they spend.
  • Never billed twice. A billed request is sent once and never retried automatically, and gflow run --resume regenerates only the rows the local catalog does not already hold.
  • Every error says whether you were charged. Errors carry charged: yes | no | maybe and a next_action (retry, reauth, reconcile) in both the CLI's --json output and MCP replies (ERRORS).
  • Paced like a person. gflow uses a real Chrome window with randomised interaction timing and paced submissions. It does no IP rotation, uses no proxy unless you set one, and does no fingerprint spoofing by default (ACCOUNT_SAFETY).
  • Fails loudly. When Flow's interface changes, the run stops with a distinct exit code (selector drift is exit 23) instead of guessing.

How does gflow-cli compare with other Google Flow automation tools?

Compared from each project's own README on 2026-11-25. "—" means that README does not state it.

gflow-cliGTAI-1/flow-mcpByteLandTechnology/flow-mcpkodelyx/flow-agentswissmarley/gflow-clicrisng95/flowkit
SurfacesCLI and MCP server (29 tools), parity enforced in CIMCP server, local web panelMCP serverCLI, MCP server (5 tools), OpenAI-compatible REST APICLIChrome extension, local REST API, dashboards
Installuv tool install gflow-cli (PyPI)git clone, npm buildnpm, binariesclone, pip install -e, unpacked Chrome extension, bridge processnpmgit clone, load unpacked extension
Official MCP RegistryYes———no MCPno MCP
MCP over HTTPYes (gflow serve)——SSE (per its docs/MCP_GUIDE.md)no MCPno MCP
macOS / Windows / LinuxAll threemacOS, WindowsAll three——macOS, Linux; Windows through WSL or Git Bash
LicenceMIT—MITMIT (README; no licence file in the repository)MITMIT
Video, image, start/end frames, referencesYesYesYesText- and image-to-video, text-to-imageYesYes
Extend past 8 sYesYesYes—Yes (to 148 s)—
CharactersYesYes, with editYes, with edit—YesYes
UpscaleVideo 4K/1080p, image 2K/4K1080p, 2K——2K, 4KImage 2K/4K export; video upscale not ported
OpenAI-compatible APIImages (POST /v1/images/generations on gflow serve); video planned (#1365)——Yes——
Pool credits across Google accountsNo (one profile per call; switch with gflow auth use)——Yes——
Spend lockout for agents (--no-spend)Yes—————
charged field on every errorYes—————
Per-call credit capYes (--max-credits, read from Flow's own quote)Yes (max_credits)————
Video-to-video editYes (video edit, flow.google.com; local file with up to 5 references, or a clip)YesYes———
Narration audioYes (audio narrate: edge-tts or Gemini voices)Yes———Yes
CaptionsYes (video captions, .srt export)Yes————
Join clipsYes, server-side (scene create) or local with music and voiceover (video assemble)Yes, with music and voiceover——Yes (scene)Yes, with music and narration
Bulk agent-mode image batchPlanned (#1361)Yes————
Web control panelPlanned (#1364)Yes———Yes
Machine-readable self-descriptioncapabilities, --help --json, models, llms.txt, agent skills————Agent skills
Live-verified against real Flow every releaseYes (since v0.54.0)—————

Which should I choose?

  • Choose gflow-cli for a CLI and an MCP server in one PyPI package, with a spend lockout (--no-spend) and a charged field on every error.
  • Choose GTAI-1/flow-mcp for its local web panel.
  • Choose kodelyx/flow-agent for credit pooling across Google accounts.
  • Choose crisng95/flowkit for its Chrome extension and dashboards.

The full list of planned items is in #1367. A correction to a cell is welcome as an issue or a pull request.

Frequently asked questions

Is gflow-cli an official Google tool?

No. It is an independent, MIT-licensed project that drives your own signed-in Google Flow session.

Is this the gflow-cli package on npm or JSR?

No. Other projects use the name, including Node.js packages on npm and JSR. This gflow-cli is the Python package on PyPI, maintained at github.com/ffroliva/gflow-cli and listed in the MCP Registry as io.github.ffroliva/gflow-cli.

Do I need a Gemini or Vertex AI API key?

No. gflow-cli uses your Google account's Flow access and Flow credits, not the pay-per-use API.

Does it cost anything?

The tool is free. Video generation spends your Flow credits; image generation spends none but counts against a daily image quota.

Can an AI agent spend my credits without asking?

Not when you register gflow mcp run --no-spend: the credit-spending tools are never registered. The Claude Code plugin also ships disabled.

Does it run headless or on a server?

Sign-in needs a display once. Generation drives a real Chrome window, so on Linux servers it runs under Xvfb. A pure-HTTP transport for video is blocked by Google's reCAPTCHA (see Architecture).

Does it work with flow.google.com as well as labs.google?

Yes. It drives both Flow frontends and chooses the driver from the host that Flow serves for your account. On flow.google.com it supports text-to-video, image-to-video and reference-to-video from local files. It also supports Nano Banana image generation, a single-segment extend, image and video upscale, and characters by @Name. Features that are not ported yet still use the labs driver (Architecture).

Which Python version?

Python 3.11 or newer. uv tool install gflow-cli handles it for you.

Is there a Google Flow API?

Google does not publish a public Flow API. gflow-cli drives your own signed-in Flow session and exposes it as a command-line tool, MCP tools and an OpenAI-compatible image endpoint (gflow serve, POST /v1/images/generations).

Is there a Veo 3 CLI?

Yes. gflow video t2v, i2v and r2v generate Veo 3.1 video from the terminal, and the same operations are MCP tools. Omni models use the same commands.

Where is Google Flow available?

Google lists the supported countries and territories in Where you can use Google Flow. gflow-cli adds no regional access. If your network needs a proxy or a package mirror, see Behind a proxy or a package mirror.

Examples

One command in, real Flow output back. Left: gflow image t2i generating a photorealistic scene in your library. Right: a frame-to-frame transform.

gflow-cli examples: text-to-image generation, and a before/after frame transform

Demo

gflow image t2i runs a single 9:16 prompt, streams structlog output, and writes a PNG to disk

A single gflow image t2i "..." --aspect 9:16 --model nano2 call against a logged-in Flow profile. The terminal streams the run's structlog JSON, then lists the written PNG. Chromium drives the Flow editor silently in the background.

Reproduce the recording with scripts/record_demo.ps1 (Windows, OBS, ffmpeg, gifski). More formats, including the side-by-side split-screen: docs/DEMOS.md.

Documentation

docs/INDEX.md is the master routing layer. Quick links:

Usage data: gflow stores local usage counters and, after an interactive notice (and explicit consent in the EU/EEA), uploads weekly totals without an identifier. See the privacy notice and how to turn it off.

TopicRead
🎯 Getting startedUser Guide · Usage · Configuration
Storage & catalogExternal Storage · Data Layer
🎭 CharactersCharacters, reusable subjects (gflow character)
🤖 Agentic & automationInstructions (gflow instructions, persistent brief cards) · Movie (gflow movie, multi-scene manifests) · Tools (--tool, prompt rewriting) · MCP server (gflow mcp run / gflow serve)
🔐 Auth & sessionsAuthentication · Known issues
📣 Where to install fromMarketplaces (every channel and what each actually delivers) · Container (why the image introspects but cannot generate)
🏗️ InternalsArchitecture · Security · Usage data notice · Debugging
📦 ReleasesChangelog · Roadmap · Release protocol · Project status
🤝 ContributingContributing · Development · GitHub workflow

For AI agents & LLMs

gflow-cli ships four agent entry points. Pick the one your tool reads first.

FileAudienceTools
AGENTS.mdUniversal coding-agent specCursor · Codex · Aider · Antigravity · Jules · Devin · Windsurf · Zed · Warp · opencode · Copilot
CLAUDE.mdClaude Code's auto-loaded memoryClaude Code
llms.txtLLM-readable summary (llmstxt.org format)Paste into ChatGPT, Claude, or Gemini to onboard the model
skills/gflow-cli/SKILL.mdClaude Code SkillSymlink into ~/.claude/skills/

An agent can also read the whole command tree from the CLI itself: gflow --help --json.

To connect an MCP client, see How do I connect Claude Code, Cursor or Codex to Google Flow?

Onboard any agent in one line. Paste this into your agent of choice:

"Read AGENTS.md and docs/INDEX.md, then help me with my Flow batch."

Architecture & current limitations

gflow CLI  →  Provider (interchangeable)  →  Flow (ui_automation) / Mock (tests)
                                              ↓
                                      Playwright Chromium (headed — login AND generation, by default)
                                              ↓
                              aisandbox-pa.googleapis.com  (Google's private Flow API)

Current transport: ui_automation drives Flow through a persistent Playwright Chromium profile. It is the production transport and is verified end-to-end every release (see the per-release LIVE_VERIFICATION_* evidence files).

Two Flow frontends: Google is moving accounts from labs.google to flow.google.com (#639). It is the same product with a different widget toolkit and wire protocol (batchexecute instead of aisandbox-pa). The migrated driver covers:

  • text-to-video, image-to-video from a local start frame, and reference-to-video from local files;
  • text-to-image and image-to-image from local files;
  • a single-segment video extend.

Image generation supports Nano Banana 2.1 (nano2, #958), 2 Lite and Pro. It supports the five aspect ratios measured on that host (16:9, 4:3, 1:1, 3:4, 9:16) and counts 1–4. An existing project is required at the transport boundary. Images can tag a character by @Name. Reference-to-video takes a named character with --reference-entity and --reference-entity-name (#723). An account that is served the agent-only composer (#799) gets text-to-image and text-to-video only. An image --ref <uuid> is referenced in place when the catalog records it in the same --project (#995).

These keep the labs driver until they are ported: other UUID media references, an entity id without a name, instructions, Imagen 4, and the rest of the matrix (GFLOW_CLI_FLOW_HOST, see CONFIGURATION).

What's blocked: a pure HTTP transport for video generation. The video upload endpoint returns HTTP 401 under non-Chrome browsers. The transport also needs a reCAPTCHA token that the project cannot create in a headless browser. Three earlier HTTP strategies (evaluate_fetch, bearer, sapisidhash) live under src/gflow_cli/api/transports/experimental/ for research, off the production path.

How you can help: if you have driven aisandbox-pa.googleapis.com from outside a real Chrome session, or you understand Google's anti-bot stack here, please open an issue. A working REST transport would enable serverless deployments and true horizontal concurrency. Details: docs/ARCHITECTURE.md § Headed-browser dependency.

Project status

Beta. These features run end-to-end on ui_automation:

  • images: t2i, i2i, upload, upscale and batch;
  • video: t2v, i2v, r2v, chain, extend and upscale;
  • image generate and video generate, which pick the mode from the inputs;
  • a six-model video picker (Veo 3.1 and Omni), plus --duration and --count.

Beyond single generations:

  • gflow movie renders multi-scene manifests;
  • gflow instructions manages persistent Agent-Mode brief cards (credits-free);
  • gflow character handles reusable subjects;
  • gflow scene does credit-free server-side stitching;
  • --tool applies prompt-rewriting tools.

An MCP server (gflow mcp run for stdio, gflow serve for Streamable HTTP) exposes the core surface to AI agents. A CI-enforced CLI↔MCP parity contract keeps the two surfaces in step.

Full milestone history lives in CHANGELOG.md. Where the project is heading: ROADMAP.md.

Support gflow-cli

gflow-cli is maintained by one person. Every release is verified against real Google Flow, which spends real AI credits. Sponsorship pays for that verification.

Sponsor $5 one-time Sponsor $5 a month

Relying on gflow-cli at work? The monthly company tiers put your logo here, and Silver and above also get priority issues. All tiers and what each one gets: docs/SPONSORS.md.

Patched gflow-cli in your fork? Please open an issue or a pull request — a fix that lands upstream helps everyone.

Hall of fame

No sponsors yet. Be the first — every public sponsor is listed here.

License & legal

MIT License © 2026 Flavio Oliva (ffroliva). The MIT license covers gflow-cli's code only. It grants no rights to Flow, Veo model output, or any Google service. Google's own terms (Labs Additional Terms and any plan-specific subscription terms) govern your generations. See the DISCLAIMER.

Acknowledgements


Stats

GitHub stars GitHub forks GitHub watchers GitHub issues GitHub pull requests GitHub last commit GitHub repo size PyPI downloads

Project quality

Quality Gate Status Release Type checked: pyright Code style: ruff Tests: TDD Platforms: macOS · Windows · Linux Ask DeepWiki

Star history

Star history chart for ffroliva/gflow-cli

If gflow-cli saves you time, please ⭐ the repo. It is the cheapest way to support the project.

关于 About

MCP server and CLI for Google Flow: generate Veo 3.1 and Omni video and Nano Banana / Imagen images from Claude Code, Claude Desktop, Cursor, VS Code, Codex or the terminal. Free, MIT, on PyPI. 中文文档: README.zh-CN.md. Independent project, not affiliated with Google.
ai-agentsclaude-codeclicodexcursorgoogle-flowimagenmcpmcp-servermodel-context-protocolnano-bananapythonveoveo-3video-generation

语言 Languages

Python98.1%
Gherkin0.8%
PowerShell0.5%
HTML0.4%
JavaScript0.1%
CSS0.0%
Shell0.0%
Dockerfile0.0%

提交活跃度 Commit Activity

代码提交热力图
过去 52 周的开发活跃度
4056
Total Commits
峰值: 649次/周
Less
More

核心贡献者 Contributors