Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 44 additions & 2 deletions installation.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: "CLI installation"

Check warning on line 2 in installation.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

installation.mdx#L2

Use 'command-line tool' instead of 'CLI'.
description: "Use the CLI to preview docs locally, test changes in real-time, and catch issues before deploying your documentation site."
keywords: ["CLI", "npm", "local development", "Node.js"]

Check warning on line 4 in installation.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

installation.mdx#L4

Use 'command-line tool' instead of 'CLI'.
---

<img
Expand All @@ -15,14 +15,14 @@
alt="Decorative graphic representing the CLI."
/>

Use the CLI to preview your documentation locally as you write and edit. View changes in real-time before deploying, test your documentation site's appearance and functionality, and catch issues like broken links or accessibility problems.

Check warning on line 18 in installation.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

installation.mdx#L18

Use 'capability' or 'feature' instead of 'functionality'.

The CLI also has utilities for maintaining your documentation, including commands to rename files, validate OpenAPI specifications, and migrate content between formats.

Check warning on line 20 in installation.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

installation.mdx#L20

Use 'command-line tool' instead of 'CLI'.

## Install the CLI

<Info>
**Prerequisite**: The CLI requires [Node.js](https://nodejs.org/en) v20.17.0 or higher through v24. LTS versions are preferred.

Check warning on line 25 in installation.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

installation.mdx#L25

': T' should be in lowercase.

Check warning on line 25 in installation.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

installation.mdx#L25

Spell out 'LTS', if it's unfamiliar to the audience.

Check warning on line 25 in installation.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

installation.mdx#L25

In general, use active voice instead of passive voice ('are preferred').
</Info>

Run the following command to install the [CLI](https://www.npmjs.com/package/mint):
Expand All @@ -39,7 +39,7 @@

## Preview locally

To generate a local preview, navigate to your documentation directory (where your `docs.json` file is located) and run the following command:

Check warning on line 42 in installation.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

installation.mdx#L42

In general, use active voice instead of passive voice ('is located').

```bash
mint dev
Expand All @@ -47,7 +47,7 @@

A local preview of your documentation is available at `http://localhost:3000`.

Alternatively, if you do not want to install the CLI globally, you can run a one-time script:

Check warning on line 50 in installation.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

installation.mdx#L50

Use 'don't' instead of 'do not'.

Check warning on line 50 in installation.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

installation.mdx#L50

Use 'command-line tool' instead of 'CLI'.

```bash
npx mint dev
Expand All @@ -55,13 +55,13 @@

### Custom ports

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:

Check warning on line 58 in installation.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

installation.mdx#L58

Use 'command-line tool' instead of 'CLI'.

Check warning on line 58 in installation.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

installation.mdx#L58

Use 'command-line tool' instead of 'CLI'.

```bash
mint dev --port 3333
```

If you attempt to run on a port that is already in use, it will use the next available port:

Check warning on line 64 in installation.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

installation.mdx#L64

Use 'that's' instead of 'that is'.

Check warning on line 64 in installation.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

installation.mdx#L64

Avoid using 'will'.

```mdx
Port 3000 is already in use. Trying 3001 instead.
Expand All @@ -85,13 +85,13 @@
mint new [directory]
```

This command clones the [starter kit](https://github.com/mintlify/starter) into a specified directory. If no directory is specified, the CLI tool prompts you to create a new subdirectory or overwrite the current directory.

Check warning on line 88 in installation.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

installation.mdx#L88

In general, use active voice instead of passive voice ('is specified').

Check warning on line 88 in installation.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

installation.mdx#L88

Use 'command-line tool' instead of 'CLI'.

<Warning>
If you overwrite the current directory, any existing files in the directory will be deleted.

Check warning on line 91 in installation.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

installation.mdx#L91

Avoid using 'will'.

Check warning on line 91 in installation.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

installation.mdx#L91

In general, use active voice instead of passive voice ('be deleted').
</Warning>

The CLI tool prompts you for a project name and [theme](/customize/themes) to finish setting up your project.

Check warning on line 94 in installation.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

installation.mdx#L94

Use 'command-line tool' instead of 'CLI'.

You can run `mint new` with the following flags:

Expand All @@ -104,15 +104,15 @@
```bash
mint new docs --name my-project --theme linden
```
## Update the CLI

Check warning on line 107 in installation.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

installation.mdx#L107

Use 'command-line tool' instead of 'CLI'.

If your local preview is out of sync with what you see on the web in the production version, update your local CLI:

Check warning on line 109 in installation.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

installation.mdx#L109

Use 'command-line tool' instead of 'CLI'.

```bash
mint update
```

If this `mint update` command is not available on your local version, re-install the CLI with the latest version:

Check warning on line 115 in installation.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

installation.mdx#L115

Use 'isn't' instead of 'is not'.

Check warning on line 115 in installation.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

installation.mdx#L115

Use 'command-line tool' instead of 'CLI'.

<CodeGroup>
```bash npm
Expand Down Expand Up @@ -150,7 +150,7 @@
mint openapi-check <OpenAPI filename or URL>
```

Pass a filename (for example, `./openapi.yaml`) or a URL (for example, `https://petstore3.swagger.io/api/v3/openapi.json`).

Check warning on line 153 in installation.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

installation.mdx#L153

Use parentheses judiciously.

### Rename files

Expand All @@ -172,11 +172,53 @@

## Formatting

While developing locally, we recommend using extensions in your IDE to recognize and format MDX files.

Check warning on line 175 in installation.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

installation.mdx#L175

Try to avoid using first-person plural like 'we'.

If you use Cursor, Windsurf, or VS Code, we recommend the [MDX VS Code 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.
### VS Code, Cursor, and Windsurf

Check warning on line 177 in installation.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

installation.mdx#L177

'VS Code, Cursor, and Windsurf' should use sentence-style capitalization.

If you use JetBrains, we recommend the [MDX IntelliJ IDEA plugin](https://plugins.jetbrains.com/plugin/14944-mdx) for syntax highlighting, and setting up [Prettier](https://prettier.io/docs/webstorm) for code formatting.
Install the following extensions:

- [MDX VS Code extension](https://marketplace.visualstudio.com/items?itemName=unifiedjs.vscode-mdx) for syntax highlighting
- [Prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) for code formatting

To enable formatting on save, add the following to your `.vscode/settings.json`:

```json
{
"[mdx]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
}
}
```

### JetBrains IDEs

Install the following plugins:

- [MDX IntelliJ IDEA plugin](https://plugins.jetbrains.com/plugin/14944-mdx) for syntax highlighting
- [Prettier](https://prettier.io/docs/webstorm) for code formatting

To enable Prettier for MDX files, go to **Settings > Languages & Frameworks > JavaScript > Prettier** and add `mdx` to the file extensions.

### Prettier configuration

Create a `.prettierrc` file in your documentation root to customize formatting:

```json
{
"semi": false,
"singleQuote": true,
"tabWidth": 2,
"proseWrap": "always"
}
```

To format all MDX files in your project, run:

```bash
npx prettier --write "**/*.mdx"
```

## Troubleshooting

Expand All @@ -189,7 +231,7 @@
3. Reinstall the mint CLI: `npm install -g mint`
</Accordion>
<Accordion title="Issue: Encountering an unknown error">
**Solution**: Go to the root of your device and delete the `~/.mintlify` folder. Afterwards, run `mint dev` again.

Check warning on line 234 in installation.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

installation.mdx#L234

': G' should be in lowercase.
</Accordion>
<Accordion title="Error: permission denied">
This is due to not having the required permissions to globally install node packages.
Expand All @@ -197,12 +239,12 @@
**Solution**: Try running `sudo npm i -g mint`. You will be prompted for your password, which is the one you use to unlock your computer.
</Accordion>
<Accordion title="The local preview doesn't look the same as my docs do on the web">
This is likely due to an outdated version of the CLI.

Check warning on line 242 in installation.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

installation.mdx#L242

Use 'command-line tool' instead of 'CLI'.

**Solution:** Run `mint update` to get the latest changes.

Check warning on line 244 in installation.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

installation.mdx#L244

': R' should be in lowercase.
</Accordion>
<Accordion title="mintlify vs. mint package">
If you have any problems with the CLI package, you should first run `npm ls -g`. This command shows what packages are globally installed on your machine.

Check warning on line 247 in installation.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

installation.mdx#L247

Use 'command-line tool' instead of 'CLI'.

If you don't use npm or don't see it in the -g list, try `which mint` to locate the installation.

Expand Down