Getting Started
Create and publish your first documentation site with Scalar Docs in minutes. Write guides in Markdown or MDX, add API documents for interactive API references, and deploy from GitHub, the CLI, or the web editor.
Create docs in three steps
Start a project
Create a Docs project from the dashboard, the Starter Kit, or any folder that contains a scalar.config.json file.
npx @scalar/cli project preview
Add guides and APIs
Write guides in Markdown or MDX, then add API documents for interactive API references.
{
"scalar": "2.0.0",
"navigation": {
"routes": {
"/getting-started": {
"type": "page",
"filepath": "docs/getting-started.md"
}
}
}
}
Preview, publish, and sync
Use preview deployments for review, publish from the CLI, or connect GitHub Actions for automatic deployments.
npx @scalar/cli project publish --slug your-docs
Start with an agent
Open your codebase in a coding agent, then copy and paste this prompt.
Create a Scalar Docs site for this codebase.
1. Read the codebase and write Markdown guides in `scalar-docs/pages/`. Start with a getting-started guide that explains what the project does, how to install it, and how to run a first example. Describe behavior you can verify from the code.
2. Add `scalar-docs/scalar.config.json` with `"scalar": "2.0.0"`, a site title in `info.title`, and a `navigation.routes` entry for each guide. Use file paths relative to `scalar-docs/`. If the codebase has an OpenAPI document, copy it into that folder and add an `openapi` route for it.
3. Run `npx -y @scalar/cli project check-config scalar-docs/scalar.config.json` from the repository root and fix any errors. From `scalar-docs/`, run `npx -y @scalar/cli project preview --no-open` and give me the local preview URL.
4. If I ask you to publish, confirm the project name and Scalar team with me. Use `npx -y @scalar/cli auth whoami` to check sign-in and `npx -y @scalar/cli auth login` if needed. Let me complete sign-in in my browser.
5. To publish, create the project with `npx -y @scalar/cli project create --name "<project name>" --json`. Use the returned slug to run `npx -y @scalar/cli project publish --slug <slug>` from `scalar-docs/`, then share the published URL. If my plan does not include publishing, keep the files and share the local preview instead.
Use Scalar's MCP server at `https://mcp.scalar.com/` for reference if it is already connected. The CLI can complete the workflow on its own.
Write anywhere
| Source | Description |
|---|---|
| GitHub | Keep content and API documents in your repository. Use preview deployments, automatic deployment, GitHub Actions, and scalar.config.json. |
| Any folder or CLI | Work from any folder or repository without granting repository access. Publish with npx @scalar/cli project publish --slug your-docs. |
| Web editor | Edit and store docs at docs.scalar.com. No Git required. |
Next steps
- Scaffold a project with the Starter Kit
- Configure your site with scalar.config.json
- Structure your sidebar with Navigation
- Deploy automatically with GitHub Actions
Just need an API reference? Use the API Reference. It is open source, free, and has integrations for REST API frameworks.
What did you think of this content?