1 | # mermaid.cli
|
2 |
|
3 | Command-line interface for [mermaid](https://mermaidjs.github.io/).
|
4 |
|
5 | This CLI tool takes a mermaid definition file as input and generates svg/png file as output.
|
6 |
|
7 |
|
8 | ## Installation
|
9 |
|
10 | ```
|
11 | yarn global add mermaid.cli
|
12 | ```
|
13 |
|
14 | Or
|
15 |
|
16 | ```
|
17 | npm install -g mermaid.cli
|
18 | ```
|
19 |
|
20 | Please install via `npm` instead of `yarn` if you encounter [this issue](https://github.com/yarnpkg/yarn/issues/2224).
|
21 |
|
22 |
|
23 | ## Examples
|
24 |
|
25 | ```
|
26 | mmdc -i input.mmd -o output.svg
|
27 | ```
|
28 |
|
29 | ```
|
30 | mmdc -i input.mmd -o output.png
|
31 | ```
|
32 |
|
33 | ```
|
34 | mmdc -i input.mmd -o output.svg -w 1024 -H 768
|
35 | ```
|
36 |
|
37 | ```
|
38 | mmdc -i input.mmd -t forest
|
39 | ```
|
40 |
|
41 |
|
42 | ## Options
|
43 |
|
44 | Please run the following command to see the latest options:
|
45 |
|
46 | ```
|
47 | mmdc -h
|
48 | ```
|
49 |
|
50 | The 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 | ```
|