Can an AI agent drive Inkscape?
Claude Code wrote an SVG and exported it with Inkscape's command line. Exports worked in under a second, but every failure I tried exited 0.
Yes, for making and exporting vector images without opening the window. Claude Code wrote a social card as an SVG file, then used Inkscape’s command line to measure it, change it and export it. This is the smallest task in this section: one 1200x630 card made for this test, not a long design job, and I haven’t used the card anywhere else.
| Verdict | |
|---|---|
| Write the artwork as an SVG file | Works |
| Export PNG and PDF from the command line | Works |
| Export one object by its id | Works |
Measure objects with --query-all | Works |
Change objects with --actions | Works |
| Same result on a repeat export | Works: identical PNG files |
| Report failure through the exit code | Didn’t work: check for the output file |
| Check its own work | Works with limits: sizes and colors yes, taste no |
| Run unattended | Works with limits: no prompts locally; SSH and schedules not tried |
The way in
An SVG is a text file, so Claude can write one directly. Inkscape does the part that needs a real renderer. These commands ran on that card with no window opening, in about half a second each:
inkscape card.svg --export-filename=card.png
inkscape card.svg --export-filename=card.pdf
inkscape card.svg --query-all
inkscape card.svg --export-id=dot --export-id-only --export-filename=dot.png
inkscape card.svg --export-text-to-path --export-plain-svg --export-filename=outlined.svgThe file extension picks the format. --query-all prints each object’s id, position and
size, which is how an agent can find out where text landed without looking at it:
svg1,0,0,1200,630
bg,0,0,1200,630
dot,810,145,340,340
title,81.1602,248.355,465.504,67.5703
sub,82.0742,338.18,286.945,53.1562--actions runs a list of steps, like selecting an object and changing it. This one
turned the circle red, and a sampled pixel confirmed the change:
inkscape card.svg --actions="select-by-id:dot;object-set-attribute:fill,#ff0000;export-filename:recolor.png;export-do"
The exported card, unedited.
What failed
- Exit codes. Every failure I tried exited 0. A missing file, a junk SVG and a missing
output folder each wrote nothing. A bad action name and a bad object id in
--actionsboth still wrote a file, so the export looks fine with the change missing.--export-idwith a bad id wrote nothing and still exited 0. Check that the file exists, then check what’s in it. - My first exit-code test. The script printed blank exit codes because it used a bash variable in zsh. I reran it in bash to get the results above.
- A hung check. Another shell mistake passed ImageMagick an empty filename. It then waited until the 400-second timeout, which looked like an Inkscape problem at first. Inkscape had already finished.
Can it check its own work?
Partly. It can compare --query-all numbers to the layout it wanted, measure the export’s
size and sample pixels. In this test, the export was 1200x630, and the PDF was a valid PDF
file according to file. It can look at the image too, but I wouldn’t take its word on
whether a design is any good.
Two PNG exports of the same file had the same SHA-256.
Can it run unattended?
Partly. Nothing asked for input, and no Inkscape process was left running. It also wrote the
PNG with the environment stripped using env -i, though it warned that it couldn’t create
its settings folder without HOME. I haven’t run it over SSH or on a schedule.
Security
- Reach: the signature on my copy shows no App Sandbox entitlement, so it can reach what your user can, apart from whatever macOS privacy prompts block.
- Grants: this route needed no screen control or Automation permission.
- Input: I only opened an SVG Claude wrote. SVG files can point at outside files and images, and I haven’t tested opening one from anyone else.
Not tried
- Clicking through Inkscape’s window
- Python extensions and batch jobs over many files
- SVGs made by a person, or large files
- Fonts other than the system’s Helvetica
- Running over SSH or on a schedule
Tested on
Inkscape 1.4.4 from Homebrew on an M2 Pro MacBook Pro with 16 GB, macOS 27.2, with Claude Code, on November 4, 2026.