Skip to content

Commit 3211343

Browse files
committedMar 6, 2024
docs(cli): recommend using npx @mermaidchart/cli
Recommend using [npx][] to automatically install, cache, and run @mermaidchart/cli, e.g. with `npx @mermaidchart/cli`, as npx comes with most Node.JS installations. This doesn't currently work since we haven't published this package to NPM, however. [npx]: https://docs.npmjs.com/cli/v10/commands/npx
1 parent 0c58222 commit 3211343

File tree

1 file changed

+19
-7
lines changed

1 file changed

+19
-7
lines changed
 

‎packages/cli/README.md

+19-7
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,28 @@
22

33
CLI for interacting with https://MermaidChart.com, the platform that makes collaborating with Mermaid diagrams easy!
44

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+
517
## Usage
618

719
```bash
8-
mermaid-chart <command>
20+
npx @mermaidchart/cli <command>
921
```
1022

1123
Use `--help` to see options!
1224

1325
```bash
14-
mermaid-chart --help
26+
npx @mermaidchart/cli --help
1527
```
1628

1729
`@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
2335
API key, which you can then setup by running:
2436

2537
```bash
26-
mermaid-chart login
38+
npx @mermaidchart/cli login
2739
```
2840

2941
### `link` an existing Mermaid diagram to MermaidChart.com
3042

3143
You can link a local Mermaid diagram to MermaidChart using:
3244

3345
```bash
34-
mermaid-chart link ./path/to/my/mermaid-digram.mmd
46+
npx @mermaidchart/cli link ./path/to/my/mermaid-digram.mmd
3547
```
3648

3749
This will add an `id: xxxx-xxxxx-xxxxx` field to your diagram's YAML frontmatter,
@@ -53,7 +65,7 @@ flowchart
5365
Once you've made some local changes, you can `push` your changes to MermaidChart.com
5466

5567
```console
56-
$ mermaid-chart push ./path/to/my/mermaid-digram.mmd
68+
$ npx @mermaidchart/cli push ./path/to/my/mermaid-digram.mmd
5769
✅ - ./path/to/my/mermaid-digram.mmd was pushed
5870
```
5971

@@ -62,15 +74,15 @@ $ mermaid-chart push ./path/to/my/mermaid-digram.mmd
6274
You can use `pull` to pull down changes from MermaidChart.com.
6375

6476
```console
65-
$ mermaid-chart pull ./path/to/my/mermaid-digram.mmd
77+
$ npx @mermaidchart/cli pull ./path/to/my/mermaid-digram.mmd
6678
✅ - ./path/to/my/mermaid-digram.mmd was updated
6779
```
6880

6981
Or use the `--check` flag to throw an error if your local file would have been
7082
updated:
7183

7284
```console
73-
$ mermaid-chart pull ./path/to/my/mermaid-digram.mmd
85+
$ npx @mermaidchart/cli pull ./path/to/my/mermaid-digram.mmd
7486
❌ - ./path/to/my/mermaid-digram.mmd would be updated
7587
```
7688

0 commit comments

Comments
 (0)
Failed to load comments.