Masonry Logo
AI & Technology

Generate Images in Claude Code with Masonry CLI (2026)

A tested Masonry CLI workflow for starting an image or video job, waiting for it, and downloading the file, plus the current Claude initializer caveat.

Gaurav BisenGaurav Bisen
7 min read

Claude Code can generate an image or video when you give it a shell command that creates the file. The dependable workflow is not a magical plugin: start a hosted job, retain the job ID, wait for completion, download the result to an explicit path, and inspect the file before referencing it in code.

We checked the published Masonry CLI (@masonryai/cli v1.1.26) and the authenticated catalog on 31 October 2026. The catalog returned 34 image routes and 24 video routes. masonry skill install gives Claude Code four Masonry skills in one step, and the direct commands below work with or without them.

Quick answer: the working command sequence

Prompt

# run the package entry point npm install -g @masonryai/cli # connect your Masonry account masonry login # give Claude Code the Masonry skills masonry skill install # inspect current routes and the selected route's contract masonry models list --type image masonry models params gpt-image-2 # start a pinned image job masonry image "a minimalist mountain logo, flat vector" \ --model gpt-image-2 \ --dimension 1536x1024 # use the returned ID masonry job wait <job-id> masonry job download <job-id> --output ./public/mountain-logo.png

For video, use the same job lifecycle:

Prompt

masonry models list --type video masonry models params veo-3.1-fast-generate-preview masonry video "slow dolly over a misty forest at dawn" \ --model veo-3.1-fast-generate-preview \ --aspect 16:9 masonry job wait <job-id> masonry job download <job-id> --output ./public/misty-forest.mp4

Do not assume the generation command saved a file merely because the job started. A successful submission and a downloaded artifact are two separate states.

What we verified

The published CLI (v1.1.26) exposes image, video, models, job, history, login, skill, guide, layers and scrape commands, and keeps init only as a deprecated alias. The authenticated catalog returned 34 image routes and 24 video routes, not one permanent list of model names.

The generation contract was asynchronous:

  1. masonry image or masonry video submitted a job and returned an ID.
  2. masonry job status <job-id> inspected the current state.
  3. masonry job wait <job-id> blocked until the job completed or failed.
  4. masonry job download <job-id> --output <path> wrote the finished asset locally.

That separation matters in an agent workflow. If the agent writes <Image src="/hero.png" /> immediately after submission, the code may reference a file that does not exist yet. Require the download step to succeed and then verify the file before editing the component.

Ask Claude Code for the whole acceptance contract

A useful request names both the creative output and the filesystem outcome:

Generate a 1536×1024 landing-page hero with GPT Image 2. Save it to public/hero.png. Wait for the Masonry job to finish, download it, verify the file exists and opens correctly, then reference it from the page. If generation fails, report the job error and do not add a broken image path.

This prompt gives the agent five checkable responsibilities: route, dimensions, output path, failure behavior, and verification. It also keeps the code change conditional on a real artifact.

The direct shell sequence is enough; Claude Code does not need a plugin or MCP server to run it:

Prompt

masonry image "dark control room with glowing dashboards" \ --model gpt-image-2 \ --dimension 1536x1024 masonry job wait <job-id> masonry job download <job-id> --output ./public/hero.png

For a reference-led image or image-to-video job, inspect the selected route before inventing flags:

masonry models params <model>

Some routes accept --image, repeated --ref values, a seed, duration, audio controls, or a last frame. Others do not. The provider's maximum feature set and the hosted Masonry route are not necessarily identical.

Connect it to Claude Code with masonry skill install

masonry skill install writes four skills to ~/.claude/skills/ so every project can use them; add --scope project to install them in ./.claude/skills/ instead:

  • masonry: the full CLI reference
  • masonry-generate: image and video generation workflows
  • masonry-models: choosing models and reading a model's options
  • masonry-jobs: waiting for, checking and downloading jobs

In our 31 October 2026 check of v1.1.26, the installed skills called the masonry command on your PATH, contained no machine-specific paths, and told Claude to use Masonry's live default models unless you ask for a specific one. Run masonry skill install --force after a CLI update to refresh them.

Earlier versions used masonry init claude-code, which wrote command files under .claude/commands/. That command still runs for backward compatibility but is deprecated; use masonry skill install for new setups.

Working in Claude in the browser or desktop app instead of the terminal? The Masonry connector for Claude brings the same studio into a Claude conversation: generate, remix, animate and upscale images and video from chat, with your Masonry workspace. Use the CLI for scripted, repeatable jobs and the connector when you are working in chat.

Route discovery beats copied model lists

The live check on 31 October 2026 returned 34 image routes and 24 video routes across generation, editing, upscaling, reference-image, lip-sync, and video-editing jobs. That count is more useful than advertising a static "50+ models" slogan, but it is still a dated observation.

Use these commands as the source of truth at execution time:

masonry models list --type image
masonry models list --type video
masonry models params <model>

Pin the model in any reproducible script. The installed image help still displayed an older default, so omitting --model can silently put the job on a route you did not evaluate.

The same rule applies to parameters. In our text-rendering run, the model parameter view advertised a provider-style --size flag, while the top-level image command rejected --size and accepted --dimension 1024x1024. Treat masonry image --help, the live route contract, and a one-file smoke test as a three-part check before a batch.

A five-minute setup acceptance test

Before asking an agent to generate production assets, verify:

CheckPass condition
Authenticationmasonry models list --type image returns the authenticated catalog without exposing a raw provider key
RouteThe exact model appears in the live list and masonry models params <model> returns its current inputs
SubmissionThe generation command returns a job ID that the agent records
Completionmasonry job wait <job-id> exits successfully or the agent reports the failure
Outputmasonry job download ... --output <path> creates the promised file at that exact path
VerificationThe agent checks file type, dimensions or duration, and a visual acceptance criterion before editing code
Cost boundaryA batch estimate uses the current route cost and expected rejection rate

One accepted test file is more valuable than a polished integration snippet that has never been executed.

Honest operating notes

  • Masonry is a hosted generation service. Jobs need network access, an authenticated account, and sufficient credits.
  • Image and video generation are asynchronous. Video commonly takes longer, but do not infer a route ranking from one queue observation.
  • There is no universal best model. Compare the same brief and acceptance sheet across current candidates.
  • Generated product imagery and embedded text still require review. A beautiful output can change a product detail, digit, or punctuation mark.
  • Keep job IDs and output paths in logs. They are the minimum audit trail for reproducing a failed asset step.

Bottom line

Claude Code can generate media without leaving the terminal when the workflow is explicit: discover a live route, start the job, wait, download to a known path, verify the asset, and only then change the code. The direct Masonry commands pass that contract today. The project initializer needs inspection before use because its current templates contain machine-specific and stale instructions.

Start with the Masonry CLI page, compare the surrounding tool choices in our Claude Code image tools guide, or move from one command to a bounded merchant batch with the Kling AI CLI product-video workflow. Use the AI image prompting guide to turn a vague creative request into a testable brief.

Share:
FAQ

Questions from this guide

Concise answers to the questions readers ask after this guide

Can Claude Code generate images?

Claude Code does not include an image generator, but it can run a media CLI. In the tested Masonry workflow, Claude starts an image or video job, captures the returned job ID, waits for completion, downloads the file into the repository, and verifies it before changing code.

How do I generate images in Claude Code from the terminal?

Run npm install -g @masonryai/cli, authenticate with masonry login, inspect the live catalog, then run masonry image with an explicit model and dimension. The command returns a job ID; use masonry job wait and masonry job download --output to save the completed file.

What image and video models does Masonry CLI support?

The authenticated catalog returned 34 image routes and 24 video routes on October 31, 2026. Routes included GPT Image 2, Ideogram V4, FLUX.2, Nano Banana 2, Seedream 5 Pro, Veo, Kling, Seedance, Hailuo, and WAN families. Run masonry models list because names and availability change.

How do I connect the Masonry CLI to Claude Code?

Run masonry skill install. In our October 31, 2026 check of the published CLI (v1.1.26) it installed four skills (masonry, masonry-generate, masonry-models and masonry-jobs) to ~/.claude/skills, or to the current project with --scope project. They call the masonry command on your PATH and use Masonry's live defaults. The older masonry init claude-code still runs but is deprecated.

Is Masonry CLI free?

The CLI package and account entry point do not make hosted generation free. Image and video jobs use Masonry credits. Check the selected route's current cost and estimate spend before running a batch.