UNPKG

1.32 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 encounter [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```
53Usage: mmdc [options]
54
55
56 Options:
57
58 -V, --version output the version number
59 -t, --theme [name] Theme of the chart, could be default, forest, dark or neutral. Optional. Default: default
60 -w, --width [width] Width of the page. Optional. Default: 800
61 -H, --height [height] Height of the page. Optional. Default: 600
62 -i, --input <input> Input mermaid file. Required.
63 -o, --output [output] Output file. It should be either svg, png or pdf. Optional. Default: input + ".svg"
64 -h, --help output usage information
65```