Skip to content

feat: add catalog-linked image generation CLI (gpt-image-2) - #22

Open
tecnos-okazaki wants to merge 9 commits into
YouMind-OpenLab:mainfrom
tecnos-okazaki:feature/catalog-image-generation-cli
Open

feat: add catalog-linked image generation CLI (gpt-image-2)#22
tecnos-okazaki wants to merge 9 commits into
YouMind-OpenLab:mainfrom
tecnos-okazaki:feature/catalog-image-generation-cli

Conversation

@tecnos-okazaki

Copy link
Copy Markdown

Summary

Adds a CLI (pnpm run image) that generates images with OpenAI gpt-image-2
from prompts sourced three ways:

  • --prompt "<text>" — free text (no CMS)
  • --no <n> — a prompt parsed from the local README by its "No." heading (no CMS)
  • --id <id> — a prompt fetched live from the CMS (needs CMS_HOST / CMS_API_KEY)

Plus --readme-list / --list for discovery. Images are written to output/
(git-ignored). Prompts flagged needReferenceImages are skipped with a warning
(v1 is text-to-image only).

Changes

  • scripts/generate-image.ts — CLI entry point + arg routing
  • scripts/utils/image-generator.ts — thin openai.images.generate wrapper (base64 → Buffer)
  • scripts/utils/prompt-preparer.ts (+ tests) — pure helpers: clean content, {argument} detect/substitute, slug/filename
  • scripts/utils/readme-parser.ts (+ tests) — parse prompts from a generated README
  • scripts/utils/cms-client.ts — add fetchPromptById
  • package.jsonimage + test scripts, openai dependency
  • .gitignore — ignore output/
  • docs — LOCAL_DEVELOPMENT.md usage + design spec/plan under docs/superpowers/

Testing

  • pnpm test — 11/11 unit tests pass
  • Verified end-to-end against gpt-image-2: --prompt and --no 5 each produced a valid 1024×1024 PNG.

Notes

  • Model is fixed to gpt-image-2.
  • Design spec: docs/superpowers/specs/2026-07-16-catalog-image-generation-cli-design.md

🤖 Generated with Claude Code

https://claude.ai/code/session_0195oxt5sg7RGriWmxL1Hw3L

tecnos-okazaki and others added 9 commits July 16, 2026 14:00
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0195oxt5sg7RGriWmxL1Hw3L
Entire-Checkpoint: bc6beffd465b
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0195oxt5sg7RGriWmxL1Hw3L
Entire-Checkpoint: 75275998c8b5
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0195oxt5sg7RGriWmxL1Hw3L
Entire-Checkpoint: fa673b6da681
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0195oxt5sg7RGriWmxL1Hw3L
Entire-Checkpoint: 10487a1b2f95
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0195oxt5sg7RGriWmxL1Hw3L
Entire-Checkpoint: bc0e91665aad
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0195oxt5sg7RGriWmxL1Hw3L
Entire-Checkpoint: e6aec3138771
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0195oxt5sg7RGriWmxL1Hw3L
Entire-Checkpoint: 6381064bbcac
Adds CMS-free generation: --prompt for arbitrary text and --no for a
README No.<n> prompt, plus --readme-list. Keeps the CMS --id/--list paths.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0195oxt5sg7RGriWmxL1Hw3L
Entire-Checkpoint: f33191d4f6fa
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0195oxt5sg7RGriWmxL1Hw3L
Entire-Checkpoint: e6a99cf5416d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant