mint

中文文档
4.2.1200发布于 2026/11/04Elastic-2.0ES Module

The Mintlify CLI

原始使用文档
文档目录8 节
  1. Mint CLI
  2. Installation
  3. Local preview
  4. Validate and check
  5. Create and manage content
  6. Export
  7. CLI management
  8. Get Started
Mintlify Logo

Mint CLI

The Mint CLI is the easiest way to build Mintlify apps from the command line.

Website Tweet

Built with ❤︎ by Mintlify

Installation

npm i -g mint

Requires Node 20.17 or higher. LTS versions recommended. Node 25+ is not supported.

Local preview

mint dev

Run at the root of your Mintlify project to preview changes locally. Opens in the browser by default.

mint dev

Options

FlagDescriptionDefault
--port <number>Port to run the preview on3000
--no-openSkip opening the preview in the browser—
--groups <group...>Mock user groups for local testing—
--disable-openapiDisable OpenAPI file generation—

Custom port

mint dev --port 3333

If the specified port is already in use, the CLI automatically tries the next available port.

Troubleshooting

If mint dev is not working, try these steps in order:

  1. Make sure you are running in a folder with a docs.json file.
  2. Run mint update to get the latest version of the CLI.
  3. Make sure you are using Node 20.17 or higher.
  4. Delete the contents of the .mintlify folder in your home directory.

Validate and check

mint validate

Validate the documentation build in strict mode. Exits with a non-zero code on any warning or error — useful in CI.

mint validate

Options

FlagDescription
--groups <group...>Mock user groups for validation
--disable <rules>Turn off rules or groups, e.g. --disable openapi to skip OpenAPI

Check for broken internal links in your project.

mint broken-links

Options

FlagDescription
--check-anchorsAlso validate anchor links like link-path#section against heading slugs
--check-externalAlso check external links for broken URLs
--check-snippetsAlso check links inside <Snippet> components

mint openapi-check <filename>

Check an OpenAPI spec for errors. Accepts a local file path or a URL.

mint openapi-check ./openapi.yaml
mint openapi-check https://petstore3.swagger.io/api/v3/openapi.json

mint a11y

Check for accessibility issues in your documentation. Also available as mint accessibility, mint accessibility-check, and mint a11y-check.

mint a11y

Options

FlagDescription
--skip-contrastSkip color contrast checks
--skip-alt-textSkip alt text checks on images and videos

Create and manage content

mint new [directory]

Create a new Mintlify documentation site. Defaults to the current directory.

mint new
mint new my-docs

Options

FlagDescription
--theme <name>Theme for the documentation site
--name <name>Name of the documentation project
--forceInitialize in a non-empty directory

mint rename <from> <to>

Rename a file and update all internal references to it throughout the project.

mint rename introduction.mdx overview.mdx

Options

FlagDescription
--forceRename files and skip errors

mint scrape <url>

Scrape an entire documentation site and convert it to Mintlify MDX files. Also available as mint scrape site <url>.

mint scrape https://example.com/docs

Options

FlagDescription
--filter <path>Only scrape URLs matching this path (e.g. /docs matches /docs and /docs/*)

mint scrape page <url>

Scrape a single documentation page and convert it to an MDX file.

mint scrape page https://example.com/docs/introduction

mint scrape openapi <location>

Generate MDX files from an OpenAPI spec. Accepts a local file path or a URL.

mint scrape openapi ./openapi.yaml
mint scrape openapi https://petstore3.swagger.io/api/v3/openapi.json

Options

FlagDescriptionDefault
--outDir <path>Folder to write the generated files—
--overwriteOverwrite existing filesfalse

mint migrate-mdx

Migrate MDX OpenAPI endpoint pages to x-mint extensions and docs.json.

mint upgrade

Upgrade mint.json to docs.json. Creates a docs.json from your existing mint.json.

mint workflow

Add a workflow to your documentation repository.

Export

mint export

Export a static site as a zip file for air-gapped deployment.

mint export
mint export --output docs.zip

Options

FlagDescriptionDefault
--output <path>Output zip file pathexport.zip
--groups <group...>Mock user groups for export—
--disable-openapiDisable OpenAPI file generation—

The zip includes a serve.js server and a README.md with the rules for hosting the export on your own server: serve <path>/index.html for pages, answer requests with an RSC: 1 header or _rsc query parameter with <path>/index.txt as text/x-component so client-side navigation works, and cache _next/static and _mintlify/export-assets as immutable.

CLI management

mint update

Update the CLI to the latest version.

mint version

Display the current version of the CLI and client. Also available as mint v.

Get Started

Create an account to start using Mintlify for your documentation.

版本与发布记录

mint 共发布 1,283 个版本,首次发布于 2012/02/21;过去 12 个月发布了 1004 个版本。

版本发布日期距今
4.2.1200latest2026/11/04今天
4.2.11992026/11/041 天前
4.2.11982026/11/041 天前
4.2.11972026/11/041 天前
4.2.11962026/11/041 天前
4.2.11952026/11/041 天前

关于 mint 的常见问题

mint 是什么?

The Mintlify CLI

如何安装 mint?

在项目目录运行 npm install mint,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 mint,可以用 npx mint 直接运行。

mint 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/mint 是否存在。

mint 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

mint 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=18.0.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

mint 可以商用吗?

mint 使用 Elastic-2.0 许可。声明的许可为 Elastic-2.0,请阅读许可原文确认使用条件。以上为概括,不构成法律意见,请以许可原文为准。

mint 还在维护吗?

最新版本 4.2.1200 发布于 2026/11/04(今天);至今共发布 1283 个版本,其中过去 12 个月发布了 1004 个;首次发布于 2012/02/21。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。