Guide · Agent skill
How to use the Draw.io Command-Line Diagrams agent skill
Updated · written with AI from the project's own documentation and checked against our catalogue data
This guide explains how to install and use the Draw.io Command-Line Diagrams skill, which lets an AI agent work with Draw.io diagrams by running the cli-anything-drawio program. It is written for readers who have not used agent skills before. By the end you will know what the skill does, how to add it to your agent, how to ask for diagram work in plain language, and what to check for safety.
Quick start
- 1Download the ZIP. Download the skill ZIP file from this page.
- 2Add the skill to your agent. Unzip it into ~/.claude/skills/ for all projects, or into a project's .claude/skills/ folder. In the Claude apps, you can instead upload it under Settings → Capabilities → Skills.
- 3Install Python 3.10 or newer. Confirm you have Python 3.10 or a newer version on your system.
- 4Install Draw.io and the CLI package. Make sure drawio is installed, then run pip install cli-anything-drawio.
- 5Ask for a diagram in plain language. Describe the diagram, the shapes and the export format you want, and mention Draw.io.
- 6Check the output file. Confirm the exported PNG, PDF or SVG exists at the expected absolute path.
What does this skill make the agent do?
The skill teaches an AI agent to work with Draw.io diagrams by running a command-line program called cli-anything-drawio. Once installed, the agent can create a new diagram project, add shapes and connectors, move or restyle them, manage multiple pages, undo and redo changes, and export the result to PNG, PDF or SVG.
The program also has a machine-readable output mode that returns results as structured JSON, which is easier for software to read.
- Project: create, open, save, inspect and print the raw XML of a diagram
- Shape: add, remove, list, label, move, resize and style shapes
- Connect: add, remove, label and style connectors between shapes
- Page: add, remove, rename and list pages
- Export: render to a file and list available formats
- Session: check status, undo, redo and save state
Install the Draw.io skill in Claude
You can add the skill in one of two ways. Download the ZIP file from this page and then either unzip it into your personal skills folder at ~/.claude/skills/, or unzip it into a project's .claude/skills/ folder so only that project uses it.
If you use the Claude apps, you can instead upload the skill under Settings → Capabilities → Skills.
The skill's own instructions require the CLI to be installed with pip. Install the package with the command below, and make sure Draw.io (drawio) is installed on your system as well.
- Python 3.10 or newer is required
- Draw.io (drawio) must be installed on the system
- The pip package is named cli-anything-drawio
pip install cli-anything-drawioHow do you trigger the skill with a natural request?
You do not need to type commands yourself. Describe the diagram you want in ordinary language and mention Draw.io, so the agent knows to use the skill. The agent then decides which cli-anything-drawio commands to run.
Be specific about the file, the shapes, and the output format. Asking for a PNG, PDF or SVG export tells the agent exactly what final file you expect.
- Create a Draw.io project called system-overview.json with a web app, a database and a queue, and export it to PNG.
- Open flow.json in Draw.io, rename page 1 to Login, and export the diagram to PDF.
- Add a connector from the API shape to the database shape, then undo that change if it looks wrong.
- Return the project information as JSON so my script can read it.
Run the CLI yourself to check what the agent does
You can run the same commands by hand to see or verify the agent's work. Show the help text first, then create a project file and export it. The export command takes the project file with the --project option, the output file name, and an optional --overwrite flag.
Use --json before the command name when you want structured output. The skill's guidance says to use absolute paths for file operations and to confirm that output files exist after an export.
- Run cli-anything-drawio --help to see the available commands
- Run cli-anything-drawio with no subcommand to enter the interactive REPL, which supports tab-completion and history
- Run cli-anything-drawio project new -o myproject.json to create a blank diagram
- Run cli-anything-drawio --project myproject.json export render output.pdf --overwrite to export it
cli-anything-drawio project new -o myproject.json
cli-anything-drawio --project myproject.json export render output.pdf --overwriteWhat are the safety notes for this skill?
This skill runs scripts. The listing states that it runs scripts and does not use the network. The agent will execute the cli-anything-drawio program on your machine, so only install it in environments where running that software and installing Python packages is allowed.
The skill file does not say whether diagram data leaves the machine. If your diagrams are sensitive, review the package documentation before you use it with confidential content.
- Use absolute paths so the agent writes to the files you intended
- Check return codes: 0 means success, non-zero means an error
- Parse stderr for error messages when a command fails
- Verify that exported files exist after each export
Tips for getting reliable diagrams
Keep your diagram in a project file so you can reopen, change and re-export it later. Use undo and redo while you work, noting that the session keeps up to 50 levels of history. For scripted use, request JSON output so the results can be parsed reliably.
The package includes further documentation in README.md, test coverage in TEST.md and methodology in HARNESS.md under the cli-anything-plugin, so check those files when you need detail beyond this guide.
- Save the project after important changes
- Use the presets command to list available page size presets
- Use the formats command to list available export formats
- Use the styles command to list edge styles for connectors
What people use it for
- Developers generating or updating architecture diagrams from scripts
- Designers or analysts producing repeatable diagram exports from a text request
- Teams automating documentation that includes Draw.io diagrams
- Creating multi-page flow diagrams and renaming pages as the design changes
Frequently asked questions
How do I install the Draw.io command-line diagrams skill?
Download the ZIP from this page and unzip it into ~/.claude/skills/ or a project's .claude/skills/ folder. In the Claude apps you can upload it under Settings → Capabilities → Skills. You also need Python 3.10 or newer, Draw.io installed, and the pip package cli-anything-drawio.
What are the requirements for cli-anything-drawio?
The skill requires Python 3.10 or newer, Draw.io (drawio) installed on the system, and the pip package cli-anything-drawio. It runs scripts and does not use the network, according to its listing.
Is the Draw.io agent skill free to use?
The skill is published under the Apache-2.0 licence, which is shown on this page. Check the licence text in the package for the full terms before commercial use.
Can the agent export a Draw.io diagram to PNG or PDF?
Yes. The export render command writes the diagram to a file, and the formats command lists the available export formats. The skill covers PNG, PDF and SVG.
Why does the agent need Draw.io installed if it is a command-line tool?
The skill depends on the drawio program being present on your system, as stated in its prerequisites. Without Draw.io installed, the CLI cannot be relied on for the work described here.
When should I use something other than this skill?
If you only need to draw a diagram by hand, the Draw.io web app is simpler, since this skill adds setup without benefit. If your environment does not allow the agent to run installed software or install Python packages, this skill will not work there.
New agent skills, repos and AI tools — every week
The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.
Our verdict
This skill suits developers and teams who want an agent to build, update or export Draw.io diagrams from scripts or plain-language requests, and who are comfortable installing Python packages. It is a poor choice if you only draw occasionally by hand, cannot let an agent run software, or need assurance about where sensitive diagram data goes.
Download the skill