Skip to content
Merged
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
8 changes: 8 additions & 0 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,18 +55,26 @@

### 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.
```

## Skip OpenAPI processing

If you have many OpenAPI files, skip OpenAPI file processing during local development to improve performance by using the `--disable-openapi` flag:

```bash
mint dev --disable-openapi
```

### Preview as a specific group

If you use partial authentication to restrict access to your documentation, you can preview as a specific authentication group by using the `--groups [groupname]` flag.
Expand All @@ -85,13 +93,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 96 in installation.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

installation.mdx#L96

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

Check warning on line 96 in installation.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

installation.mdx#L96

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 99 in installation.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

installation.mdx#L99

Avoid using 'will'.

Check warning on line 99 in installation.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

installation.mdx#L99

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 102 in installation.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

installation.mdx#L102

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

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

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

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

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 117 in installation.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

installation.mdx#L117

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 123 in installation.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

installation.mdx#L123

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

Check warning on line 123 in installation.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

installation.mdx#L123

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

<CodeGroup>
```bash npm
Expand Down Expand Up @@ -150,7 +158,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 161 in installation.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

installation.mdx#L161

Use parentheses judiciously.

### Rename files

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

## Formatting

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

Check warning on line 183 in installation.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

installation.mdx#L183

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.

Check warning on line 185 in installation.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

installation.mdx#L185

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

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.

Check warning on line 187 in installation.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

installation.mdx#L187

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

## Troubleshooting

Expand All @@ -189,7 +197,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 200 in installation.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

installation.mdx#L200

': 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 +205,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 208 in installation.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

installation.mdx#L208

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

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

Check warning on line 210 in installation.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

installation.mdx#L210

': 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 213 in installation.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

installation.mdx#L213

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