Skip to main content
The jaspr create command initializes a new Jaspr project with your chosen configuration.

Basic Usage

jaspr create <directory>
# CLI will prompt for all options
jaspr create my_website

Project Presets

Configure your project’s rendering mode, routing, and features during creation.

Rendering Mode

--mode
option
default:"interactive"
Choose the rendering mode for your project.Options:
  • static - Build a statically pre-rendered site
  • server - Build a server-rendered site
  • client - Build a purely client-rendered site
jaspr create my_site --mode server
Pre-renders all routes at build time. Best for:
  • Marketing sites
  • Blogs and documentation
  • Sites with known routes
jaspr create docs_site --mode static

Routing Strategy

--routing
option
default:"interactive"
Choose how routing is handled in your application.Options:
  • none - No preconfigured routing
  • multi-page - Server-side routing (recommended for server/static modes)
  • single-page - Client-side routing (for SPAs)
jaspr create my_site --routing multi-page
Multi-page routing is only available in server and static modes. Client mode can use single-page or none.
# Server-side routing with separate pages
jaspr create my_site \
  --mode server \
  --routing multi-page

Flutter Support

--flutter
option
default:"interactive"
Configure Flutter integration for your project.Options:
  • none - No Flutter support
  • embedded - Embed a Flutter app within your site
  • plugins-only - Enable Flutter web plugins without embedding
jaspr create my_site --flutter embedded
Embeds a complete Flutter application within your Jaspr site.
jaspr create hybrid_app --flutter embedded
Use cases:
  • Mixing Jaspr pages with Flutter widgets
  • Gradual migration from Flutter Web
  • Rich interactive components
Enables use of Flutter web plugins without embedding the full Flutter runtime.
jaspr create my_site --flutter plugins-only
Use cases:
  • Using Flutter packages (e.g., url_launcher, shared_preferences)
  • Lighter weight than full embedding

Backend Framework

--backend
option
default:"interactive"
Choose a custom backend framework (only valid in server mode).Options:
  • none - Use Jaspr’s built-in server
  • shelf - Integrate with the Shelf package
jaspr create api_server \
  --mode server \
  --backend shelf
The --backend option is only available when --mode is set to server.

Templates

--template
option
Use a predefined template instead of the default scaffold.Available templates:
  • docs - A template for creating documentation sites with jaspr_content
jaspr create my_docs --template docs

Documentation Template

Create a documentation site with jaspr_content:
jaspr create my_docs --template docs
This template includes:
  • Pre-configured jaspr_content package
  • Documentation-optimized layout
  • Navigation and search
  • Markdown content support

Additional Options

--pub-get
flag
default:"true"
Run dart pub get after creating the project.
# Skip dependency installation
jaspr create my_site --no-pub-get
--verbose
flag
default:"false"
Enable verbose logging during project creation.
jaspr create my_site --verbose

Output Example

$ jaspr create my_website --mode server --routing multi-page

 Generating project... (1.2s)
 Generated 15 file(s)
 Resolving dependencies... (3.4s)

Created project my_website! In order to get started, run the following commands:

  cd my_website
  jaspr serve

Project Structure

The generated project structure varies based on your configuration:
my_website/
├── lib/
│   ├── main.server.dart    # Server entry point
│   ├── app.dart            # Root component
│   ├── components/         # Reusable components
│   └── pages/              # Page components (if routing enabled)
├── web/
│   ├── main.dart           # Client entry point
│   └── index.html
├── pubspec.yaml
└── build.yaml              # Build configuration

Complete Examples

jaspr create my_blog \
  --mode static \
  --routing multi-page \
  --flutter none \
  --pub-get

Validation Rules

The following validation rules apply:
  • Directory must not exist (or be empty if using .)
  • Project name must match pattern: [a-z_][a-z0-9_]*
  • Multi-page routing requires server or static mode
  • Backend option only valid in server mode

Next Steps

After creating your project:
1

Navigate to your project

cd my_website
2

Start the development server

jaspr serve
See the serve command documentation for development options.
3

Build for production

jaspr build
See the build command documentation for build options.

Quick Start Guide

Learn more about building your first Jaspr application

Build docs developers (and LLMs) love