Skip to content

Guide · Agent skill

How to use the Mermaid Diagram CLI agent skill

Updated · written with AI from the project's own documentation and checked against our catalogue data

The cli-anything-mermaid skill lets an AI agent create and edit Mermaid diagrams such as flowcharts and sequence diagrams through a command-line tool, then render them to SVG or PNG or produce Mermaid Live Editor links. This guide is for readers who have never used an agent skill: it explains what the skill does, how to install it, how to ask for it in plain language, and what to watch for on privacy and network access. By the end you will know how to set it up and run a first diagram.

Mermaid Diagram CLIHKUDS/CLI-Anything · Apache-2.0

Quick start

  1. 1Download and unzip the skill. Download the ZIP from this page and unzip it so the skill folder contains SKILL.md.
  2. 2Place it in the skills folder. Move the folder into ~/.claude/skills/ or a project's .claude/skills/, or upload it under Settings → Capabilities → Skills in the Claude apps.
  3. 3Install Python 3.10+ and the CLI. Confirm Python 3.10 or newer is installed, then run pip install cli-anything-mermaid.
  4. 4Check the tool works. Run cli-anything-mermaid --help to confirm the command is available.
  5. 5Ask for a diagram. Describe the diagram and the output you want, such as an SVG file or a share link, in plain language.
  6. 6Verify the output. Confirm the rendered file exists and check the agent reported return code 0.

What is an agent skill and what does this one let the agent do?

An agent skill is a folder containing a SKILL.md file that tells an AI agent when and how to use a set of tools. This skill's SKILL.md describes a command-line interface called cli-anything-mermaid for Mermaid Live Editor. Once it is installed, the agent can create a project file, set or replace the Mermaid diagram source, undo and redo source changes, and render the diagram to SVG or PNG using the mermaid.ink renderer.

  • Create a project file, optionally from a sample preset (such as flowchart or sequence)
  • Set the diagram source inline or from a .mmd file, and print the current source
  • Render to SVG or PNG via mermaid.ink, or generate an editable or view-only Mermaid Live URL
  • Undo or redo diagram source changes and check session status

How do you install the Mermaid diagram skill?

Download the ZIP for this skill from this page and unzip it. Put the resulting skill folder in one of these locations: ~/.claude/skills/ for your user account, or .claude/skills/ inside a specific project if you want the skill limited to that project. Alternatively, upload the skill in the Claude apps under Settings → Capabilities → Skills.

The skill also needs the command-line tool itself. The skill's installation section gives this pip package and lists Python 3.10 or newer as the prerequisite. No other external software is required, because rendering uses the mermaid.ink cloud service.

  • Requires Python 3.10+
  • Install the tool with pip: the package name is cli-anything-mermaid
pip install cli-anything-mermaid

How do you trigger the skill with a natural request?

You do not need to type commands yourself. Ask the agent for a diagram in plain language and name the kind of output you want, such as an SVG file or a shareable link. The agent reads the skill's description and uses the CLI when the request matches.

Good requests say what the diagram shows, the diagram type, and the output. For example: "Draw a flowchart of our login process and render it to output.svg" or "Make a sequence diagram of the checkout API calls and give me an editable Mermaid Live link."

  • Name the diagram type: flowchart, sequence diagram or similar
  • Say what the boxes or steps are, in your own words
  • Name the output: SVG, PNG, or a share link

How do you create and render a flowchart by hand?

If you want to see the commands the agent runs, you can run them yourself. This sequence creates a project from the flowchart sample, replaces the diagram source, and renders it to SVG.

  • Create the project from a sample preset with -o to name the file
  • Replace the source with the diagram text using the --project flag
  • Render with export render, naming the output file and format
cli-anything-mermaid project new --sample flowchart -o flow.json cli-anything-mermaid --project flow.json diagram set --text "graph TD; A-->B; B-->C;" cli-anything-mermaid --project flow.json export render output.svg --format svg

How do you make a sequence diagram from a file and share it?

For longer diagrams, keep the Mermaid source in a .mmd file and load it with diagram set --file. Render to PNG when you need an image, or generate a share link. The skill describes two share modes: edit for an editable Mermaid Live URL and view for a view-only URL. Remember that a share link embeds the diagram itself.

  • Use --mode edit for an editable link, --mode view for read-only
  • The skill's guidance is to use absolute paths for all file operations
cli-anything-mermaid project new --sample sequence -o seq.json cli-anything-mermaid --project seq.json diagram set --file my_diagram.mmd cli-anything-mermaid --project seq.json export render output.png --format png cli-anything-mermaid --project seq.json export share --mode edit

What output and safety details should you know?

Every command supports a human-readable default and a --json flag for structured output, which is what agents should use. The skill advises checking return codes (0 means success), reading stderr for error messages, and confirming that output files exist after a render.

Safety matters here. The skill runs scripts and uses the network. Rendering and sharing send your Mermaid source to the external mermaid.ink service, and Mermaid Live Editor links embed the diagram. The skill does not describe this as private, so do not use it for sensitive or confidential architecture. Rendering also cannot work offline or in an air-gapped environment.

  • Use --json for parseable output
  • Check return codes and stderr on failure
  • Do not send confidential diagrams: source goes to mermaid.ink and share links embed it
  • Needs network access to mermaid.ink; offline use is not supported by this skill
cli-anything-mermaid --json project info

What people use it for

  • Documenting service architecture with flowcharts that are regenerated when the design changes
  • Drawing sequence diagrams of API calls for a technical design document
  • Producing an SVG or PNG image to embed in a README or wiki page
  • Generating a Mermaid Live Editor link so a colleague can edit a draft diagram
  • Letting an agent iterate on a diagram with undo and redo while you review it

Frequently asked questions

Is the cli-anything-mermaid skill free?

The source page does not state pricing or licence terms in the SKILL.md text. The item is listed under the Apache-2.0 licence, so check the licence file in the repository for the terms that apply. The skill itself requires Python 3.10+ and pip install of cli-anything-mermaid.

What do I need to run cli-anything-mermaid?

You need Python 3.10 or newer, the pip package cli-anything-mermaid, and network access to mermaid.ink, because rendering uses that cloud service. No other external software is listed as required.

Can I use cli-anything-mermaid offline?

No. Rendering depends on the mermaid.ink cloud service, so offline or air-gapped environments are not suitable for this skill.

Is it safe to use for confidential diagrams?

Be cautious. Rendering and sharing send the Mermaid source to mermaid.ink, and Mermaid Live Editor links embed the diagram. The skill does not describe this as private, so avoid it for sensitive architecture.

How is this different from using the Mermaid Live Editor in a browser?

The skill gives an agent a command-line interface with JSON output, project files and undo/redo, so it can build diagrams without a GUI. The Mermaid Live Editor is a visual browser editor; this skill can also generate links to it. If you need a full visual editor, the browser tool is the better fit.

Why does my render or command fail?

Check that Python is 3.10 or newer and that cli-anything-mermaid is installed. For rendering, confirm the machine has network access to mermaid.ink. Run the command with --json, check the return code (non-zero means error) and read stderr for the message.

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

Use this skill if you are a developer or documentation writer who wants an AI agent to produce flowchart or sequence diagrams from text, with machine-readable output and no GUI. Pick something else if the diagrams are confidential, if you must work offline, or if you want a full visual diagram editor.

Download the skill