2
2
3
3
CLI for interacting with https://MermaidChart.com , the platform that makes collaborating with Mermaid diagrams easy!
4
4
5
+ ## Installation
6
+
7
+ ` @mermaidcart/cli ` is tested to work with Node.JS v18.18.0 or later.
8
+
9
+ We recommend installation using [ npx] ( https://docs.npmjs.com/cli/v10/commands/npx )
10
+ to automatically download, cache, and run ` @mermaidcart/cli ` , as it comes with
11
+ most Node.JS installations.
12
+
13
+ ``` bash
14
+ npx @mermaidchart/cli --help
15
+ ```
16
+
5
17
## Usage
6
18
7
19
``` bash
8
- mermaid-chart < command>
20
+ npx @mermaidchart/cli < command>
9
21
```
10
22
11
23
Use ` --help ` to see options!
12
24
13
25
``` bash
14
- mermaid-chart --help
26
+ npx @mermaidchart/cli --help
15
27
```
16
28
17
29
` @mermaidchart/cli ` allows you to easily sync local diagrams with your diagrams
@@ -23,15 +35,15 @@ Firstly, go to https://www.mermaidchart.com/app/user/settings and generate an
23
35
API key, which you can then setup by running:
24
36
25
37
``` bash
26
- mermaid-chart login
38
+ npx @mermaidchart/cli login
27
39
```
28
40
29
41
### ` link ` an existing Mermaid diagram to MermaidChart.com
30
42
31
43
You can link a local Mermaid diagram to MermaidChart using:
32
44
33
45
``` bash
34
- mermaid-chart link ./path/to/my/mermaid-digram.mmd
46
+ npx @mermaidchart/cli link ./path/to/my/mermaid-digram.mmd
35
47
```
36
48
37
49
This will add an ` id: xxxx-xxxxx-xxxxx ` field to your diagram's YAML frontmatter,
@@ -53,7 +65,7 @@ flowchart
53
65
Once you've made some local changes, you can ` push ` your changes to MermaidChart.com
54
66
55
67
``` console
56
- $ mermaid-chart push ./path/to/my/mermaid-digram.mmd
68
+ $ npx @mermaidchart/cli push ./path/to/my/mermaid-digram.mmd
57
69
✅ - ./path/to/my/mermaid-digram.mmd was pushed
58
70
```
59
71
@@ -62,15 +74,15 @@ $ mermaid-chart push ./path/to/my/mermaid-digram.mmd
62
74
You can use ` pull ` to pull down changes from MermaidChart.com.
63
75
64
76
``` console
65
- $ mermaid-chart pull ./path/to/my/mermaid-digram.mmd
77
+ $ npx @mermaidchart/cli pull ./path/to/my/mermaid-digram.mmd
66
78
✅ - ./path/to/my/mermaid-digram.mmd was updated
67
79
```
68
80
69
81
Or use the ` --check ` flag to throw an error if your local file would have been
70
82
updated:
71
83
72
84
``` console
73
- $ mermaid-chart pull ./path/to/my/mermaid-digram.mmd
85
+ $ npx @mermaidchart/cli pull ./path/to/my/mermaid-digram.mmd
74
86
❌ - ./path/to/my/mermaid-digram.mmd would be updated
75
87
```
76
88
0 commit comments