Deploy a site
Runmint deploy from the documentation directory. The directory must contain a docs.json file.
https://<subdomain>.mintlify.site and prints a hosted Git repository URL and a short-lived write token. It does not upload files. The agent then:
- Clones the hosted repository into a separate directory, passing the write token as an
Authorization: Bearerheader for that Git process only. - Copies
docs.json, pages, and assets into the repository root. - Commits and pushes to
main. The push starts a build.
mint deploy again from the same directory to get a fresh write token, or pass --new --subdomain <name> to create another site.
Deploy on every push from GitHub
If your documentation lives in a GitHub repository,mint deploy --github sets up a workflow that deploys the site on every push to the repository’s default branch. The workflow authenticates with GitHub’s OIDC identity token, so the repository doesn’t store any secrets.
--github requires a GitHub origin remote and the GitHub CLI signed in with access to the repository.
- Provisions the site, or reuses the site from an earlier
mint deployin the same directory. - Trusts the repository and its default branch to deploy the site.
- Writes
.github/workflows/mintlify.ymlat the repository root.
mint deploy in GitHub Actions, which pushes the checked-out commit to the site.
If your docs live in a subdirectory, run the command from the repository root and pass the subdirectory with --directory. The subdirectory becomes the site root, and the workflow only runs when files in that subdirectory or the workflow itself change.
.github/workflows/mintlify.yml already exists with different contents, the command stops. Pass --force to overwrite it.
--github only works for unclaimed sites. To deploy a claimed site from GitHub, connect the repository from the dashboard.Claim the site
A site created withmint deploy expires 24 hours after the agent creates it unless a person claims it. The Expires line in the mint deploy output shows the exact time. When an unclaimed site expires, Mintlify deletes it.
When you claim a site, it moves into a new organization in your account and you become its admin, so you can manage it from the dashboard.
-
The agent runs:
The agent doesn’t need your email. If it already knows the email of your Mintlify account, it can pass
--email <email>to prefill the sign-in. - Open the claim link.
- Sign in to Mintlify with any account, or create one.
- Click Confirm. There is no code to send back to the agent.
mint claim from the same directory as mint deploy, or pass --directory. The CLI stores the agent’s credentials and reads them during the claim, so agents shouldn’t read or print them.
After you confirm, the claim page opens the new organization in the dashboard.
Check that the claim finished
mint claim doesn’t wait for you to confirm, and the agent has no claim code to submit. To check whether you’ve confirmed, the agent runs mint deploy again from the same directory:
- If you’ve confirmed, the command prints
This site has been claimed. Manage it in the Mintlify dashboard.and doesn’t issue a write token. - If the site isn’t claimed yet, the command prints a new write token as usual. Wait for you to click Confirm, then run it again.
mint claim again before you confirm prints a new claim link. It doesn’t report the claim status.
Use auth.md without the CLI
Agents that can’t install the CLI can followhttps://mintlify.com/auth.md. It describes the same flow as raw HTTP requests: register an anonymous agent identity, provision a site, and hand the account to a person through the claim page.
Add a custom domain
After you claim the site, an agent following auth.md can add a custom domain you ask for, at the domain root or under/docs. The agent gives you the DNS records to add: the TXT records first, then a CNAME to cname.mintlify.builders once they validate.
If you host under /docs and your domain serves another site, skip the CNAME, because it sends every path on the domain to Mintlify. Set up a reverse proxy for /docs instead.