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
33
+
```bash yarn
34
+
yarn global add mint
35
+
```
28
36
29
-
```bash yarn
30
-
yarn global add mint
31
-
```
32
37
38
+
```bash pnpm
39
+
pnpm add -g mint
40
+
```
33
41
34
-
```bash pnpm
35
-
pnpm add -g mint
36
-
```
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:
37
46
38
-
</CodeGroup>
47
+
```bash
48
+
mint dev
49
+
```
39
50
40
-
**Step 2**: Navigate to the docs directory (where the `docs.json` file is located) and execute the following command:
41
-
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,21 @@ 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
+
You can update the client and CLI versions independently.
78
+
79
+
### Client version
80
+
81
+
If your local preview is out of sync with the production version, update your client version:
82
+
83
+
```bash
84
+
mint update
85
+
```
86
+
87
+
### CLI version
88
+
89
+
Update the CLI to the latest version:
71
90
72
91
<CodeGroup>
73
92
@@ -87,33 +106,33 @@ pnpm up --global mint
87
106
88
107
</CodeGroup>
89
108
90
-
## Custom Ports
109
+
## Custom ports
91
110
92
111
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
112
94
113
```bash
95
114
mint dev --port 3333
96
115
```
97
116
98
-
If you attempt to run on a port that's already in use, it will use the next available port:
117
+
If you attempt to run on a port that is already in use, it will use the next available port:
99
118
100
119
```mdx
101
120
Port 3000 is already in use. Trying 3001 instead.
102
121
```
103
122
104
-
## Additional Commands
123
+
## Additional commands
105
124
106
125
While `mint dev` is the most commonly used command, there are other commands you can use to manage your documentation.
107
126
108
-
### Find Broken Links
127
+
### Finding broken links
109
128
110
129
The CLI can assist with validating reference links made in your documentation. To identify any broken links, use the following command:
111
130
112
131
```bash
113
132
mint broken-links
114
133
```
115
134
116
-
### Check OpenAPI Spec
135
+
### Checking OpenAPI spec
117
136
118
137
You can use the CLI to check your OpenAPI file for errors using the following command:
119
138
@@ -123,19 +142,17 @@ mint openapi-check <openapiFilenameOrUrl>
123
142
124
143
You can pass in a filename (e.g. `./openapi.yaml`) or a URL (e.g. `https://petstore3.swagger.io/api/v3/openapi.json`).
125
144
126
-
### Renaming Files
145
+
### Renaming files
127
146
128
-
You can rename files using the following command:
147
+
You can rename and update all references to files using the following command:
129
148
130
149
```bash
131
150
mint rename <oldFilename><newFilename>
132
151
```
133
152
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
153
## Formatting
137
154
138
-
While developing locally, we recommend using extensions on your IDE to recognize and format MDX.
155
+
While developing locally, we recommend using extensions in your IDE to recognize and format `MDX` files.
139
156
140
157
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
158
@@ -152,6 +169,11 @@ If you use JetBrains, we recommend the [MDX IntelliJ IDEA plugin](https://plugin
152
169
3. Reinstall the mint CLI: `npm install -g mint`
153
170
</Accordion>
154
171
<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.
172
+
Solution: Go to the root of your device and delete the `~/.mintlify` folder. Afterwards, run `mint dev` again.
173
+
</Accordion>
174
+
<Accordiontitle="Issue: The update command is not available">
175
+
If running `mint update` returns the command menu, your current version of the CLI does not include the `update` command.
0 commit comments