create-specra
Scaffold a new Specra documentation site in seconds
create-specra
create-specra is the official CLI tool for scaffolding new Specra documentation sites. It sets up everything you need in seconds: project structure, dependencies, configuration, and sample content.
create-specra also includes commands for deploying, authentication, and diagnostics. See the full CLI Reference for all available commands.
Quick Start
The fastest way to create a new documentation site:
This creates a new directory called my-docs with everything configured and ready to go.
What Gets Created
When you run create-specra, here's what you get:
1my-docs/2├── src/3│ ├── app.css # Global styles (imports specra/styles)4│ ├── app.html # HTML template5│ └── routes/6│ ├── +layout.server.ts # Load Specra config7│ ├── +layout.svelte # Root layout with Specra components8│ ├── +page.server.ts # Landing page redirect9│ └── docs/10│ └── [version]/11│ └── [...slug]/12│ ├── +page.server.ts # Load doc data13│ └── +page.svelte # Doc page renderer14├── docs/15│ ├── v1.0.0/ # Version 1 docs (MDX files)16│ └── v2.0.0/ # Version 2 docs (MDX files)17├── public/18│ └── api-specs/ # API spec files (OpenAPI, Postman)19├── specra.config.json # Specra configuration20├── package.json # Dependencies and scripts21├── svelte.config.js # SvelteKit configuration22├── vite.config.ts # Vite configuration23├── postcss.config.mjs # PostCSS (for Tailwind)24├── tsconfig.json # TypeScript config25└── .gitignoreTemplates
create-specra offers three templates to choose from:
Minimal (Default)
Clean starting point with basic structure:
- System theme (follows OS preference)
- Card-style sidebar with rounded container
- Table of contents enabled
- Simple docs: about page, getting started guide, component examples
1npx create-specra my-docs --template minimalBook Docs
Knowledge base style inspired by platforms like GitBook:
- Dark theme by default
- Flush sidebar (attached to screen edge)
- Categorized sidebar with section headers (Content, Customization)
- Site-wide banner
- Version badge in sidebar
- Rich sample content with cards on landing page
1npx create-specra my-docs --template book-docsJBrains Docs
Reference documentation style with tabbed navigation:
- Light theme by default
- Flush sidebar (attached to screen edge)
- Tab groups for organizing content (Language, Multiplatform)
- Collapsible tree-style sidebar
- No table of contents (right panel)
- Version badge in sidebar
1npx create-specra my-docs --template jbrains-docsInteractive Setup
When you run create-specra without options, it will prompt you for:
Project name (if not provided as argument)
1npx create-specra@latest2# Prompts: What is your project named?Template (if not provided via --template)
1# Will ask: Which template do you want to use?2# Options: Minimal, Book Docs, JBrains DocsPackage manager preference (if multiple are detected)
1# Will ask: Which package manager do you want to use?2# Options: npm, yarn, pnpmThe CLI detects what's available on your system and suggests the best option.
Command Options
Basic Usage
1npx create-specra@latest [project-name] [options]Examples
Create with a specific name:
1npx create-specra@latest my-awesome-docsCreate in current directory:
1npx create-specra@latest .Use a specific template:
1npx create-specra@latest my-docs --template minimal2npx create-specra@latest my-docs --template book-docs3npx create-specra@latest my-docs --template jbrains-docsUse a specific package manager:
1npx create-specra@latest my-docs --use-npm2npx create-specra@latest my-docs --use-yarn3npx create-specra@latest my-docs --use-pnpmSkip package installation:
1npx create-specra@latest my-docs --skip-installWhat Happens Next
After scaffolding completes, follow these steps:
Navigate to your project
1cd my-docsStart the dev server
Open [http://localhost:5173](http://localhost:5173) to see your site.
Default Configuration
The generated specra.config.json includes sensible defaults:
1{2 "site": {3 "title": "My Documentation",4 "description": "Documentation site built with Specra",5 "url": "http://localhost:5173",6 "baseUrl": "/",7 "activeVersion": "v1.0.0"8 },9 "theme": {10 "defaultMode": "system",11 "respectPrefersColorScheme": true12 },13 "navigation": {14 "showSidebar": true,15 "collapsibleSidebar": true,16 "showBreadcrumbs": true,17 "showTableOfContents": true,18 "tocPosition": "right"19 },20 "features": {21 "showLastUpdated": true,22 "showReadingTime": true,23 "versioning": true24 }25}You can customize any of these settings. See Configuration for all available options.
Sample Content
Each template includes sample documentation to help you get started. The content varies by template:
Minimal — About page, getting started guide, and component examples Book Docs — Introduction with card grid, quickstart, concepts, and categorized sections (Content, Customization) JBrains Docs — Home page with cards, getting started, and tabbed sections (Basics, Advanced, Tools)
All templates include two doc versions (v1.0.0 and v2.0.0) to demonstrate the versioning system. Feel free to delete or modify any sample pages.
Available Scripts
The generated package.json includes these scripts:
| Script | Command | Description |
|---|---|---|
dev | vite dev | Start development server with hot reload |
build | vite build | Build for production (uses adapter-node by default) |
preview | vite preview | Preview the production build locally |
check | svelte-kit sync && svelte-check | Run type checking |
Updating Specra
To update to the latest version of Specra in your project:
Check the changelog for breaking changes before updating major versions.
Troubleshooting
Command not found
If you get "command not found" errors:
Check Node.js version:
1node --version2# Should be 18.0.0 or higherTry with full npx path:
1npx create-specra@latest my-docsPermission errors
On Linux/macOS, you might need to adjust npm permissions:
1sudo chown -R $USER ~/.npmOr use a node version manager like nvm.
Installation fails
If dependency installation fails:
- Delete
node_modulesand lock file - Clear package manager cache
- Try again
1rm -rf node_modules package-lock.json2npm cache clean --force3npm installNext Steps
Now that you have a Specra site set up:
Write Your First Page
Learn how to create and organize documentation
Configure Your Site
Customize branding, navigation, and features
Explore Components
Discover all available MDX components
Deploy to Production
Ship your docs to Specra Cloud, GitHub Pages, or Netlify
CLI Reference
Login, deploy, diagnose, and manage from the terminal