Skip to content

Commit 995e32a

Browse files
authored
Update CLI docs for mint update (#810)
* Update CLI docs * update changelog * add troubleshooting info * add reviewer feedback
1 parent bc300dd commit 995e32a

File tree

2 files changed

+57
-35
lines changed

2 files changed

+57
-35
lines changed

changelog.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ mode: "center"
1313

1414
Learn more at [API playground docs.](/api-playground/)
1515

16-
## npm i mint
17-
Can now use `npm i mint@latest -g` to upgrade your CLI.
16+
## `mint update`
17+
Can now use `mint update` to update your CLI.
1818
</Update>
1919

2020
<Update label="April 2025">

installation.mdx

Lines changed: 55 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
2-
title: "Installation"
2+
title: "CLI"
3+
sidebarTitle: "Installation"
34
description: "Install the CLI to preview and develop your docs locally"
45
icon: "terminal"
56
---
@@ -13,37 +14,45 @@ icon: "terminal"
1314
src="/images/installation/local-development-dark.png"
1415
/>
1516

17+
## Installing the CLI
18+
1619
<Info>
1720
**Prerequisite**: Please install [Node.js](https://nodejs.org/en) (version 19 or higher) before proceeding.
1821
</Info>
1922

20-
**Step 1**: Install the [CLI](https://www.npmjs.com/package/mint):
23+
<Steps>
24+
<Step title="Install the CLI.">
25+
Run the following command to install the [CLI](https://www.npmjs.com/package/mint):
26+
<CodeGroup>
2127

22-
<CodeGroup>
28+
```bash npm
29+
npm i -g mint
30+
```
2331

24-
```bash npm
25-
npm i -g mint
26-
```
2732

33+
```bash yarn
34+
yarn global add mint
35+
```
2836

29-
```bash yarn
30-
yarn global add mint
31-
```
3237

38+
```bash pnpm
39+
pnpm add -g mint
40+
```
3341

34-
```bash pnpm
35-
pnpm add -g mint
36-
```
42+
</CodeGroup>
43+
</Step>
44+
<Step title="Preview locally.">
45+
Navigate to your docs directory (where your `docs.json` file is located) and execute the following command:
3746

38-
</CodeGroup>
47+
```bash
48+
mint dev
49+
```
3950

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>
4554

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:
4756

4857
<CodeGroup>
4958

@@ -63,11 +72,21 @@ pnpm dlx mint dev
6372

6473
</CodeGroup>
6574

66-
A local preview of your documentation will be available at `http://localhost:3000`.
67-
6875
## Updates
6976

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:
7190

7291
<CodeGroup>
7392

@@ -87,33 +106,33 @@ pnpm up --global mint
87106

88107
</CodeGroup>
89108

90-
## Custom Ports
109+
## Custom ports
91110

92111
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:
93112

94113
```bash
95114
mint dev --port 3333
96115
```
97116

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:
99118

100119
```mdx
101120
Port 3000 is already in use. Trying 3001 instead.
102121
```
103122

104-
## Additional Commands
123+
## Additional commands
105124

106125
While `mint dev` is the most commonly used command, there are other commands you can use to manage your documentation.
107126

108-
### Find Broken Links
127+
### Finding broken links
109128

110129
The CLI can assist with validating reference links made in your documentation. To identify any broken links, use the following command:
111130

112131
```bash
113132
mint broken-links
114133
```
115134

116-
### Check OpenAPI Spec
135+
### Checking OpenAPI spec
117136

118137
You can use the CLI to check your OpenAPI file for errors using the following command:
119138

@@ -123,19 +142,17 @@ mint openapi-check <openapiFilenameOrUrl>
123142

124143
You can pass in a filename (e.g. `./openapi.yaml`) or a URL (e.g. `https://petstore3.swagger.io/api/v3/openapi.json`).
125144

126-
### Renaming Files
145+
### Renaming files
127146

128-
You can rename files using the following command:
147+
You can rename and update all references to files using the following command:
129148

130149
```bash
131150
mint rename <oldFilename> <newFilename>
132151
```
133152

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-
136153
## Formatting
137154

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.
139156

140157
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.
141158

@@ -152,6 +169,11 @@ If you use JetBrains, we recommend the [MDX IntelliJ IDEA plugin](https://plugin
152169
3. Reinstall the mint CLI: `npm install -g mint`
153170
</Accordion>
154171
<Accordion title="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+
<Accordion title="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.
176+
177+
Use `npm i -g mint@latest` to update the CLI.
156178
</Accordion>
157179
</AccordionGroup>

0 commit comments

Comments
 (0)