# Templates
[EN] Source: https://mastra.ai/docs/getting-started/templates

Templates are pre-built Mastra projects that demonstrate specific use cases and patterns. Browse available templates in the [templates directory](https://mastra.ai/templates).

## Using Templates

Install a template using the `create-mastra` command:

<Tabs>
  <TabItem value="npm" label="npm">
    ```bash copy
    npx create-mastra@latest --template template-name
    ```
  </TabItem>
  <TabItem value="yarn" label="yarn">
    ```bash copy
    yarn dlx create-mastra@latest --template template-name
    ```
  </TabItem>
  <TabItem value="pnpm" label="pnpm">
    ```bash copy
    pnpm create mastra@latest --template template-name
    ```
  </TabItem>
  <TabItem value="bun" label="bun">
    ```bash copy
    bun create mastra@latest --template template-name
    ```
  </TabItem>
</Tabs>

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

```bash copy
npx create-mastra@latest --template text-to-sql
```

## Setting Up a Template

After installation:

1. **Navigate to your project**:

   ```bash copy
   cd your-project-name
   ```

2. **Configure environment variables**:

   ```bash copy
   cp .env.example .env
   ```

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

3. **Start development**:
   ```bash copy
   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](/reference/templates/overview).


---
title: "About Mastra"
sidebar_position: 2
sidebar_label: "Introduction"
description: "Mastra is an all-in-one framework for building AI-powered applications and agents with a modern TypeScript stack."
---

import YouTube from "@site/src/components/YouTube-player";