A new npm package called blog-cover-image-cli is bringing AI-powered cover image generation directly into the workflow of Claude Code and OpenClaw agents. The tool, surfaced on Hacker News, generates minimalist 16:9 blog thumbnails using Gemini 3.1 Flash Image Preview and includes a dedicated OpenCode SKILL.md that lets AI agents invoke it autonomously.

OpenCode Skill Integration

The package includes a structured skill definition at agent-skill/blog-cover-generator/SKILL.md, enabling AI agents to generate cover images without human intervention. Agents execute two commands: first setting the Gemini API key via npx -p blog-cover-image-cli blog-cover-cli config set-key $KEY, then running the generate command with title and domain flags like blog-cover-cli generate -t "Your Title" -l "domain.com". The agent then returns the generated PNG to the user.

Self-Healing QA Pipeline

What sets this CLI apart is its built-in validation loop. After generating an image using Gemini 3.1 Flash, the tool uses Gemini Pro Vision to OCR the output and check for typos, layout issues, or missing elements. If validation fails, it automatically retries up to 3 times with corrective feedback passed back to the generator. This addresses a common pain point in AI image generationβ€”misspelled words in typography.

Smart Logo Fetching and Grounding

The CLI handles logo integration by fetching company logos via Brandfetch, converting them to PNG using sharp, and injecting them into the AI context. For titles involving current events, it hooks into Google Search to pull real-time grounding data. The examples/ folder bundles aesthetic guidance that steers the model toward clean, white-background, heavy-typography styles.

Key Takeaways

  • Requires Node.js v18+ and Gemini API key for image generation
  • Brandfetch integration needs separate client ID for logo fetching
  • Output defaults to ./output/ directory with auto-named files
  • Includes GitHub Actions workflow for automated NPM publishing on releases