Install
openclaw skills install auto-free-bananaClawHub Security found sensitive or high-impact capabilities. Review the scan results before using.
Generates images in Google Flow (labs.google/fx) through browser UI automation. Supports Nano Banana 2 and Nano Banana Pro with landscape/portrait aspect ratios. Use when the user requests Flow-based image generation.
openclaw skills install auto-free-bananaGenerate images in Google Flow through Chrome CDP + browser UI automation.
Important constraints:
Resolve:
{baseDir} = directory containing this SKILL.md{baseDir}/scripts/main.ts${BUN_X} = bun if installed, else npx -y bunBefore first use, verify user consent for reverse-engineered API usage.
Consent file locations:
~/Library/Application Support/baoyu-skills/flow-web/consent.json~/.local/share/baoyu-skills/flow-web/consent.json%APPDATA%\baoyu-skills\flow-web\consent.jsonFlow:
accepted: true and disclaimerVersion: "1.0"acceptedAt date, proceedAskUserQuestion:
{"version":1,"accepted":true,"acceptedAt":"<ISO>","disclaimerVersion":"1.0"}Check EXTEND.md existence (priority order):
test -f .baoyu-skills/auto-free-banana/EXTEND.md && echo "project"
test -f "${XDG_CONFIG_HOME:-$HOME/.config}/baoyu-skills/auto-free-banana/EXTEND.md" && echo "xdg"
test -f "$HOME/.baoyu-skills/auto-free-banana/EXTEND.md" && echo "user"
EXTEND.md Supports: Default model | Default aspect ratio | Custom data directory
Before any pre-flight check or main.ts invocation, decide one shell environment and reuse it for every command in the run.
PATHIf you set any of these once, keep them identical for all later commands in the turn:
PATHFLOW_WEB_PROXYHTTPS_PROXY / HTTP_PROXYAGENT_BROWSER_CHROME_PROXY_SERVERFLOW_WEB_DEBUG_PORT / AGENT_BROWSER_CDP_PORTFLOW_WEB_COOKIE_PATHFLOW_WEB_CHROME_PROFILE_DIRAGENT_BROWSER_USER_DATA_DIR_WINAGENT_BROWSER_CMD_EXE_WSLNever run pre-flight checks in one environment and main.ts in another.
Preferred proxy setup:
export FLOW_WEB_PROXY=http://host:port
export HTTPS_PROXY="$FLOW_WEB_PROXY"
export HTTP_PROXY="$FLOW_WEB_PROXY"
export AGENT_BROWSER_CHROME_PROXY_SERVER="$FLOW_WEB_PROXY"
Before running any generation command, complete the Pre-flight Checks below.
# Default generation: creates a NEW Flow project through the UI
${BUN_X} {baseDir}/scripts/main.ts --prompt "A cute cat"
# Specify model + portrait + 2 images
${BUN_X} {baseDir}/scripts/main.ts --prompt "A sunset" --model NANO_BANANA_PRO --aspect 9:16 --count 2
# Reuse an EXISTING Flow project only when you already have the project id
${BUN_X} {baseDir}/scripts/main.ts --project-id <project-id> --prompt "A sunset"
# Authentication only
${BUN_X} {baseDir}/scripts/main.ts --login
# Batch mode: multiple prompts in one project (5s interval)
${BUN_X} {baseDir}/scripts/main.ts --prompt "A cute cat" --prompt "A sunset" --prompt "A mountain landscape"
Batch mode rules:
--prompt--project-id is suppliedmain.ts commands for a multi-prompt batchRun these checks in order. Each step must pass before moving to the next.
Check the Bun runtime and Python:
command -v bun >/dev/null && echo "BUN" || command -v npx >/dev/null && echo "NPX_BUN" || echo "MISSING"
command -v python3 >/dev/null && echo "OK" || echo "MISSING"
If any required command is missing, stop.
If running under WSL, also verify the Windows bridge and Chrome path assumptions:
test -x /mnt/c/Windows/System32/cmd.exe && echo "OK" || echo "MISSING"
test -f "/mnt/c/Program Files/Google/Chrome/Application/chrome.exe" && echo "OK" || echo "MISSING"
If not running under WSL, ensure FLOW_WEB_CHROME_PATH is set before continuing.
Check if the Chrome debug user data directory exists. Default WSL-visible path:
/mnt/c/chrome-debug-openclawAGENT_BROWSER_USER_DATA_DIR_WINtest -d /mnt/c/chrome-debug-openclaw && echo "EXISTS" || echo "NEW"
EXISTS → proceedNEW → proceed, but tell the user a fresh browser profile will be createdTest Google reachability using the same environment you will use for main.ts:
curl -sS --connect-timeout 5 -o /dev/null -w '%{http_code}' https://labs.google/fx/ 2>/dev/null || echo "FAIL"
200/301/302 → proceedFAIL / timeout → stop and fix proxy settings firstDo not continue into main.ts while shell networking and browser proxy settings disagree.
Check if cached credentials exist:
Linux default cookie file:
~/.local/share/baoyu-skills/flow-web/cookies.jsontest -f ~/.local/share/baoyu-skills/flow-web/cookies.json && echo "EXISTS" || echo "NONE"
EXISTS → proceedNONE → run:
${BUN_X} {baseDir}/scripts/main.ts --login --verbose
Then wait for the user to finish Google login in the browser.The skill supports exactly two generation entry modes:
--project-id; the script creates a project through the Flow UI--project-idDo not invent any third path.
Explicitly forbidden:
If automatic UI project creation fails:
新建项目 in the browser, capture the resulting project id from the URL, then rerun main.ts with --project-id <id>The fallback is still UI-only.
main.ts only automates the UI. It fills the prompt, clicks Create, then exits immediately. Actual image generation continues asynchronously in the browser.
After main.ts exits with code 0:
Important completion rule:
If the script exits with a non-zero code, report the error and stop.
| Option | Description |
|---|---|
--prompt, -p | Prompt text (repeat for batch mode) |
--model, -m | Model ID (see Models table) |
--aspect, -a | Aspect ratio: 16:9 (default), 9:16 |
--count | Number of images: 1-4 (default: 2) |
--project-id | Reuse existing project |
--verbose | Enable debug logging |
--login | Authenticate and save cookies, then exit |
--cookie-path | Custom cookie file path |
--profile-dir | Chrome profile directory |
| Model | Description |
|---|---|
NARWHAL | Nano Banana 2 (default, fast) |
NANO_BANANA_PRO | Nano Banana Pro |
If /home/admin1/.openclaw/workspace/scripts/agent-browser-cdp.sh exists, it is a convenient helper for screenshots and browser inspection after generation:
bash /home/admin1/.openclaw/workspace/scripts/agent-browser-cdp.sh --full screenshot /tmp/flow.png
bash /home/admin1/.openclaw/workspace/scripts/agent-browser-cdp.sh snapshot -c
This helper is optional. Generation must not depend on agent-browser being installed.
| Variable | Description |
|---|---|
FLOW_WEB_PROXY | Preferred proxy for shell/API requests |
HTTPS_PROXY / HTTP_PROXY | Standard proxy env vars |
FLOW_WEB_DATA_DIR | Data directory |
FLOW_WEB_COOKIE_PATH | Cookie file path |
FLOW_WEB_CHROME_PROFILE_DIR | Local Chrome user data dir when not on WSL |
FLOW_WEB_CHROME_PATH | Chrome executable path for non-WSL environments |
FLOW_WEB_DEBUG_PORT | Fixed Chrome debug port |
FLOW_WEB_CHROME_EXE_WIN | Windows Chrome path override when running from WSL |
FLOW_WEB_CHROME_USER_DATA_DIR_WIN | Windows Chrome user data dir override when running from WSL |
FLOW_WEB_CHROME_EXTRA_ARGS | Extra Chrome args |
AGENT_BROWSER_CHROME_PROXY_SERVER | Browser proxy used by host Chrome |
AGENT_BROWSER_USER_DATA_DIR_WIN | Windows-side Chrome debug profile override |
AGENT_BROWSER_CMD_EXE_WSL | WSL path to cmd.exe |
BAOYU_CHROME_PROFILE_DIR | Shared Chrome profile override |