If you spend any time in Claude Code, you've probably hit this wall: you ask the agent for a hero image or an OG card, it writes the markup referencing the file, but then nothing happens because it's a text coding agent—not an image model. So you stop what you're doing, fire up a separate image generation tool, wait for results, download the asset, drag it into your repo, and try to pick up where you left off. That context switch is small, but it happens constantly, and it quietly dismantles the momentum that makes coding agents worth using in the first place.
The Fix: A CLI That Plays Nice With Agents
The solution is surprisingly simple—give Claude Code a command it can actually run. Masonry CLI brings image and video generation to your terminal across 50+ models, which means any coding agent with shell access can produce real assets mid-session without you ever leaving the workflow. No plugins, no special integrations, just a standard CLI tool that happens to slot perfectly into an agent's capabilities.
Getting Started
Installation is straightforward whether you prefer on-demand execution or want masonry available globally: npx @masonryai/cli for quick use, or npm install -g @masonryai/cli if you want persistent access. After installing, run masonry login which opens a browser link to authorize the CLI—credentials store locally so you're not passing API keys around on the command line.
The Two Core Commands
Image generation takes a prompt and saves a file: masonry image "neon cyberpunk street at night" defaults to Nano Banana 2 as the model. Video works identically with masonry video "ocean waves at golden hour" --model veo-3.1-generate-preview. You can pin specific models, set aspect ratios and dimensions, and choose output paths like --output hero.png. For animating existing images rather than generating from scratch, use the --image flag: masonry video --image ./bottle.png --model kling-v2-6-pro-i2v. Run masonry image models or masonry video models to see everything available, and masonry models params for supported dimensions and durations.
Making It Work in Claude Code
Here's where this really shines. Because masonry is just a regular shell command, you don't need any plugin or special setup. In a Claude Code session, you can describe what you want in plain language: "Generate a 16:9 hero image of a dark control room with glowing dashboards and save it to public/hero.png." The agent runs masonry image "..." --aspect 16:9 --output public/hero.png, the file lands in your repo, and it wires everything into the component in one pass. For more permanent integration, run masonry skill install which adds a Masonry skill to Claude Code so the agent already knows the commands and reaches for image or video generation on its own when tasks need visuals.
Why 50+ Models Actually Matters
Most image CLIs lock you into a single model. Masonry exposes a full catalog—Veo 3, FLUX, Imagen 4, GPT Image, Nano Banana, Kling, Seedance, and more—behind the same two commands. This matters because no single model excels at everything: one handles legible text in marketing mockups better, another nails photorealistic product lighting, and a third is faster for cheap iterations during exploration. Swapping is just a flag change, not learning a new tool or rebuilding your workflow.
Worth Knowing Before You Commit
A few honest caveats from the source material: this requires an account and credits since it's a hosted generation service, not unlimited free local inference. For typical developer use—a handful of assets per project—cost is negligible, but batch thousands of images and you'll want to check pricing first. Generation involves network calls so it won't be instant, and video especially takes longer than image. As with any AI-generated imagery for marketing or products, review before shipping, particularly anything containing text or real products.
Key Takeaways
- Context switching kills agent momentum—let the tool generate assets natively instead
- Masonry CLI gives you two commands (image/video) across 50+ models with no integration work
- Claude Code can run these commands directly in a session via plain language requests
- The
masonry skill installcommand makes this integration permanent and automatic
The Bottom Line
Claude Code is a powerful coding agent that simply can't generate images on its own. Masonry CLI fills that gap elegantly—two simple commands, no plugins needed, assets produced alongside code in the same terminal session. If you've ever broken your flow to hand-craft an image, this workflow removes that friction entirely and lets you stay in the zone where agents actually save time.