Latest commit

History

1,556 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

gflow-cli

Unofficial Python CLI for Google Flow. Drive Veo (image-to-video, text-to-video) and Imagen (text-to-image) from your terminal: scripted, batched, pipeline-ready.

PyPI versionCIReleasePython versionsLicense: MITStatus: alphaCode style: ruffType checked: pyrightTests: TDDQuality Gate StatusCoverageOpenSSF Scorecard

⚠️Read this before you install. gflow-cli is unofficial, alpha, and reverse-engineered — not affiliated with Google. It drives a headed browser on your own Google Flow session, so treat it as your own account risk: automation is subject to Google's ToS, and endpoints or UI can change without notice. It works with any Google account that has Flow access, and every generation bills against your account's Flow credit allowance. Read the full DISCLAIMER.

🛡️ "Will this get my account flagged?" The honest, specific answer — what the tool does to stay unremarkable (headed real Chrome, randomised interaction timing, paced submissions), what it deliberately does not do (no proxies, no fingerprint spoofing, no pretending it isn't automation), what you can tune, and what we cannot promise — is in docs/ACCOUNT_SAFETY.md.

💳 What failure costs you. Credits are only spent on Veo video generation — images and composition ops are free, so most breakage costs nothing. When Flow's UI drifts mid-run, the CLI fails fast and loudly with distinct exit codes (e.g. selector drift = exit 23) instead of resubmitting, and batch items are recorded locally before submission so a broken run never silently burns credits on a stale state. See KNOWN_ISSUES for the current risk list.

🌐 Headed browser today. gflow drives Flow through a persistent Playwright Chromium profile, because Google's auth and reCAPTCHA gates require it. The Architecture section shows where you can help.

Why gflow-cli?

You have a Google account with Flow access, you have Veo credits, and you run real batch work. gflow-cli gives you:

  • Batch generation. Loop prompts straight from the shell: for p in $(cat prompts.txt); do gflow image t2i "$p"; done. Image batching plus gflow video t2v / i2v / r2v all ship today, and gflow video extend continues an existing clip past Flow's 8s ceiling.
  • Consistent subjects.gflow character create mints a Flow Character (face and body reference) so the same person appears from one generation to the next.
  • Prompt tools.--tool creative-director rewrites a terse prompt into a vivid one (Google's 5-component formula) before generating — on any command. Bring your own with My Tools.
  • Pipelines. Wire Veo into your content automation, AI-video stack, or batch experiments.
  • Terminal-native. After one gflow auth login, you stay in the shell. No clicking through dialogs.

Same Veo and Imagen models, same quality, same billing against your own Google account, now programmatic.

60-second quick start

# 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# 2 · Authenticate (one-time, opens a real Chrome window)
gflow auth login --browser chrome
# 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):
gflow character create --project <id> --name "Aria" --face-prompt "..." --body-prompt "..."

Outputs land under $GFLOW_CLI_OUTPUT_DIR, 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.

Why --browser chrome? Google rejects Playwright's bundled Chromium. The CLI fails fast with a friendly error (AuthBrowserRejectedError, exit code 14) if you pick anything else.

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.59.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.

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:

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
🏗️ InternalsArchitecture · Security · 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/

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) / [planned: Official Veo]
↓
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 production-stable and verified end-to-end every release (see the per-release LIVE_VERIFICATION_* evidence files).

What's blocked: a pure HTTP transport for video generation. The video upload endpoint returns HTTP 401 under non-Chrome browsers plus a reCAPTCHA mint we cannot reproduce headlessly. 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 unlock serverless deployments, true horizontal concurrency, and roughly 10x the project's reach. Details: docs/ARCHITECTURE.md § Headed-browser dependency.

Project status

Alpha. Image (t2i, i2i, upload, upscale, batch) and video (t2v, i2v, r2v, chain, extend) run end-to-end on ui_automation, with a 5-model Veo picker 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, and an MCP server (gflow mcp run stdio / gflow serve Streamable HTTP) exposes the core surface to AI agents with a CI-enforced CLI↔MCP parity contract.

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

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 starsGitHub forksGitHub watchersGitHub issuesGitHub pull requestsGitHub last commitGitHub repo sizePyPI downloads

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

Drive Google Flow from the command line: Veo video and Imagen images, scripted, batched and pipeline-ready. Ships an MCP server so coding agents can drive it too, giving you and your agents full programmatic control over generation. Unofficial, alpha, not affiliated with Google.

Topics

Resources

Contributing

Security policy

Stars

140 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

Latest commit

History

1,556 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

gflow-cli

Unofficial Python CLI for Google Flow. Drive Veo (image-to-video, text-to-video) and Imagen (text-to-image) from your terminal: scripted, batched, pipeline-ready.

PyPI versionCIReleasePython versionsLicense: MITStatus: alphaCode style: ruffType checked: pyrightTests: TDDQuality Gate StatusCoverageOpenSSF Scorecard

⚠️Read this before you install. gflow-cli is unofficial, alpha, and reverse-engineered — not affiliated with Google. It drives a headed browser on your own Google Flow session, so treat it as your own account risk: automation is subject to Google's ToS, and endpoints or UI can change without notice. It works with any Google account that has Flow access, and every generation bills against your account's Flow credit allowance. Read the full DISCLAIMER.

🛡️ "Will this get my account flagged?" The honest, specific answer — what the tool does to stay unremarkable (headed real Chrome, randomised interaction timing, paced submissions), what it deliberately does not do (no proxies, no fingerprint spoofing, no pretending it isn't automation), what you can tune, and what we cannot promise — is in docs/ACCOUNT_SAFETY.md.

💳 What failure costs you. Credits are only spent on Veo video generation — images and composition ops are free, so most breakage costs nothing. When Flow's UI drifts mid-run, the CLI fails fast and loudly with distinct exit codes (e.g. selector drift = exit 23) instead of resubmitting, and batch items are recorded locally before submission so a broken run never silently burns credits on a stale state. See KNOWN_ISSUES for the current risk list.

🌐 Headed browser today. gflow drives Flow through a persistent Playwright Chromium profile, because Google's auth and reCAPTCHA gates require it. The Architecture section shows where you can help.

Why gflow-cli?

You have a Google account with Flow access, you have Veo credits, and you run real batch work. gflow-cli gives you:

  • Batch generation. Loop prompts straight from the shell: for p in $(cat prompts.txt); do gflow image t2i "$p"; done. Image batching plus gflow video t2v / i2v / r2v all ship today, and gflow video extend continues an existing clip past Flow's 8s ceiling.
  • Consistent subjects.gflow character create mints a Flow Character (face and body reference) so the same person appears from one generation to the next.
  • Prompt tools.--tool creative-director rewrites a terse prompt into a vivid one (Google's 5-component formula) before generating — on any command. Bring your own with My Tools.
  • Pipelines. Wire Veo into your content automation, AI-video stack, or batch experiments.
  • Terminal-native. After one gflow auth login, you stay in the shell. No clicking through dialogs.

Same Veo and Imagen models, same quality, same billing against your own Google account, now programmatic.

60-second quick start

# 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# 2 · Authenticate (one-time, opens a real Chrome window)
gflow auth login --browser chrome
# 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):
gflow character create --project <id> --name "Aria" --face-prompt "..." --body-prompt "..."

Outputs land under $GFLOW_CLI_OUTPUT_DIR, 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.

Why --browser chrome? Google rejects Playwright's bundled Chromium. The CLI fails fast with a friendly error (AuthBrowserRejectedError, exit code 14) if you pick anything else.

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.59.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.

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:

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
🏗️ InternalsArchitecture · Security · 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/

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) / [planned: Official Veo]
↓
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 production-stable and verified end-to-end every release (see the per-release LIVE_VERIFICATION_* evidence files).

What's blocked: a pure HTTP transport for video generation. The video upload endpoint returns HTTP 401 under non-Chrome browsers plus a reCAPTCHA mint we cannot reproduce headlessly. 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 unlock serverless deployments, true horizontal concurrency, and roughly 10x the project's reach. Details: docs/ARCHITECTURE.md § Headed-browser dependency.

Project status

Alpha. Image (t2i, i2i, upload, upscale, batch) and video (t2v, i2v, r2v, chain, extend) run end-to-end on ui_automation, with a 5-model Veo picker 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, and an MCP server (gflow mcp run stdio / gflow serve Streamable HTTP) exposes the core surface to AI agents with a CI-enforced CLI↔MCP parity contract.

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

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 starsGitHub forksGitHub watchersGitHub issuesGitHub pull requestsGitHub last commitGitHub repo sizePyPI downloads

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

Drive Google Flow from the command line: Veo video and Imagen images, scripted, batched and pipeline-ready. Ships an MCP server so coding agents can drive it too, giving you and your agents full programmatic control over generation. Unofficial, alpha, not affiliated with Google.

Topics

Resources

Contributing

Security policy

Stars

140 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Latest commit

History

1,556 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

gflow-cli

Unofficial Python CLI for Google Flow. Drive Veo (image-to-video, text-to-video) and Imagen (text-to-image) from your terminal: scripted, batched, pipeline-ready.

PyPI versionCIReleasePython versionsLicense: MITStatus: alphaCode style: ruffType checked: pyrightTests: TDDQuality Gate StatusCoverageOpenSSF Scorecard

⚠️Read this before you install. gflow-cli is unofficial, alpha, and reverse-engineered — not affiliated with Google. It drives a headed browser on your own Google Flow session, so treat it as your own account risk: automation is subject to Google's ToS, and endpoints or UI can change without notice. It works with any Google account that has Flow access, and every generation bills against your account's Flow credit allowance. Read the full DISCLAIMER.

🛡️ "Will this get my account flagged?" The honest, specific answer — what the tool does to stay unremarkable (headed real Chrome, randomised interaction timing, paced submissions), what it deliberately does not do (no proxies, no fingerprint spoofing, no pretending it isn't automation), what you can tune, and what we cannot promise — is in docs/ACCOUNT_SAFETY.md.

💳 What failure costs you. Credits are only spent on Veo video generation — images and composition ops are free, so most breakage costs nothing. When Flow's UI drifts mid-run, the CLI fails fast and loudly with distinct exit codes (e.g. selector drift = exit 23) instead of resubmitting, and batch items are recorded locally before submission so a broken run never silently burns credits on a stale state. See KNOWN_ISSUES for the current risk list.

🌐 Headed browser today. gflow drives Flow through a persistent Playwright Chromium profile, because Google's auth and reCAPTCHA gates require it. The Architecture section shows where you can help.

Why gflow-cli?

You have a Google account with Flow access, you have Veo credits, and you run real batch work. gflow-cli gives you:

  • Batch generation. Loop prompts straight from the shell: for p in $(cat prompts.txt); do gflow image t2i "$p"; done. Image batching plus gflow video t2v / i2v / r2v all ship today, and gflow video extend continues an existing clip past Flow's 8s ceiling.
  • Consistent subjects.gflow character create mints a Flow Character (face and body reference) so the same person appears from one generation to the next.
  • Prompt tools.--tool creative-director rewrites a terse prompt into a vivid one (Google's 5-component formula) before generating — on any command. Bring your own with My Tools.
  • Pipelines. Wire Veo into your content automation, AI-video stack, or batch experiments.
  • Terminal-native. After one gflow auth login, you stay in the shell. No clicking through dialogs.

Same Veo and Imagen models, same quality, same billing against your own Google account, now programmatic.

60-second quick start

# 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# 2 · Authenticate (one-time, opens a real Chrome window)
gflow auth login --browser chrome
# 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):
gflow character create --project <id> --name "Aria" --face-prompt "..." --body-prompt "..."

Outputs land under $GFLOW_CLI_OUTPUT_DIR, 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.

Why --browser chrome? Google rejects Playwright's bundled Chromium. The CLI fails fast with a friendly error (AuthBrowserRejectedError, exit code 14) if you pick anything else.

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.59.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.

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:

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
🏗️ InternalsArchitecture · Security · 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/

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) / [planned: Official Veo]
↓
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 production-stable and verified end-to-end every release (see the per-release LIVE_VERIFICATION_* evidence files).

What's blocked: a pure HTTP transport for video generation. The video upload endpoint returns HTTP 401 under non-Chrome browsers plus a reCAPTCHA mint we cannot reproduce headlessly. 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 unlock serverless deployments, true horizontal concurrency, and roughly 10x the project's reach. Details: docs/ARCHITECTURE.md § Headed-browser dependency.

Project status

Alpha. Image (t2i, i2i, upload, upscale, batch) and video (t2v, i2v, r2v, chain, extend) run end-to-end on ui_automation, with a 5-model Veo picker 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, and an MCP server (gflow mcp run stdio / gflow serve Streamable HTTP) exposes the core surface to AI agents with a CI-enforced CLI↔MCP parity contract.

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

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 starsGitHub forksGitHub watchersGitHub issuesGitHub pull requestsGitHub last commitGitHub repo sizePyPI downloads

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

Drive Google Flow from the command line: Veo video and Imagen images, scripted, batched and pipeline-ready. Ships an MCP server so coding agents can drive it too, giving you and your agents full programmatic control over generation. Unofficial, alpha, not affiliated with Google.

Topics

Resources

Contributing

Security policy

Stars

140 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Latest commit

History

1,556 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

gflow-cli

Unofficial Python CLI for Google Flow. Drive Veo (image-to-video, text-to-video) and Imagen (text-to-image) from your terminal: scripted, batched, pipeline-ready.

PyPI versionCIReleasePython versionsLicense: MITStatus: alphaCode style: ruffType checked: pyrightTests: TDDQuality Gate StatusCoverageOpenSSF Scorecard

⚠️Read this before you install. gflow-cli is unofficial, alpha, and reverse-engineered — not affiliated with Google. It drives a headed browser on your own Google Flow session, so treat it as your own account risk: automation is subject to Google's ToS, and endpoints or UI can change without notice. It works with any Google account that has Flow access, and every generation bills against your account's Flow credit allowance. Read the full DISCLAIMER.

🛡️ "Will this get my account flagged?" The honest, specific answer — what the tool does to stay unremarkable (headed real Chrome, randomised interaction timing, paced submissions), what it deliberately does not do (no proxies, no fingerprint spoofing, no pretending it isn't automation), what you can tune, and what we cannot promise — is in docs/ACCOUNT_SAFETY.md.

💳 What failure costs you. Credits are only spent on Veo video generation — images and composition ops are free, so most breakage costs nothing. When Flow's UI drifts mid-run, the CLI fails fast and loudly with distinct exit codes (e.g. selector drift = exit 23) instead of resubmitting, and batch items are recorded locally before submission so a broken run never silently burns credits on a stale state. See KNOWN_ISSUES for the current risk list.

🌐 Headed browser today. gflow drives Flow through a persistent Playwright Chromium profile, because Google's auth and reCAPTCHA gates require it. The Architecture section shows where you can help.

Why gflow-cli?

You have a Google account with Flow access, you have Veo credits, and you run real batch work. gflow-cli gives you:

  • Batch generation. Loop prompts straight from the shell: for p in $(cat prompts.txt); do gflow image t2i "$p"; done. Image batching plus gflow video t2v / i2v / r2v all ship today, and gflow video extend continues an existing clip past Flow's 8s ceiling.
  • Consistent subjects.gflow character create mints a Flow Character (face and body reference) so the same person appears from one generation to the next.
  • Prompt tools.--tool creative-director rewrites a terse prompt into a vivid one (Google's 5-component formula) before generating — on any command. Bring your own with My Tools.
  • Pipelines. Wire Veo into your content automation, AI-video stack, or batch experiments.
  • Terminal-native. After one gflow auth login, you stay in the shell. No clicking through dialogs.

Same Veo and Imagen models, same quality, same billing against your own Google account, now programmatic.

60-second quick start

# 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# 2 · Authenticate (one-time, opens a real Chrome window)
gflow auth login --browser chrome
# 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):
gflow character create --project <id> --name "Aria" --face-prompt "..." --body-prompt "..."

Outputs land under $GFLOW_CLI_OUTPUT_DIR, 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.

Why --browser chrome? Google rejects Playwright's bundled Chromium. The CLI fails fast with a friendly error (AuthBrowserRejectedError, exit code 14) if you pick anything else.

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.59.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.

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:

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
🏗️ InternalsArchitecture · Security · 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/

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) / [planned: Official Veo]
↓
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 production-stable and verified end-to-end every release (see the per-release LIVE_VERIFICATION_* evidence files).

What's blocked: a pure HTTP transport for video generation. The video upload endpoint returns HTTP 401 under non-Chrome browsers plus a reCAPTCHA mint we cannot reproduce headlessly. 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 unlock serverless deployments, true horizontal concurrency, and roughly 10x the project's reach. Details: docs/ARCHITECTURE.md § Headed-browser dependency.

Project status

Alpha. Image (t2i, i2i, upload, upscale, batch) and video (t2v, i2v, r2v, chain, extend) run end-to-end on ui_automation, with a 5-model Veo picker 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, and an MCP server (gflow mcp run stdio / gflow serve Streamable HTTP) exposes the core surface to AI agents with a CI-enforced CLI↔MCP parity contract.

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

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 starsGitHub forksGitHub watchersGitHub issuesGitHub pull requestsGitHub last commitGitHub repo sizePyPI downloads

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

Drive Google Flow from the command line: Veo video and Imagen images, scripted, batched and pipeline-ready. Ships an MCP server so coding agents can drive it too, giving you and your agents full programmatic control over generation. Unofficial, alpha, not affiliated with Google.

Topics

Resources

Contributing

Security policy

Stars

140 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

Latest commit

History

1,556 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

gflow-cli

Unofficial Python CLI for Google Flow. Drive Veo (image-to-video, text-to-video) and Imagen (text-to-image) from your terminal: scripted, batched, pipeline-ready.

PyPI versionCIReleasePython versionsLicense: MITStatus: alphaCode style: ruffType checked: pyrightTests: TDDQuality Gate StatusCoverageOpenSSF Scorecard

⚠️Read this before you install. gflow-cli is unofficial, alpha, and reverse-engineered — not affiliated with Google. It drives a headed browser on your own Google Flow session, so treat it as your own account risk: automation is subject to Google's ToS, and endpoints or UI can change without notice. It works with any Google account that has Flow access, and every generation bills against your account's Flow credit allowance. Read the full DISCLAIMER.

🛡️ "Will this get my account flagged?" The honest, specific answer — what the tool does to stay unremarkable (headed real Chrome, randomised interaction timing, paced submissions), what it deliberately does not do (no proxies, no fingerprint spoofing, no pretending it isn't automation), what you can tune, and what we cannot promise — is in docs/ACCOUNT_SAFETY.md.

💳 What failure costs you. Credits are only spent on Veo video generation — images and composition ops are free, so most breakage costs nothing. When Flow's UI drifts mid-run, the CLI fails fast and loudly with distinct exit codes (e.g. selector drift = exit 23) instead of resubmitting, and batch items are recorded locally before submission so a broken run never silently burns credits on a stale state. See KNOWN_ISSUES for the current risk list.

🌐 Headed browser today. gflow drives Flow through a persistent Playwright Chromium profile, because Google's auth and reCAPTCHA gates require it. The Architecture section shows where you can help.

Why gflow-cli?

You have a Google account with Flow access, you have Veo credits, and you run real batch work. gflow-cli gives you:

  • Batch generation. Loop prompts straight from the shell: for p in $(cat prompts.txt); do gflow image t2i "$p"; done. Image batching plus gflow video t2v / i2v / r2v all ship today, and gflow video extend continues an existing clip past Flow's 8s ceiling.
  • Consistent subjects.gflow character create mints a Flow Character (face and body reference) so the same person appears from one generation to the next.
  • Prompt tools.--tool creative-director rewrites a terse prompt into a vivid one (Google's 5-component formula) before generating — on any command. Bring your own with My Tools.
  • Pipelines. Wire Veo into your content automation, AI-video stack, or batch experiments.
  • Terminal-native. After one gflow auth login, you stay in the shell. No clicking through dialogs.

Same Veo and Imagen models, same quality, same billing against your own Google account, now programmatic.

60-second quick start

# 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# 2 · Authenticate (one-time, opens a real Chrome window)
gflow auth login --browser chrome
# 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):
gflow character create --project <id> --name "Aria" --face-prompt "..." --body-prompt "..."

Outputs land under $GFLOW_CLI_OUTPUT_DIR, 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.

Why --browser chrome? Google rejects Playwright's bundled Chromium. The CLI fails fast with a friendly error (AuthBrowserRejectedError, exit code 14) if you pick anything else.

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.59.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.

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:

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
🏗️ InternalsArchitecture · Security · 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/

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) / [planned: Official Veo]
↓
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 production-stable and verified end-to-end every release (see the per-release LIVE_VERIFICATION_* evidence files).

What's blocked: a pure HTTP transport for video generation. The video upload endpoint returns HTTP 401 under non-Chrome browsers plus a reCAPTCHA mint we cannot reproduce headlessly. 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 unlock serverless deployments, true horizontal concurrency, and roughly 10x the project's reach. Details: docs/ARCHITECTURE.md § Headed-browser dependency.

Project status

Alpha. Image (t2i, i2i, upload, upscale, batch) and video (t2v, i2v, r2v, chain, extend) run end-to-end on ui_automation, with a 5-model Veo picker 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, and an MCP server (gflow mcp run stdio / gflow serve Streamable HTTP) exposes the core surface to AI agents with a CI-enforced CLI↔MCP parity contract.

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

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 starsGitHub forksGitHub watchersGitHub issuesGitHub pull requestsGitHub last commitGitHub repo sizePyPI downloads

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

Drive Google Flow from the command line: Veo video and Imagen images, scripted, batched and pipeline-ready. Ships an MCP server so coding agents can drive it too, giving you and your agents full programmatic control over generation. Unofficial, alpha, not affiliated with Google.

Topics

Resources

Contributing

Security policy

Stars

140 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Latest commit

History

1,556 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

gflow-cli

Unofficial Python CLI for Google Flow. Drive Veo (image-to-video, text-to-video) and Imagen (text-to-image) from your terminal: scripted, batched, pipeline-ready.

PyPI versionCIReleasePython versionsLicense: MITStatus: alphaCode style: ruffType checked: pyrightTests: TDDQuality Gate StatusCoverageOpenSSF Scorecard

⚠️Read this before you install. gflow-cli is unofficial, alpha, and reverse-engineered — not affiliated with Google. It drives a headed browser on your own Google Flow session, so treat it as your own account risk: automation is subject to Google's ToS, and endpoints or UI can change without notice. It works with any Google account that has Flow access, and every generation bills against your account's Flow credit allowance. Read the full DISCLAIMER.

🛡️ "Will this get my account flagged?" The honest, specific answer — what the tool does to stay unremarkable (headed real Chrome, randomised interaction timing, paced submissions), what it deliberately does not do (no proxies, no fingerprint spoofing, no pretending it isn't automation), what you can tune, and what we cannot promise — is in docs/ACCOUNT_SAFETY.md.

💳 What failure costs you. Credits are only spent on Veo video generation — images and composition ops are free, so most breakage costs nothing. When Flow's UI drifts mid-run, the CLI fails fast and loudly with distinct exit codes (e.g. selector drift = exit 23) instead of resubmitting, and batch items are recorded locally before submission so a broken run never silently burns credits on a stale state. See KNOWN_ISSUES for the current risk list.

🌐 Headed browser today. gflow drives Flow through a persistent Playwright Chromium profile, because Google's auth and reCAPTCHA gates require it. The Architecture section shows where you can help.

Why gflow-cli?

You have a Google account with Flow access, you have Veo credits, and you run real batch work. gflow-cli gives you:

  • Batch generation. Loop prompts straight from the shell: for p in $(cat prompts.txt); do gflow image t2i "$p"; done. Image batching plus gflow video t2v / i2v / r2v all ship today, and gflow video extend continues an existing clip past Flow's 8s ceiling.
  • Consistent subjects.gflow character create mints a Flow Character (face and body reference) so the same person appears from one generation to the next.
  • Prompt tools.--tool creative-director rewrites a terse prompt into a vivid one (Google's 5-component formula) before generating — on any command. Bring your own with My Tools.
  • Pipelines. Wire Veo into your content automation, AI-video stack, or batch experiments.
  • Terminal-native. After one gflow auth login, you stay in the shell. No clicking through dialogs.

Same Veo and Imagen models, same quality, same billing against your own Google account, now programmatic.

60-second quick start

# 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# 2 · Authenticate (one-time, opens a real Chrome window)
gflow auth login --browser chrome
# 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):
gflow character create --project <id> --name "Aria" --face-prompt "..." --body-prompt "..."

Outputs land under $GFLOW_CLI_OUTPUT_DIR, 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.

Why --browser chrome? Google rejects Playwright's bundled Chromium. The CLI fails fast with a friendly error (AuthBrowserRejectedError, exit code 14) if you pick anything else.

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.59.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.

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:

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
🏗️ InternalsArchitecture · Security · 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/

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) / [planned: Official Veo]
↓
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 production-stable and verified end-to-end every release (see the per-release LIVE_VERIFICATION_* evidence files).

What's blocked: a pure HTTP transport for video generation. The video upload endpoint returns HTTP 401 under non-Chrome browsers plus a reCAPTCHA mint we cannot reproduce headlessly. 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 unlock serverless deployments, true horizontal concurrency, and roughly 10x the project's reach. Details: docs/ARCHITECTURE.md § Headed-browser dependency.

Project status

Alpha. Image (t2i, i2i, upload, upscale, batch) and video (t2v, i2v, r2v, chain, extend) run end-to-end on ui_automation, with a 5-model Veo picker 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, and an MCP server (gflow mcp run stdio / gflow serve Streamable HTTP) exposes the core surface to AI agents with a CI-enforced CLI↔MCP parity contract.

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

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 starsGitHub forksGitHub watchersGitHub issuesGitHub pull requestsGitHub last commitGitHub repo sizePyPI downloads

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

Drive Google Flow from the command line: Veo video and Imagen images, scripted, batched and pipeline-ready. Ships an MCP server so coding agents can drive it too, giving you and your agents full programmatic control over generation. Unofficial, alpha, not affiliated with Google.

Topics

Resources

Contributing

Security policy

Stars

140 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Latest commit

History

1,556 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

gflow-cli

Unofficial Python CLI for Google Flow. Drive Veo (image-to-video, text-to-video) and Imagen (text-to-image) from your terminal: scripted, batched, pipeline-ready.

PyPI versionCIReleasePython versionsLicense: MITStatus: alphaCode style: ruffType checked: pyrightTests: TDDQuality Gate StatusCoverageOpenSSF Scorecard

⚠️Read this before you install. gflow-cli is unofficial, alpha, and reverse-engineered — not affiliated with Google. It drives a headed browser on your own Google Flow session, so treat it as your own account risk: automation is subject to Google's ToS, and endpoints or UI can change without notice. It works with any Google account that has Flow access, and every generation bills against your account's Flow credit allowance. Read the full DISCLAIMER.

🛡️ "Will this get my account flagged?" The honest, specific answer — what the tool does to stay unremarkable (headed real Chrome, randomised interaction timing, paced submissions), what it deliberately does not do (no proxies, no fingerprint spoofing, no pretending it isn't automation), what you can tune, and what we cannot promise — is in docs/ACCOUNT_SAFETY.md.

💳 What failure costs you. Credits are only spent on Veo video generation — images and composition ops are free, so most breakage costs nothing. When Flow's UI drifts mid-run, the CLI fails fast and loudly with distinct exit codes (e.g. selector drift = exit 23) instead of resubmitting, and batch items are recorded locally before submission so a broken run never silently burns credits on a stale state. See KNOWN_ISSUES for the current risk list.

🌐 Headed browser today. gflow drives Flow through a persistent Playwright Chromium profile, because Google's auth and reCAPTCHA gates require it. The Architecture section shows where you can help.

Why gflow-cli?

You have a Google account with Flow access, you have Veo credits, and you run real batch work. gflow-cli gives you:

  • Batch generation. Loop prompts straight from the shell: for p in $(cat prompts.txt); do gflow image t2i "$p"; done. Image batching plus gflow video t2v / i2v / r2v all ship today, and gflow video extend continues an existing clip past Flow's 8s ceiling.
  • Consistent subjects.gflow character create mints a Flow Character (face and body reference) so the same person appears from one generation to the next.
  • Prompt tools.--tool creative-director rewrites a terse prompt into a vivid one (Google's 5-component formula) before generating — on any command. Bring your own with My Tools.
  • Pipelines. Wire Veo into your content automation, AI-video stack, or batch experiments.
  • Terminal-native. After one gflow auth login, you stay in the shell. No clicking through dialogs.

Same Veo and Imagen models, same quality, same billing against your own Google account, now programmatic.

60-second quick start

# 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# 2 · Authenticate (one-time, opens a real Chrome window)
gflow auth login --browser chrome
# 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):
gflow character create --project <id> --name "Aria" --face-prompt "..." --body-prompt "..."

Outputs land under $GFLOW_CLI_OUTPUT_DIR, 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.

Why --browser chrome? Google rejects Playwright's bundled Chromium. The CLI fails fast with a friendly error (AuthBrowserRejectedError, exit code 14) if you pick anything else.

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.59.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.

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:

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
🏗️ InternalsArchitecture · Security · 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/

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) / [planned: Official Veo]
↓
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 production-stable and verified end-to-end every release (see the per-release LIVE_VERIFICATION_* evidence files).

What's blocked: a pure HTTP transport for video generation. The video upload endpoint returns HTTP 401 under non-Chrome browsers plus a reCAPTCHA mint we cannot reproduce headlessly. 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 unlock serverless deployments, true horizontal concurrency, and roughly 10x the project's reach. Details: docs/ARCHITECTURE.md § Headed-browser dependency.

Project status

Alpha. Image (t2i, i2i, upload, upscale, batch) and video (t2v, i2v, r2v, chain, extend) run end-to-end on ui_automation, with a 5-model Veo picker 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, and an MCP server (gflow mcp run stdio / gflow serve Streamable HTTP) exposes the core surface to AI agents with a CI-enforced CLI↔MCP parity contract.

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

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 starsGitHub forksGitHub watchersGitHub issuesGitHub pull requestsGitHub last commitGitHub repo sizePyPI downloads

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

Drive Google Flow from the command line: Veo video and Imagen images, scripted, batched and pipeline-ready. Ships an MCP server so coding agents can drive it too, giving you and your agents full programmatic control over generation. Unofficial, alpha, not affiliated with Google.

Topics

Resources

Contributing

Security policy

Stars

140 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

Latest commit

History

1,556 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

gflow-cli

Unofficial Python CLI for Google Flow. Drive Veo (image-to-video, text-to-video) and Imagen (text-to-image) from your terminal: scripted, batched, pipeline-ready.

PyPI versionCIReleasePython versionsLicense: MITStatus: alphaCode style: ruffType checked: pyrightTests: TDDQuality Gate StatusCoverageOpenSSF Scorecard

⚠️Read this before you install. gflow-cli is unofficial, alpha, and reverse-engineered — not affiliated with Google. It drives a headed browser on your own Google Flow session, so treat it as your own account risk: automation is subject to Google's ToS, and endpoints or UI can change without notice. It works with any Google account that has Flow access, and every generation bills against your account's Flow credit allowance. Read the full DISCLAIMER.

🛡️ "Will this get my account flagged?" The honest, specific answer — what the tool does to stay unremarkable (headed real Chrome, randomised interaction timing, paced submissions), what it deliberately does not do (no proxies, no fingerprint spoofing, no pretending it isn't automation), what you can tune, and what we cannot promise — is in docs/ACCOUNT_SAFETY.md.

💳 What failure costs you. Credits are only spent on Veo video generation — images and composition ops are free, so most breakage costs nothing. When Flow's UI drifts mid-run, the CLI fails fast and loudly with distinct exit codes (e.g. selector drift = exit 23) instead of resubmitting, and batch items are recorded locally before submission so a broken run never silently burns credits on a stale state. See KNOWN_ISSUES for the current risk list.

🌐 Headed browser today. gflow drives Flow through a persistent Playwright Chromium profile, because Google's auth and reCAPTCHA gates require it. The Architecture section shows where you can help.

Why gflow-cli?

You have a Google account with Flow access, you have Veo credits, and you run real batch work. gflow-cli gives you:

  • Batch generation. Loop prompts straight from the shell: for p in $(cat prompts.txt); do gflow image t2i "$p"; done. Image batching plus gflow video t2v / i2v / r2v all ship today, and gflow video extend continues an existing clip past Flow's 8s ceiling.
  • Consistent subjects.gflow character create mints a Flow Character (face and body reference) so the same person appears from one generation to the next.
  • Prompt tools.--tool creative-director rewrites a terse prompt into a vivid one (Google's 5-component formula) before generating — on any command. Bring your own with My Tools.
  • Pipelines. Wire Veo into your content automation, AI-video stack, or batch experiments.
  • Terminal-native. After one gflow auth login, you stay in the shell. No clicking through dialogs.

Same Veo and Imagen models, same quality, same billing against your own Google account, now programmatic.

60-second quick start

# 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# 2 · Authenticate (one-time, opens a real Chrome window)
gflow auth login --browser chrome
# 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):
gflow character create --project <id> --name "Aria" --face-prompt "..." --body-prompt "..."

Outputs land under $GFLOW_CLI_OUTPUT_DIR, 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.

Why --browser chrome? Google rejects Playwright's bundled Chromium. The CLI fails fast with a friendly error (AuthBrowserRejectedError, exit code 14) if you pick anything else.

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.59.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.

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:

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
🏗️ InternalsArchitecture · Security · 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/

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) / [planned: Official Veo]
↓
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 production-stable and verified end-to-end every release (see the per-release LIVE_VERIFICATION_* evidence files).

What's blocked: a pure HTTP transport for video generation. The video upload endpoint returns HTTP 401 under non-Chrome browsers plus a reCAPTCHA mint we cannot reproduce headlessly. 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 unlock serverless deployments, true horizontal concurrency, and roughly 10x the project's reach. Details: docs/ARCHITECTURE.md § Headed-browser dependency.

Project status

Alpha. Image (t2i, i2i, upload, upscale, batch) and video (t2v, i2v, r2v, chain, extend) run end-to-end on ui_automation, with a 5-model Veo picker 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, and an MCP server (gflow mcp run stdio / gflow serve Streamable HTTP) exposes the core surface to AI agents with a CI-enforced CLI↔MCP parity contract.

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

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 starsGitHub forksGitHub watchersGitHub issuesGitHub pull requestsGitHub last commitGitHub repo sizePyPI downloads

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

Drive Google Flow from the command line: Veo video and Imagen images, scripted, batched and pipeline-ready. Ships an MCP server so coding agents can drive it too, giving you and your agents full programmatic control over generation. Unofficial, alpha, not affiliated with Google.

Topics

Resources

Contributing

Security policy

Stars

140 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages