imgcmd
Secure CLI that generates real PNGs to disk — no broken SVGs from agents
imgcmd is an open-source CLI that solves a specific but infuriating problem: when you ask IDE agents like Cursor or Copilot to generate an image, they hallucinate thousands of lines of broken SVG or corrupted Base64 strings. imgcmd instead routes the request directly to Gemini and writes a real PNG straight to disk with one command. The tool is designed to be taught to your AI editor natively. Run `imgcmd --create-rule cursor` and your Cursor installation learns to call imgcmd instead of trying to write image code. API keys never leave your machine. The `IMGCMD_FORCE_MODEL` env var lets you lock down which Gemini model is used globally — preventing surprise API bills when an agent decides to upgrade itself to a more expensive model. Free and open source, maintained by the team at Smoonb. This is indie-builder territory: a small, sharp tool that does one thing well. It won't win awards for ambition but it will stop you losing hours to broken Base64 blobs.
Panel Reviews
“The --create-rule flag that teaches your IDE to use it natively is the whole product. That's clever distribution — once it's in the Cursor rules, it just works forever. Small tool, real problem solved.”
“This is a workaround for a problem that Cursor and Codex will solve natively within months. Building an image generation workflow on top of a CLI wrapper for Gemini is fragile — one API change and it breaks. Not worth the dependency.”
“The pattern of small, composable CLI tools that slot into agentic workflows is how UNIX was built. imgcmd is doing for image generation what curl did for HTTP. The model governance flag is prescient.”
“I have absolutely lost hours to agents generating garbage SVG. A one-command solution that writes a real PNG to disk? Yes please. Free, open source, and solves my exact pain point.”
Community Sentiment
“This is the kind of sharp single-purpose tool I love”
“The broken SVG problem is real — this is a good fix”
“imgcmd --create-rule cursor is a genius distribution hack”