gemini-image

gemini-image is a command for coding agents from gopherguides/gopher-ai. It costs 6 tokens per session (1,978 once invoked), scanned A, original, MIT.

An image-generation command that uses Google Gemini, an AI service, to create or edit pictures from a text description.

In plain words
What is it for?
Use it for illustrations, logos, blog artwork, landscapes, and edits based on a reference image. It requires a Gemini API key and Python 3.
Why use it?
It removes the need to switch to a separate image tool for simple generated artwork. It also gives a clear prompt format for creating or redesigning an image.

Command

Installs and runs on its own, but its text points at files inside its plugin — anything it tells you to read at a ${CLAUDE_PLUGIN_ROOT} path is only there once the plugin is installed. Installing the plugin gets both.

Part of the llm-tools plugin — 2 skills, 7 commands shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/gopherguides/gopher-ai/gemini-image
Clone the repo
git clone --depth 1 https://github.com/gopherguides/gopher-ai

Or install llm-tools, the plugin that ships this one along with the rest of its 2 skills, 7 commands.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for gemini-image

README.md
[![agentmods](https://agentmods.dev/badge/commands/gopherguides/gopher-ai/gemini-image.svg)](https://agentmods.dev/commands/gopherguides/gopher-ai/gemini-image)
Your own site
<a href="https://agentmods.dev/commands/gopherguides/gopher-ai/gemini-image"><img src="https://agentmods.dev/badge/commands/gopherguides/gopher-ai/gemini-image.svg" alt="Measured on agentmods" height="20"></a>
Per session 6 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,978 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00006 $0.01978
Opus 5 $0.00003 $0.00989
Sonnet 5 $0.00001 $0.00396
Haiku 4.5 $0.00001 $0.00198

Measured 4d ago against content hash 891c18bdbfa0, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

gemini-image scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

allowed-tools: ["Bash(curl:*)", "Bash(python3:*)", "Bash(echo:*)", "Bash(export:*)", "Bash(which:*)", "Bash(cat:*)", "Bash(rm:*)", "Read", "AskUserQuestion"]
plugins/llm-tools/commands/gemini-image.md · 162 lines

How it starts

The opening of the file, as written. The whole thing — 162 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Generate Image with Gemini

If $ARGUMENTS is empty or not provided:

This command generates images using the Google Gemini API.

Usage: /gemini-image <description of image to generate>

Examples:

Command Description
/gemini-image a serene mountain landscape at sunset Nature scene
/gemini-image minimalist logo for a coffee shop called "Bean There" Logo design
/gemini-image hero image for a Go programming blog post Blog artwork
/gemini-image redesign this logo (with reference image) Edit existing image

Ask the user: "What image would you like to generate?"


If $ARGUMENTS is provided:

Generate an image using the Gemini API with the prompt: $ARGUMENTS.

1. Check Prerequisites

echo "GEMINI_API_KEY set: $([ -n "$GEMINI_API_KEY" ] && echo 'yes' || echo 'no')"
which python3

If GEMINI_API_KEY is not set:

GEMINI_API_KEY is not set. Get one free at https://aistudio.google.com/apikey Then export it: export GEMINI_API_KEY="your-key-here"

Stop and wait for the user to set the key. If python3 is missing, inform the user it's required.

Note: The Gemini CLI's Nano Banana extension was investigated as an alternative path, but it has a known MCP tool registration bug (Gemini CLI v0.34.0 / Nano Banana v1.0.12). The REST API is the only reliable path right now.

2. Parse --tier flag

Detect, validate, and strip --tier <value>:

HAS_TIER=$(echo "$ARGUMENTS" | grep -q '\-\-tier' && echo "true" || echo "false")
TIER_RAW=$(echo "$ARGUMENTS" | grep -oE '\-\-tier  *[^ ]+' | awk '{print $2}')
TIER_VALID=$(echo "$TIER_RAW" | grep -qiE '^(flex|standard|priority)$' && echo "true" || echo "false")
CLEAN_ARGS=$(echo "$ARGUMENTS" | sed 's/--tier  *[^ ]*//g' | sed 's/^  *//;s/  *$//')

IMPORTANT: Use CLEAN_ARGS (not $ARGUMENTS) as the image prompt from this point forward. The --tier flag text must not leak into GEMINI_PROMPT.

If HAS_TIER=true AND TIER_VALID=true → lowercase TIER_RAW to flex/standard/priority. If HAS_TIER=true AND TIER_VALID=false → warn the user; ask them to choose flex/standard/priority. If HAS_TIER=false → continue with standard service. Do not prompt for a tier.

Read the full file on GitHub · 162 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 162 lines · 6 tokens per session scan A 891c18bdbfa0

Subscribe to this mod's changes

gemini-image is a command published in the GitHub repository gopherguides/gopher-ai (21 stars, last pushed today), licensed MIT. It adds 6 tokens to every session and 1,978 once invoked, about $0.0000 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.