CLI
docStatic provides a set of scripts to help you generate, serve, and deploy your website. They are defined in the scripts section of your site's package.json, which is the authoritative list — run npm run with no arguments to print the scripts your site actually has.
The commands below are grouped by what they are for.
docStatic CLI commands
To invoke the commands, use npm or yarn. For example, npm run dev or yarn dev.
Key docStatic scripts:
dev: Start development server with TinaCMS integrationbuild: Build for production (runs TinaCMS build then Docusaurus build)build-local: Build locally without cloud featurescheck-links: Request every external link — both hardcoded in topics and stored in the URLs collection (reuse/urls/index.json) — and record the HTTP status each server returned, so the Link Health dashboard can report real 404s and 500s. Add--strictto exit with an error when broken links are found, which is what you want in a continuous integration job. See Dashboards.generate: Run every generator below in one go.prebuildandpredevcall this, so you rarely need it directly.generate-media-index: Generate index of media filesgenerate-git-identity: Generate git identity informationgenerate-files: Generate file lists for the applicationgenerate-docs-metadata: Generate metadata index used by dashboards and searchgenerate-link-report: Rebuild the link inventory without making any network requests. Results from the lastcheck-linksrun are carried forward, so a build never discards them.update-theme-css: Update theme CSS fileslint/lint:fix: Check, and optionally fix, formatting and code qualitymcp:install: Install Model Context Protocol server dependenciesmcp:build: Build the MCP server from TypeScriptmcp:dev: Start MCP server in development mode with auto-restartmcp:start: Start the compiled MCP server for AI assistant integrationmcp:test: Run MCP server connectivity tests
For more information about the MCP server, see MCP Server Integration.
These commands are built on top of standard Docusaurus commands described in CLI in the Docusaurus documentation:
docusaurusstartbuildswizzledeployclearservewrite-translationswrite-heading-ids
Automated commands
These run automatically, so you do not normally invoke them yourself:
prebuild,predevandprebuild-localeach rungeneratebefore a build or the dev server starts, which refreshes the media index, file lists, docs metadata, link inventory, theme CSS and git identity.prestartrefreshes the link inventory beforestart, so the Link Health dashboard has a report to display even if you have never runcheck-links.postinstallinstalls the MCP server's dependencies.
API commands
clean-api-docsgen-api-docsgen-graphql
For more information on the OpenAPI commands, refer to CLI Usage in the Docusaurus OpenAPI Plugin documentation.
For more information on the GraphQL command, refer to Usage in the Docusaurus GraphQL Plugin documentation.
Site creation and update commands
These commands come from the create-docstatic package rather than package.json, so they work anywhere—you don't need a docStatic site to run them.
npx create-docstatic@latest <project-name>: Create a new docStatic site. See Installation for details.npx create-docstatic@latest --update: Update an existing site to the latest docStatic release. Run it from the root folder of a site created withcreate-docstatic. It updates the docStatic-owned files and dependency versions, and leaves your content untouched.
The update command accepts these options:
--dry-run: Report what would change without writing anything.--force: Proceed even if the git working tree isn't clean. Without it, the command asks you to commit or stash your changes first so you can review the update withgit diff.--tag <dist-tag>: Update to a specificdocstaticpackage version or dist-tag instead oflatest.--no-install: Skip installing dependencies after the update.
Template sync commands
These commands only exist in the docStatic repository itself (and forks of it)—not in sites created with create-docstatic. They keep the scaffolding template in the template/ folder in sync with the main site.
The template is what npx create-docstatic@latest ships to new sites, so whenever you change code that the template shares with the main site—React components in src/, the build scripts in scripts/, tina/config.jsx, docusaurus.config.ts or sidebars.ts—the template needs the same change.
sync-template: Copy the shared code surface from the main site intotemplate/, align the template'spackage.jsondependencies and scripts, and regenerateupdate-manifest.json(the file thatnpx create-docstatic@latest --updateuses to update existing sites). Template content such as the starter docs and configuration values is left alone.sync-template:check: Report what would change without writing anything, and exit with an error if the template has drifted. The pre-commit hook runs this check, so a commit fails withtemplate out of syncuntil you runyarn sync-templateand stage the result.
A typical flow after changing a shared file:
yarn sync-template
git add template/ update-manifest.json
git commit
Linting commands
For more information about the linting commands, refer to CLI in the Biome documentation.
Related topics
- Configuration – Configuring your site's behaviour through docusaurus.config.ts and more.
- Internationalization – Translating documents with docStatic.
- Introduction – docStatic was designed from the ground up to be easily installed and used to get your website up and running quickly.
- Creating pages – Creating pages in the CMS.
- Static assets – Static assets are the non-code files that are directly copied to the build output. Learn about how they are handled and the best practices for using static assets.
- Hosted CMS – Using docStatic with cloud-hosted or self-hosted TinaCMS.
- Upgrading – Upgrading Node.js modules.