UNPKG

1.23 kBMarkdownView Raw
1# mermaid.cli
2
3Command-line interface for [mermaid](https://mermaidjs.github.io/).
4
5This CLI tool takes a mermaid definition file as input and generates svg/png file as output.
6
7
8## Installation
9
10```
11yarn global add mermaid.cli
12```
13
14 Or
15
16```
17npm install -g mermaid.cli
18```
19
20Please install via `npm` instead of `yarn` if you encouner [this issue](https://github.com/yarnpkg/yarn/issues/2224).
21
22
23## Examples
24
25```
26mmdc -i input.mmd -o output.svg
27```
28
29```
30mmdc -i input.mmd -o output.png
31```
32
33```
34mmdc -i input.mmd -o output.svg -w 1024 -H 768
35```
36
37```
38mmdc -i input.mmd -t forest
39```
40
41
42## Options
43
44Please run the following command to see the latest options:
45
46```
47mmdc -h
48```
49
50The following is for your quick reference (may not be the latest version):
51
52```
53 Options:
54 -V, --version output the version number
55 -t, --theme [name] Theme of the chart. Optional. Default: default
56 -w, --width [width] Width of the page. Optional. Default: 800
57 -H, --height [height] Height of the page. Optional. Default: 600
58 -i, --input <input> * Input mermaid file. Required.
59 -o, --output [output] Output image file. Optional. Default: input + ".svg"
60 -h, --help output usage information
61```