If you've ever needed to generate a blog cover image programmatically, you know the pain—fiddling with Canva APIs, manually fetching logos, hoping the AI doesn't spell your title wrong. A new npm package called blog-cover-image-cli solves this end-to-end, and it's built with AI agents in mind from the start.

The Tool

The CLI uses Gemini 3.1 Flash Image Preview for full AI generation, but the real magic is in the pipeline. Pass a title like "Why Cursor is the Ultimate AI Code Editor" and a domain like cursor.com, and it automatically fetches the logo via Brandfetch, normalizes it to PNG using sharp, injects it into the AI context, and renders a clean 16:9 cover with heavy typography on a white background. All from one terminal command.

OpenCode Skill Included

What makes this relevant for the ClawdBytes crowd is the included OpenCode skill. The package ships with agent-skill/blog-cover-generator/SKILL.md, meaning Claude Code, OpenClaw, or any other AI agent can install the CLI, configure its Gemini API key via npx, and autonomously generate cover images on demand. The workflow is dead simple: set the key, run generate with -t and -l flags, get back a PNG. No human in the loop required.

Self-Healing QA Loop

The most underrated feature here is the built-in critic loop. After generation, the CLI uses Gemini Pro Vision to OCR the image and validate against the original title—checking for typos, layout issues, missing elements. If validation fails, it retries up to 3 times with corrective feedback passed back to the generator. This catches the most common AI image generation failure mode (misspelled words in typography) before you ever see the file.

Configuration Requirements

You'll need two API keys: a Gemini API key for image generation and a Brandfetch client ID for logo fetching. The CLI stores these securely using the conf package, so you set them once with blog-cover-cli config set-key and blog-cover-cli config set-brandfetch-id. Node.js v18+ required.

Key Takeaways

  • Generates 16:9 blog covers from title + domain in one command
  • Includes OpenCode skill for autonomous agent usage
  • Self-healing validation loop catches typos via Gemini Pro Vision
  • Bundled aesthetic examples guide toward minimalist, heavy-typography style
  • GitHub Actions workflow included for automated NPM publishing

The Bottom Line

This is exactly the kind of infrastructure tool that makes AI agents actually useful in real workflows. Instead of manually creating thumbnails or wrestling with image generation APIs, your coding assistant can now ship you a polished blog cover as part of its output. The self-healing aspect is the differentiator—most CLI tools stop at generation; this one validates its work. If you're building content pipelines with AI agents, this belongs in your stack.