Astro CLI Commands
Use these commands from the root of an Astro project.
Project commands
Section titled “Project commands”Start the local development server.
npm run devBuild the production site.
npm run buildPreview the production build locally.
npm run previewAstro CLI
Section titled “Astro CLI”Run Astro CLI commands through the project script.
npm run astro -- --helpCheck the project for type, content, and config issues.
npm run astro -- checkAdd an integration.
npm run astro -- add starlightCreate a new Astro project
Section titled “Create a new Astro project”Create a new Astro app.
npm create astro@latest APP_NAMECreate a new Starlight docs site.
npm create astro@latest APP_NAME -- --template starlightDependency commands
Section titled “Dependency commands”Install dependencies.
npm installInstall a package.
npm install PACKAGE_NAME