Skip to main content

Templates

Templates are pre-built Mastra projects that demonstrate specific use cases and patterns. Browse available templates in the templates directory.

Using Templates

Install a template using the create-mastra command:

npx create-mastra@latest --template template-name

For example, to create a text-to-SQL application:

npx create-mastra@latest --template text-to-sql

Setting Up a Template

After installation:

  1. Navigate to your project:

    cd your-project-name
  2. Configure environment variables:

    cp .env.example .env

    Edit .env with your API keys as specified in the template's README.

  3. Start development:

    npm run dev
info

Each template includes a comprehensive README with specific setup instructions and usage examples.

For detailed information on creating templates, see the Templates Reference.

On this page