<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Gaurav Bisen</title>
    <description>The latest articles on DEV Community by Gaurav Bisen (@gauravsinghbisen).</description>
    <link>https://dev.to/gauravsinghbisen</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3964368%2Ffbbe57f3-a942-41d2-a89a-74ca85cd3eba.png</url>
      <title>DEV Community: Gaurav Bisen</title>
      <link>https://dev.to/gauravsinghbisen</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/gauravsinghbisen"/>
    <language>en</language>
    <item>
      <title>How to Generate Images and Video in Claude Code (Without Leaving the Terminal)</title>
      <dc:creator>Gaurav Bisen</dc:creator>
      <pubDate>Tue, 02 Jun 2026 11:02:32 +0000</pubDate>
      <link>https://dev.to/gauravsinghbisen/how-to-generate-images-and-video-in-claude-code-without-leaving-the-terminal-2c3b</link>
      <guid>https://dev.to/gauravsinghbisen/how-to-generate-images-and-video-in-claude-code-without-leaving-the-terminal-2c3b</guid>
      <description>&lt;p&gt;If you live in Claude Code, you've hit this: you ask for a hero image, an OG card, or a placeholder asset, and the agent writes the markup that references the file but can't create the file. It's a text coding agent, not an image model. So you stop, open a separate image tool, generate something, download it, drag it into your repo, and pick up where you left off. That context switch is small but it happens constantly, and it pulls you out of the flow that made the agent useful in the first place.&lt;/p&gt;

&lt;p&gt;The fix is to give the agent a command it can run itself. The &lt;a href="https://masonry.so/cli" rel="noopener noreferrer"&gt;Masonry CLI&lt;/a&gt; generates images and video from the terminal across 50+ models, which means Claude Code (or any coding agent that can run shell commands) can produce a real asset mid-session and keep going. Here is the whole setup.&lt;/p&gt;

&lt;h2&gt;
  
  
  Quick answer
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx @masonryai/cli              &lt;span class="c"&gt;# install&lt;/span&gt;
masonry login                   &lt;span class="c"&gt;# connect your account (opens a link)&lt;/span&gt;
masonry image &lt;span class="s2"&gt;"a minimalist mountain logo, flat vector"&lt;/span&gt; &lt;span class="nt"&gt;--output&lt;/span&gt; logo.png
masonry video &lt;span class="s2"&gt;"slow dolly over a misty forest at dawn"&lt;/span&gt; &lt;span class="nt"&gt;--aspect&lt;/span&gt; 16:9
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That is the core of it. Two commands, &lt;code&gt;masonry image&lt;/code&gt; and &lt;code&gt;masonry video&lt;/code&gt;, plus flags for the model, aspect ratio, and output path. Everything below is detail and the agent workflow.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why run image generation from the terminal
&lt;/h2&gt;

&lt;p&gt;A web UI is great for browsing and exploring. A CLI is better the moment generation becomes part of a repeatable workflow, because a command can be copied, edited, scripted, and version controlled. For developers that shows up in obvious places: generating a cover image while you write the blog post, filling a UI with realistic placeholder assets instead of gray boxes, batching OG images for a set of pages, or producing a quick product video for a landing section.&lt;/p&gt;

&lt;p&gt;The bigger shift is the agent angle. When the tool is a shell command, an agent that already has shell access can call it without any special integration. You ask Claude Code to build a feature, it scaffolds the page, and when it needs a hero image it runs &lt;code&gt;masonry image&lt;/code&gt; and references the result, all in one pass. No tab switch, no copy paste, no breaking the agent's momentum.&lt;/p&gt;

&lt;h2&gt;
  
  
  Install and connect
&lt;/h2&gt;

&lt;p&gt;Install and run it with npx, or install it globally:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx @masonryai/clinpm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-g&lt;/span&gt; @masonryai/cli   &lt;span class="c"&gt;# or install globally for a persistent `masonry` command&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then connect your Masonry account. &lt;code&gt;masonry login&lt;/code&gt; opens a link in your browser to authorize the CLI, and after that the credentials are stored locally so you do not pass keys around on the command line.&lt;/p&gt;

&lt;h2&gt;
  
  
  The two commands
&lt;/h2&gt;

&lt;p&gt;Image generation takes a prompt and saves a file. With no &lt;code&gt;--model&lt;/code&gt;, it defaults to Nano Banana 2:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;masonry image &lt;span class="s2"&gt;"neon cyberpunk street at night"&lt;/span&gt;
&lt;span class="c"&gt;# Using model: Nano Banana 2 (the default)&lt;/span&gt;
&lt;span class="c"&gt;# Saved to cyberpunk-street.png&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Video works the same way (here pinning Veo 3.1 with --model):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;masonry video &lt;span class="s2"&gt;"ocean waves at golden hour"&lt;/span&gt; &lt;span class="nt"&gt;--model&lt;/span&gt; veo-3.1-generate-preview
&lt;span class="c"&gt;# Using model: veo-3.1-generate-preview&lt;/span&gt;
&lt;span class="c"&gt;# Saved to ocean-waves.mp4&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can pin a specific model, set the aspect ratio and dimensions, and choose the output path:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;masonry image &lt;span class="s2"&gt;"studio product shot of a frosted glass bottle"&lt;/span&gt; &lt;span class="nt"&gt;--model&lt;/span&gt; flux-2-pro &lt;span class="nt"&gt;--aspect&lt;/span&gt; 1:1 &lt;span class="nt"&gt;--output&lt;/span&gt; bottle.png
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And you can animate an existing image instead of starting from text, which turns a static render into a short motion clip:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;masonry video &lt;span class="nt"&gt;--image&lt;/span&gt; ./bottle.png &lt;span class="nt"&gt;--model&lt;/span&gt; kling-v2-6-pro-i2v
&lt;span class="c"&gt;# Saved to bottle-animated.mp4&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run &lt;code&gt;masonry image models&lt;/code&gt; or &lt;code&gt;masonry video models&lt;/code&gt; to list every model, and &lt;code&gt;masonry models params &amp;lt;model&amp;gt;&lt;/code&gt; to see a model's supported dimensions, durations, and aspect ratios.&lt;/p&gt;

&lt;h2&gt;
  
  
  Using it from Claude Code
&lt;/h2&gt;

&lt;p&gt;This is the part that matters for an agent workflow. Because &lt;code&gt;masonry&lt;/code&gt; is a normal command, you do not need a plugin. In a Claude Code session you can just ask for the asset in plain language, and the agent runs the command for you:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Generate a 16:9 hero image of a dark control room with glowing dashboards and save it to public/hero.png, then reference it in the landing section."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Claude Code runs &lt;code&gt;masonry image "..." --aspect 16:9 --output public/hero.png&lt;/code&gt;, the file lands in your repo, and it wires it into the component in the same turn. The asset and the code stay in sync because they were produced together.&lt;/p&gt;

&lt;p&gt;For a more permanent setup, run &lt;code&gt;masonry skill install&lt;/code&gt;. It installs a Masonry skill into Claude Code so the agent already knows the commands and reaches for image or video generation on its own when a task needs a visual, instead of you spelling out the syntax each time. (&lt;code&gt;masonry skill list&lt;/code&gt; shows what's installed, &lt;code&gt;masonry skill uninstall&lt;/code&gt; removes it.)&lt;/p&gt;

&lt;h2&gt;
  
  
  Why 50+ models instead of one
&lt;/h2&gt;

&lt;p&gt;Most image CLIs are wired to a single model. Masonry exposes a catalog (Veo 3, FLUX, Imagen 4, GPT Image, Nano Banana, Kling, Seedance, and more) behind the same two commands, and that matters because no single model is best at everything. One is stronger at legible text in a marketing mockup, another at photoreal product lighting, another at fast cheap iterations while you are still exploring. Swapping is a flag, not a new tool, so you can match the model to the task without rebuilding your workflow.&lt;/p&gt;

&lt;h2&gt;
  
  
  Honest notes
&lt;/h2&gt;

&lt;p&gt;A few things worth knowing before you wire this into a pipeline:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It needs an account and credits. This is not an unlimited free local model, it is a hosted generation service, so generations draw down balance. For most developer use (a handful of assets per project) that is a non-issue, but if you plan to batch thousands of images, check the cost first.&lt;/li&gt;
&lt;li&gt;Generation is a network call, so it is not instant and it needs connectivity. Video especially takes longer than image.&lt;/li&gt;
&lt;li&gt;Treat generated marketing or product imagery the way you would any AI image: check it before you ship it, especially anything with text or a real product in it.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The bottom line
&lt;/h2&gt;

&lt;p&gt;Claude Code is a strong coding agent that simply lacks an image model. The Masonry CLI fills that gap with two commands and no integration work, so the agent can generate images and video the same way it runs tests or installs a package, inside the terminal, in the same session, across whichever model fits the job. If you have ever broken your flow to go make an image by hand, this is the part you can stop doing.&lt;/p&gt;

&lt;p&gt;Install it with &lt;code&gt;npx @masonryai/cli&lt;/code&gt; and try one generation. See the &lt;a href="https://masonry.so/cli" rel="noopener noreferrer"&gt;full command reference&lt;/a&gt; for everything else.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>cli</category>
      <category>productivity</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
