Skip to main content
The Jaspr CLI is a comprehensive command-line tool for managing Jaspr web applications. It provides commands for project creation, development, and production builds.

Installation

Install the Jaspr CLI globally using Dart’s pub tool:
dart pub global activate jaspr_cli
Verify the installation:
jaspr --version
The CLI requires Dart SDK 3.8.0 or later.

Available Commands

The Jaspr CLI provides the following core commands:

create

Create a new Jaspr project with customizable templates and presets

serve

Run a development server with hot reload for rapid iteration

build

Build your project for production deployment

doctor

Check your environment and diagnose common issues

Quick Start

Create and run a new Jaspr project:
1

Create a new project

jaspr create my_website
The CLI will prompt you to configure your project with options for:
  • Rendering mode (static, server, or client)
  • Routing strategy (none, multi-page, or single-page)
  • Flutter support (none, embedded, or plugins-only)
  • Backend framework (for server mode)
2

Navigate to your project

cd my_website
3

Start the development server

jaspr serve
Your app will be available at http://localhost:8080 with hot reload enabled.
4

Build for production

jaspr build
The compiled output will be in build/jaspr/.

Global Flags

These flags are available for all commands:
--verbose
flag
default:"false"
Enable verbose logging to see detailed output and debugging information.
jaspr serve --verbose
--help
flag
default:"false"
Display help information for any command.
jaspr build --help

Command Categories

Project Commands

Commands for managing your Jaspr project lifecycle:
  • create - Initialize a new project
  • serve - Run development server
  • build - Build for production

Utility Commands

  • doctor - Diagnose environment issues
  • update - Update Jaspr dependencies
  • clean - Clean build artifacts
  • migrate - Migrate projects between versions

Terminal Output

The CLI uses color-coded tags to distinguish between different processes:
[CLI] Running jaspr in server rendering mode.
[CLI] Starting web compiler...
[CLI] Building web assets...
[CLIENT] Compiled main.dart
[SERVER] Server started on port 8080
[CLI] Done building web assets.

Configuration

The CLI reads configuration from your pubspec.yaml:
pubspec.yaml
name: my_website

jaspr:
  mode: server  # static, server, or client
  port: 8080    # Default port for development

Environment Requirements

  • Minimum version: 3.8.0
  • Latest stable version recommended
  • Install from dart.dev
  • Required only for Flutter embedding or plugin support
  • Version 3.22.0 or later recommended
  • Install from flutter.dev
  • Chrome recommended for debugging with DevTools
  • Use --launch-in-chrome flag to auto-launch

Troubleshooting

If you encounter issues, run the doctor command:
jaspr doctor
Common issues:
Ensure ~/.pub-cache/bin is in your PATH:
export PATH="$PATH:$HOME/.pub-cache/bin"
Specify a different port:
jaspr serve --port 3000
Clean build artifacts and try again:
jaspr clean
jaspr build

Next Steps

Create Command

Learn about project creation options and templates

Serve Command

Explore development server features and hot reload

Build Command

Understand production build options and optimization

Quick Start

Follow the complete getting started guide

Build docs developers (and LLMs) love