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:
-
Navigate to your project:
cd your-project-name
-
Configure environment variables:
cp .env.example .env
Edit
.env
with your API keys as specified in the template’s README. -
Start development:
npm run dev
Each template includes a comprehensive README with specific setup instructions and usage examples.
For detailed information on creating templates, see the Templates Reference.