Download a Mintlify docs site as a local directory of Markdown files.
"dmint" = download Mintlify. Point it at any Mintlify-hosted docs site and it mirrors every page as plain Markdown, preserving the site's URL structure as a local directory tree. Useful for backing up docs, tracking content changes over time in git, and giving AI agents (like Claude Code) a complete local copy of a docs site to search and read.
With Bun installed:
bun install -g @mkdnsite/dmint
# or, if you prefer npm as the installer (Bun is still required at runtime)
npm install -g @mkdnsite/dmintThe npm package is scoped (npm considers the bare name dmint too similar to existing packages), but the installed command is plain dmint.
The npm package runs the TypeScript source directly on Bun, so Bun >= 1.2 must be on your PATH.
No Bun? Use a standalone binary (Bun runtime included) from the latest release, or Homebrew:
brew install mkdnsite/tap/dmintEvery release binary carries a signed build-provenance attestation. Verify one with:
gh attestation verify dmint-darwin-arm64 --repo mkdnsite/dmintUsage: dmint <url> [dir] [options]
Arguments:
<url> Base URL of the Mintlify docs site, e.g. https://docs.example.com [required] [string]
[dir] Output directory, created if missing (default: current directory) [dir]
Options:
-c, --concurrency <n> Concurrent page downloads [number] [default: 8]
-p, --prune Delete local .md files that are no longer in the sitemap [boolean]
-y, --yes Skip confirmation prompts (assume yes) [boolean]
-n, --dry-run Show what would be downloaded or deleted without writing [boolean]
-q, --quiet Only print errors and the final summary [boolean]
-h, --help Show help [boolean]
-v, --version Show version number [boolean]
mkdir acme-docs && cd acme-docs
dmint https://docs.acme.com
# ✓ index.md
# ✓ introduction.md
# ✓ guides/quickstart.md
# ...
# ✓ llms.txt
# ✓ sitemap.xml
# Downloaded 82 of 82 pages + llms.txt + sitemap.xml to . in 6.1smkdir acme-docs && cd acme-docs && git init
dmint https://docs.acme.com --quiet
git add -A && git commit -m "docs snapshot $(date +%F)"
# ...later: re-run and see exactly what changed
dmint https://docs.acme.com --prune --yes --quiet
git diff --statFiles are written byte-for-byte as the server serves them, so an unchanged page produces no git diff. --prune keeps the tree an exact mirror by deleting local .md files whose pages left the sitemap — it lists the files and asks first unless you pass --yes, and it never touches non-Markdown files, dot-directories, or node_modules.
- Fetches
<url>/sitemap.xml(following sitemap-index files if present). - Maps every
<loc>entry to a local path:https://docs.acme.com/guides/setupbecomesguides/setup.md. A base path in the URL (e.g.mintlify.com/docs) is stripped from local paths. - Downloads the Markdown rendition of each page by appending
.mdto its URL — a feature of Mintlify hosting — with limited concurrency and retries (2 retries with exponential backoff on 429/5xx/network errors). - Also fetches the site root as
index.md(even when the sitemap omits it),llms.txtif present, and saves a verbatim copy ofsitemap.xml.
Some Mintlify sites sit behind Cloudflare Bot Management, which challenges any client whose TLS fingerprint is not a real browser's. dmint therefore fetches through impit, a browser-impersonation HTTP client, by default. Set DMINT_TRANSPORT=fetch to use plain fetch instead.
| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | Usage error, or one or more pages failed to download |
| 4 | Network failure — the sitemap could not be fetched or parsed |
Progress and results go to stdout; warnings and errors go to stderr. --quiet suppresses per-file progress but keeps the final summary.
| Variable | Description |
|---|---|
DMINT_TRANSPORT |
impit (default) fetches with a browser-impersonation client; fetch uses plain fetch with a dmint/<version> user-agent |
bun install # install dependencies
bun test # run the test suite (bun:test)
bun run lint # ts-standard
bun run compile # build a standalone binary at dist/dmint
bun src/cli.ts # run from sourceReleases are automated with release-please:
- Merge Conventional Commit PRs to
main; release-please accumulates them into a Release PR. - Merge the Release PR. This tags the release, publishes
@mkdnsite/dmintto npm via Trusted Publishing (with provenance), compiles standalone binaries for macOS/Linux/Windows (plus musl), attests them, uploads them to the GitHub Release, and updates the Homebrew formula in mkdnsite/homebrew-tap.
MIT © Andrew Goode