What alternative ways does Mermaid ASCII offer to generate ASCII graphs?
Updated
Mermaid ASCII (v1.6.1) offers two alternative ways to generate ASCII graphs besides its web interface: a cURL request to https://mermaid-ascii.art and running the Go program from the AlexanderGrooff/mermaid-ascii repository in your CLI. Both are listed on the site under "Alternative Usage Methods" and are useful when you want to generate diagrams from a script, terminal, or automated workflow instead of pasting code into the browser.
Option 1: cURL request
Send your Mermaid code directly to the site as a POST parameter.
curl https://mermaid-ascii.art -d mermaid="graph LR\nABC --> DEF"
- Input: the
mermaidparameter containing your Mermaid definition (here a simple left-to-right graph with two nodes). - Action: cURL posts the data to the Mermaid ASCII endpoint.
- Expected result: the ASCII rendering of the graph is returned as the response, which you can print in a terminal or pipe into a file.
This is the quickest option if you only need the output and don't want to install anything. It fits shell scripts, CI steps, or one-off conversions.
Option 2: Run the Go program in your CLI
Clone the repository and run the Go program locally.
git clone https://github.com/AlexanderGrooff/mermaid-ascii
cd mermaid-ascii
go run main.go -f test.mermaid
- Input: a
.mermaidfile (the example usestest.mermaid) passed with the-fflag. - Action:
go run main.goexecutes the program, reading the diagram definition from the file. - Expected result: the ASCII graph is printed to your terminal.
This option requires a Go toolchain and a local clone, but it keeps everything offline and lets you version your diagram files alongside your code.
Which one to choose
| cURL request | Go CLI | |
|---|---|---|
| Setup | None beyond cURL | Go installed + repo cloned |
| Input | Inline mermaid parameter |
.mermaid file via -f |
| Best for | Quick conversions, scripts, CI | Offline use, file-based workflows |
If you just need a one-off conversion or want to call it from a script, use the cURL request. If you prefer working with diagram files locally and having the tool available offline, clone the repository and run the Go program.
The web interface itself also exposes settings such as xPadding, yPadding, and an option to use extended characters, and it includes examples like nested subgraphs, labelled arrows, styled text, and sequence diagrams — so you can preview a diagram there first, then switch to either alternative method once the output looks right.