Monoagent image

From monoes/monomind · View interactive version

Monoagent image is an AI agent skill from the GitHub repository monoes/monomind. Generate images via Gemini's browser session using the monoagentcli tool, always scoped to the "monoes" profile — no API key, no billing, browser-automated.

How to use this skill

Skill file

Monoagent Image Generation (Gemini browser crawl)

Engine: monoagentcli node run gemini.generate_image — opens gemini.google.com in a real

browser session (no API key, no billing) and downloads the resulting image to disk.

Profile rule — no exceptions: every invocation MUST pass --profile monoes. Gemini is

already logged in under that profile (monoagentcli --profile monoes login status shows

gemini as active). Never omit --profile and never use another profile for this skill —

sessions, credentials, and downloads are fully profile-scoped, and running without

--profile monoes either hits the wrong (or no) saved session or writes into the wrong

profile's data.


One-time setup (only if `login status` shows `gemini` missing or expired)

monoagentcli --profile monoes login status
# if gemini is not "active":
monoagentcli --profile monoes login gemini
# log in by hand in the browser window that opens, then:
monoagentcli --profile monoes login confirm gemini

Generate an image from a text prompt

monoagentcli --profile monoes node run gemini.generate_image \
  --headless \
  --output json \
  --config '{"prompt":"<short English prompt, under 100 chars>","maxWaitSeconds":120,"downloadDir":"<absolute output dir>"}'

trigger Gemini's "Nano Banana 2" reasoning model, which cannot generate images — it will

silently fail to produce one.

for the task at hand so the caller knows exactly where the file landed.

image_count. Read images[0].path for the file location — do not assume a fixed filename.

Generate a styled/derivative image from a reference image

monoagentcli --profile monoes node run gemini.generate_image \
  --headless \
  --output json \
  --config '{"prompt":"recreate this in a watercolor painting style","referenceImagePath":"/abs/path/to/reference.jpg","maxWaitSeconds":120,"downloadDir":"<absolute output dir>"}'

referenceImagePath uploads the local image to Gemini before the prompt is sent — use this for

"something like this image but different style" requests. Put the actual style/variation request

in prompt.


Operating notes (learned from live testing)

(2026-07-20): when the CLI logs extension server error: address already in use and falls

back to a standalone Chromium with restored cookies, the run silently fails — it returns a

single leftover action-trace object ({"reason":"empty image path","skipped":true,...}) instead

of images/image_count, and no file is written to downloadDir. This happened twice in a

row, including with a freshly re-logged-in Gemini session, so it is not a stale-session issue.

The fix that made it work: ensure the MonoAgent extension server actually has a live connection

to a Chrome instance on 127.0.0.1:9222 before running — check with lsof -i :9222, expect to

see the monoagent listener AND an ESTABLISHED connection to a Google/Chrome process, not

just the bare listener. A successful run logs Reusing existing extension connection instead of

the address already in use error.

don't retry blind — first check lsof -i :9222 for that established Chrome connection, fix the

extension connection, then retry once.

the browser interact with Gemini directly (debugging a stuck prompt).

CLI's exit code alone; check the JSON payload for images/image_count.


Full reference

For any flag or edge case not covered here:

monoagentcli ref node gemini.generate_image
monoagentcli node run --help
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.