cm-imagegen

Generate or edit raster images via CodexManager's Images API.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/BoChao1Zhang/dotfiles --skill cm-imagegen
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cm-imagegen
Source: https://github.com/BoChao1Zhang/dotfiles/tree/main/dot_codex/skills/cm-imagegen
Command: npx skills add https://github.com/BoChao1Zhang/dotfiles --skill cm-imagegen

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

Generate or edit raster images for projects using CodexManager's Images API, leveraging the current provider base_url and OPENAI_API_KEY instead of the built-in image_gen tool.

Core Features & Use Cases

  • Generate or edit images (e.g., website assets, UI mocks, logos, infographics) through CodexManager's Images API.
  • CLI-driven workflow with two subcommands, generate and edit, powered by scripts/cm_image_gen.py.
  • Respect provider config and output conventions: use CODEX_HOME/config.toml to locate the provider base_url, and CODEXMANAGER_IMAGE_OUTPUT_DIR for output directories; saves results under generated-images by default.

Quick Start

Run the CLI to generate images by providing a prompt, e.g., python ./scripts/cm_image_gen.py generate --prompt 'A minimal hero image'.

Frequently Asked Questions about cm-imagegen

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate images using the OpenAI Images API through CodexManager?

To generate images via CodexManager, run the CLI script cm_image_gen.py with the generate subcommand and a prompt. It uses your OPENAI_API_KEY from auth.json and routes requests to the /images/generations endpoint based on your provider base_url.

Can I edit existing images and apply masks with the CodexManager API?

Yes, you can edit existing raster images using the edit subcommand. The script calls the /images/edits endpoint, allowing you to submit original images, masks, and prompts with optional quality and size parameters to modify visuals.

What environment variables and configuration do I need to run the image generation script?

You need CODEX_HOME/auth.json for your OPENAI_API_KEY and config.toml for the provider base_url. You can also set CODEXMANAGER_IMAGE_BASE_URL and CODEXMANAGER_IMAGE_OUTPUT_DIR to override the API endpoint and output directory.

What's the best way to create UI mocks and website assets from the command line?

Use a CLI-driven image generation workflow to create UI mocks and website assets. Provide a descriptive text prompt to the generate command, and the script saves the resulting raster images under the generated-images directory by default.

Does this image generation CLI tool use the built-in image_gen tool?

No, it does not use the built-in image_gen tool. It explicitly routes image generation and editing tasks through the CodexManager Images API, leveraging your current provider configuration and API key instead.