Export a documentation site built with the Mintlify framework into a fully static bundle: plain HTML, assets, RSC payloads for client-side navigation, sitemap, robots.txt, llms.txt and materialized redirects. Host the result on any static server or CDN with no runtime dependencies.
staticmint drives your own local mint dev preview (a production Next.js server) and crawls it, so pages come out exactly as Mintlify renders them.
staticmint runs docs.miget.com in production.
mint dev gives you a full local preview of your docs, but there is no self-serve way to turn it into files you can host yourself. staticmint fills that gap: run it against your docs repo and get a deployable directory.
- The
mintCLI (Node.js), logged-out local usage is fine - Go 1.23+ to install the tool
Download a prebuilt binary for Linux, macOS or Windows (amd64/x86_64 and arm64) from the releases page:
curl -fsSL -o /usr/local/bin/staticmint https://github.com/migetapp/staticmint/releases/latest/download/staticmint-linux-amd64
chmod +x /usr/local/bin/staticmintOr build from source:
go install github.com/migetapp/staticmint@latestFrom your docs repo (the directory containing docs.json):
staticmint -start-server -site-url https://docs.example.comThis starts mint dev, waits for it, exports everything into ./out, stops the server and verifies the result. Alternatively run against an already running preview:
mint dev --no-open &
staticmint -site-url https://docs.example.com -out distThe exit code is non-zero if any page or referenced asset failed to export, which makes it safe to gate CI and image builds on.
-base string mint dev server origin (default "http://127.0.0.1:3000")
-out string output directory, deleted and recreated (default "out")
-site-url string canonical site URL for sitemap.xml, robots.txt and llms.txt (required)
-docs string docs repo directory (default ".")
-client-dir string mintlify client app directory (default "~/.mintlify/mint/apps/client")
-mint-bin string mint CLI binary (default "mint")
-inject-head string extra HTML injected before </head> in every page
-start-server start "mint dev" and stop it when done
-copy-md copy source .mdx files as <route>.md companions (default true)
-keep-preview-badge keep the floating Mintlify preview toolbar (default false)
-allow-indexing robots.txt allows indexing (default true)
-rsc export RSC payloads for client-side navigation (default true)
-wait-tries int 2s-interval readiness checks (default 60; raise in CI)
-concurrency int parallel page fetches (default 8)
- Enumerates every route from the fully resolved navigation (
generatedDocsNav.json, which includes pages auto-generated from OpenAPI specs) plus every.mdxfile in the repo, since hidden pages are routable without being in the navigation. - Saves each route as
route/index.html, plusroute/index.rsc, the React flight payload the Next router requests during client-side navigation. - Copies the entire
_next/staticbuild tree from disk, so lazy-loaded chunks and fonts always resolve, and fetches every asset referenced by the exported HTML. - Exports the styled 404 page as
404.htmlandfavicon.ico. - Copies each page's MDX source as
route.mdand generatesllms.txtandllms-full.txtwhen the server does not provide them. - Materializes
docs.jsonredirects as static stubs, and generatessitemap.xmlandrobots.txtfrom the real exported route list. - Hides the local-preview toolbar the client mounts on every page, and injects any
-inject-headHTML. - Verifies that every internal link and asset reference in the bundle resolves, and reports what does not.
The bundle uses clean URLs (route/index.html), so any host that serves index.html for directory paths works. For the best result your server should also:
- Serve
404.htmlas the custom 404 page. - Serve
route/index.rscwith content typetext/x-componentwhen a request carries theRSC: 1header. This keeps Mintlify's instant client-side navigation working. Without it, every click degrades gracefully to a full page load. CDN caching stays correct either way because the Next router appends a?_rsc=cache-buster to those requests.
See examples/nginx.conf for a complete config implementing both.
Re-run the export on every content change; the bundle is a snapshot.
- The search box posts to
/api/search, which needs a backend you provide (any search service behind that path), otherwise search does not function in the static bundle. .mdlinks on pages auto-generated from OpenAPI specs return 404, since those have no MDX source and the hosted.mdrenderer is not part of the local preview.- staticmint depends on Mintlify internals: the
~/.mintlifylayout,generatedDocsNav.jsonand the flight payload behavior. Tested againstmint4.2.800 with client 0.0.3447. Pin yourmintversion for reproducible builds; a breaking upstream change fails the export loudly rather than producing a broken site. - Windows binaries are provided and cross-compile cleanly (
-start-serverstops themint devprocess tree viataskkill), but Windows is not yet tested end to end; Linux and macOS are. WSL is the well-trodden path on Windows.
staticmint itself is MIT licensed and contains no Mintlify code.
The exported bundle embeds the compiled Mintlify client runtime, which is licensed under the Elastic License 2.0 by Mintlify, Inc. Hosting your own documentation with it is fine. Do not use the export to offer Mintlify's functionality to third parties as a hosted or managed service, and do not remove license or copyright notices from the bundle.
staticmint is not affiliated with, sponsored by, or endorsed by Mintlify, Inc. "Mintlify" is a trademark of Mintlify, Inc., used here only to identify the software this tool works with.