You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**Prerequisite**: Please install [Node.js](https://nodejs.org/en) (version 19 or higher) before proceeding.
18
21
</Info>
19
22
20
-
**Step 1**: Install the [CLI](https://www.npmjs.com/package/mint):
23
+
<Steps>
24
+
<Steptitle="Install the CLI.">
25
+
Run the following command to install the [CLI](https://www.npmjs.com/package/mint):
26
+
<CodeGroup>
21
27
22
-
<CodeGroup>
28
+
```bash npm
29
+
npm i -g mint
30
+
```
23
31
24
-
```bash npm
25
-
npm i -g mint
26
-
```
27
32
28
-
29
-
```bash yarn
30
-
yarn global add mint
31
-
```
33
+
```bash yarn
34
+
yarn global add mint
35
+
```
32
36
33
37
34
-
```bash pnpm
35
-
pnpm add -g mint
36
-
```
38
+
```bash pnpm
39
+
pnpm add -g mint
40
+
```
37
41
38
-
</CodeGroup>
42
+
</CodeGroup>
43
+
</Step>
44
+
<Steptitle="Preview locally.">
45
+
Navigate to your docs directory (where your `docs.json` file is located) and execute the following command:
39
46
40
-
**Step 2**: Navigate to the docs directory (where the `docs.json` file is located) and execute the following command:
47
+
```bash
48
+
mint dev
49
+
```
41
50
42
-
```bash
43
-
mint dev
44
-
```
51
+
A local preview of your documentation will be available at `http://localhost:3000`.
52
+
</Step>
53
+
</Steps>
45
54
46
-
Alternatively, if you do not want to install the CLI globally, you can use a run a one-time script:
55
+
Alternatively, if you do not want to install the CLI globally, you can run a one-time script:
47
56
48
57
<CodeGroup>
49
58
@@ -63,11 +72,15 @@ pnpm dlx mint dev
63
72
64
73
</CodeGroup>
65
74
66
-
A local preview of your documentation will be available at `http://localhost:3000`.
67
-
68
75
## Updates
69
76
70
-
Each CLI release is associated with a specific version of the Mintlify platform. If your local preview doesn't align with the production version, please update the CLI:
77
+
If your local preview is out of sync with what you see on the web in the production version, update your local CLI:
78
+
79
+
```bash
80
+
mint update
81
+
```
82
+
83
+
If this `mint update` command is not available on your local version, re-install the CLI with the latest version:
71
84
72
85
<CodeGroup>
73
86
@@ -87,33 +100,33 @@ pnpm up --global mint
87
100
88
101
</CodeGroup>
89
102
90
-
## Custom Ports
103
+
## Custom ports
91
104
92
105
By default, the CLI uses port 3000. You can customize the port using the `--port` flag. To run the CLI on port 3333, for instance, use this command:
93
106
94
107
```bash
95
108
mint dev --port 3333
96
109
```
97
110
98
-
If you attempt to run on a port that's already in use, it will use the next available port:
111
+
If you attempt to run on a port that is already in use, it will use the next available port:
99
112
100
113
```mdx
101
114
Port 3000 is already in use. Trying 3001 instead.
102
115
```
103
116
104
-
## Additional Commands
117
+
## Additional commands
105
118
106
119
While `mint dev` is the most commonly used command, there are other commands you can use to manage your documentation.
107
120
108
-
### Find Broken Links
121
+
### Finding broken links
109
122
110
123
The CLI can assist with validating reference links made in your documentation. To identify any broken links, use the following command:
111
124
112
125
```bash
113
126
mint broken-links
114
127
```
115
128
116
-
### Check OpenAPI Spec
129
+
### Checking OpenAPI spec
117
130
118
131
You can use the CLI to check your OpenAPI file for errors using the following command:
119
132
@@ -123,19 +136,17 @@ mint openapi-check <openapiFilenameOrUrl>
123
136
124
137
You can pass in a filename (e.g. `./openapi.yaml`) or a URL (e.g. `https://petstore3.swagger.io/api/v3/openapi.json`).
125
138
126
-
### Renaming Files
139
+
### Renaming files
127
140
128
-
You can rename files using the following command:
141
+
You can rename and update all references to files using the following command:
129
142
130
143
```bash
131
144
mint rename <oldFilename><newFilename>
132
145
```
133
146
134
-
This is an improvement over updating the filename normally as it will also update all references to the file, ensuring no broken links.
135
-
136
147
## Formatting
137
148
138
-
While developing locally, we recommend using extensions on your IDE to recognize and format MDX.
149
+
While developing locally, we recommend using extensions in your IDE to recognize and format `MDX` files.
139
150
140
151
If you use Cursor, Windsurf, or VSCode, we recommend the [MDX VSCode extension](https://marketplace.visualstudio.com/items?itemName=unifiedjs.vscode-mdx) for syntax highlighting, and [Prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) for code formatting.
141
152
@@ -152,6 +163,6 @@ If you use JetBrains, we recommend the [MDX IntelliJ IDEA plugin](https://plugin
152
163
3. Reinstall the mint CLI: `npm install -g mint`
153
164
</Accordion>
154
165
<Accordiontitle="Issue: Encountering an unknown error">
155
-
Solution: Go to the root of your device and delete the ~/.mintlify folder. Afterwards, run `mint dev` again.
166
+
Solution: Go to the root of your device and delete the `~/.mintlify` folder. Afterwards, run `mint dev` again.
0 commit comments