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