image-gen-cli
AGENTS.md2 starsChanged 11 months agoMITView on GitHub
Multi-provider image generation CLI using .NET 10 and System.CommandLine. Provider Pattern: - IImageGenerationClient - common interface for all providers - GeminiImageClient - Google Gemini API (gemini-3.1-flash-image, gemini-3.1-flash-lite-image, gemini-3-pro-image, gemini-2.5-flash-image) - OpenAIImageClient - OpenAI API (gpt-image-2.5-flare, gpt-image-2.5-sunburst, gpt-image-2, gpt-image-1.5, gpt-image-1, gpt-image-1-mini) - BflImageClient - Black Forest Labs FLUX API (flux-2-pro, flux-2-flex, flux-2-max, flux-2-klein-4b, flux-2-klein-9b) - PoeImageClient - Poe.com API (unified access to many models) Models (in Models/): - GenerationRequest - provider-agnostic input (prompt, reference images, aspect ratio, etc.) - GenerationResult -…
- Reads credentials
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository3 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- image-genSkill
The file
We split this AGENTS.md into the rules it gives an agent
4 rules. About 0 are common, 0 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 39
Create NewProviderImageClient.cs implementing IImageGenerationClient
- Very specific: line 40
Add provider option to Program.cs switch statements (client instantiation, API key lookup, validation)
- Very specific: line 62
Use image-gen --list-models -p poe to see available models.
- Very specific: line 84
Use --list-models -p <provider> to see available models for each provider
≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Quick Start
# Build
dotnet build src/ImageGenCli.csproj
# Run directly (development)
dotnet run --project src/ImageGenCli.csproj -- "Your prompt here"
# Install as global tool (recommended)
dotnet pack src/ImageGenCli.csproj -c Release -o ./nupkg
dotnet tool install --global --add-source ./nupkg ImageGenCli
# Then use anywhere
image-gen "Your prompt here"Architecture
Multi-provider image generation CLI using .NET 10 and System.CommandLine.
Provider Pattern:
IImageGenerationClient- common interface for all providersGeminiImageClient- Google Gemini API (gemini-3.1-flash-image, gemini-3.1-flash-lite-image, gemini-3-pro-image, gemini-2.5-flash-image)OpenAIImageClient- OpenAI API (gpt-image-2.5-flare, gpt-image-2.5-sunburst, gpt-image-2, gpt-image-1.5, gpt-image-1, gpt-image-1-mini)BflImageClient- Black Forest Labs FLUX API (flux-2-pro, flux-2-flex, flux-2-max, flux-2-klein-4b, flux-2-klein-9b)PoeImageClient- Poe.com API (unified access to many models)
Models (in Models/):
GenerationRequest- provider-agnostic input (prompt, reference images, aspect ratio, etc.)GenerationResult- output with images array and optional text responseGeneratedImage- single image with mime type and byte data
Adding a new provider:
- Create
NewProviderImageClient.csimplementingIImageGenerationClient - Add provider option to
Program.csswitch statements (client instantiation, API key lookup, validation)
Provider-Specific Constraints
Parameters validated at runtime - using unsupported options with a provider causes a hard error:
| Parameter | Gemini | OpenAI | BFL | Poe |
--system-prompt | Supported | Error | Error | Error |
--temperature | Supported (0.0-2.0) | Error | Error | Error |
--resolution | Pro & 3.1 Flash | GPT Image 2 and 2.5 | Supported | Model-dependent |
--samples max | 4 | 10 | 10 | 10 |
--images max | N/A | N/A | 8 | N/A |
BFL Model Comparison:
flux-2-pro(default) - Fast (~10s), production-ready, $0.03/MPflux-2-flex- Adjustable controls (steps, guidance), best typography, $0.06/MPflux-2-max- Highest quality, web grounding, $0.07/MPflux-2-klein-9b/flux-2-klein-4b- Lightweight open-weight models, sub-second inference
Poe Model Access:
Poe provides unified access to many image models (OpenAI, FLUX, Imagen, etc.) via single API.
Use image-gen --list-models -p poe to see available models. Model names are case-sensitive.
Environment Variables
GEMINI_API_KEY- for Gemini providerOPENAI_API_KEY- for OpenAI providerBFL_API_KEY- for BFL (FLUX) providerPOE_API_KEY- for Poe provider
Agent Skill
This project includes an Agent Skill definition in image-gen/SKILL.md for AI agent integration. The skill provides structured instructions for agents to use the CLI effectively.
Notes
.tmp/directory is gitignored and can be used for test outputs- Gemini's
imageSizeparameter works with Pro models and gemini-3.1-flash-image; gemini-2.5-flash-image and gemini-3.1-flash-lite-image are 1K-only gemini-3-pro-image-previewis accepted as an alias for the stablegemini-3-pro-image- OpenAI maps aspect ratios to fixed pixel dimensions; GPT Image 2 and 2.5 support
--resolution(WxH or aspect ratio) - BFL uses async API with polling; dimensions must be multiples of 16
- BFL doesn't support batch generation; multiple samples are generated sequentially
- Poe returns images as markdown URLs in response content; client parses and downloads
- Use
--list-models -p <provider>to see available models for each provider
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

