Skip to content

Commit d5517dc

Browse files
committed
Update CLI docs
1 parent 75531ab commit d5517dc

File tree

1 file changed

+43
-34
lines changed

1 file changed

+43
-34
lines changed

installation.mdx

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

16+
## Installing the CLI
17+
1618
<Info>
1719
**Prerequisite**: Please install [Node.js](https://nodejs.org/en) (version 19 or higher) before proceeding.
1820
</Info>
1921

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

22-
<CodeGroup>
27+
```bash npm
28+
npm i -g mint
29+
```
2330

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

32+
```bash yarn
33+
yarn global add mint
34+
```
2835

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

37+
```bash pnpm
38+
pnpm add -g mint
39+
```
3340

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

38-
</CodeGroup>
46+
```bash
47+
mint dev
48+
```
3949

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

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

4856
<CodeGroup>
4957

@@ -63,21 +71,24 @@ pnpm dlx mint dev
6371

6472
</CodeGroup>
6573

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

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

7278
<CodeGroup>
7379

80+
```bash mint
81+
mint update
82+
```
83+
84+
7485
```bash npm
7586
npm i -g mint@latest
7687
```
7788

7889

7990
```bash yarn
80-
yarn global upgrade mint
91+
yarn global update mint
8192
```
8293

8394

@@ -87,33 +98,33 @@ pnpm up --global mint
8798

8899
</CodeGroup>
89100

90-
## Custom Ports
101+
## Custom ports
91102

92103
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:
93104

94105
```bash
95106
mint dev --port 3333
96107
```
97108

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

100111
```mdx
101112
Port 3000 is already in use. Trying 3001 instead.
102113
```
103114

104-
## Additional Commands
115+
## Additional commands
105116

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

108-
### Find Broken Links
119+
### Finding broken links
109120

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

112123
```bash
113124
mint broken-links
114125
```
115126

116-
### Check OpenAPI Spec
127+
### Checking OpenAPI spec
117128

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

@@ -123,19 +134,17 @@ mint openapi-check <openapiFilenameOrUrl>
123134

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

126-
### Renaming Files
137+
### Renaming files
127138

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

130141
```bash
131142
mint rename <oldFilename> <newFilename>
132143
```
133144

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-
136145
## Formatting
137146

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

140149
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.
141150

@@ -152,6 +161,6 @@ If you use JetBrains, we recommend the [MDX IntelliJ IDEA plugin](https://plugin
152161
3. Reinstall the mint CLI: `npm install -g mint`
153162
</Accordion>
154163
<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.
164+
Solution: Go to the root of your device and delete the `~/.mintlify` folder. Afterwards, run `mint dev` again.
156165
</Accordion>
157166
</AccordionGroup>

0 commit comments

Comments
 (0)