Get started with Scalar Docs
1
Start a project
Create a project from the dashboard or a starter kit. To preview an existing project locally, run:
npx @scalar/cli project preview2
Add guides and API documents
Write guides in Markdown or MDX, then add API documents for interactive API references. A navigation route can point to a page such as docs/getting-started.md in scalar.config.json:
{
"navigation": {
"routes": {
"/getting-started": {
"type": "page",
"filepath": "docs/getting-started.md"
}
}
}
}3
Preview, publish, and sync
Use preview deployments for review, publish from the CLI, or connect GitHub Actions for automatic deployments. To publish from your terminal, run:
npx @scalar/cli project publishChoose where to work#
| Source | Use it for |
|---|---|
| GitHub | Keep guides and API documents in your repository and review changes through pull requests. |
| CLI | Work from any folder or repository and publish from your terminal or CI provider. |
| Web editor | Edit and store documentation in the hosted Scalar editor without Git. |
The CLI and GitHub workflows let you preview changes before publishing. Use the web editor when you want to edit and store documentation without managing a Git repository.