agentleFS
PederHPPederHP/image-gen-cli/AGENTS.md

image-gen-cli

AGENTS.md1 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 code style.

    Of the AGENTS.md files we read, the 35,337 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.

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
  1. Very specific:

    Create NewProviderImageClient.cs implementing IImageGenerationClient

    line 39
  2. Very specific:

    Add provider option to Program.cs switch statements (client instantiation, API key lookup, validation)

    line 40
  3. Very specific:

    Use image-gen --list-models -p poe to see available models.

    line 62
  4. Very specific:

    Use --list-models -p <provider> to see available models for each provider

    line 84

≈ “Common” is an estimate: at least 1 in 5 of the 45,344 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

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 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 - output with images array and optional text response
  • GeneratedImage - single image with mime type and byte data

Adding a new provider:

  1. Create NewProviderImageClient.cs implementing IImageGenerationClient
  2. Add provider option to Program.cs switch statements (client instantiation, API key lookup, validation)

Provider-Specific Constraints

Parameters validated at runtime - using unsupported options with a provider causes a hard error:

ParameterGeminiOpenAIBFLPoe
--system-promptSupportedErrorErrorError
--temperatureSupported (0.0-2.0)ErrorErrorError
--resolutionPro & 3.1 FlashGPT Image 2 and 2.5SupportedModel-dependent
--samples max4101010
--images maxN/AN/A8N/A

BFL Model Comparison:

  • flux-2-pro (default) - Fast (~10s), production-ready, $0.03/MP
  • flux-2-flex - Adjustable controls (steps, guidance), best typography, $0.06/MP
  • flux-2-max - Highest quality, web grounding, $0.07/MP
  • flux-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 provider
  • OPENAI_API_KEY - for OpenAI provider
  • BFL_API_KEY - for BFL (FLUX) provider
  • POE_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 imageSize parameter 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-preview is accepted as an alias for the stable gemini-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

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.