# Template system

> Template system - Pre-configured application scaffolds for building and deploying custom
> applications to DataRobot.

This Markdown file sits beside the HTML page at the same path (with a `.md` suffix). It summarizes the topic and lists links for tools and LLM context.

Companion generated at `2026-05-06T18:17:09.552293+00:00` (UTC).

## Primary page

- [Template system](https://docs.datarobot.com/en/docs/agentic-ai/cli/template-system/index.html): Full documentation for this topic (HTML).

## Sections on this page

- [Documentation](https://docs.datarobot.com/en/docs/agentic-ai/cli/template-system/index.html#documentation): In-page section heading.
- [Core concepts](https://docs.datarobot.com/en/docs/agentic-ai/cli/template-system/index.html#core-concepts): In-page section heading.
- [Quickstart](https://docs.datarobot.com/en/docs/agentic-ai/cli/template-system/index.html#quickstart): In-page section heading.
- [Using a template](https://docs.datarobot.com/en/docs/agentic-ai/cli/template-system/index.html#using-a-template): In-page section heading.
- [Create a template](https://docs.datarobot.com/en/docs/agentic-ai/cli/template-system/index.html#create-a-template): In-page section heading.
- [Template types](https://docs.datarobot.com/en/docs/agentic-ai/cli/template-system/index.html#template-types): In-page section heading.
- [Single-page applications](https://docs.datarobot.com/en/docs/agentic-ai/cli/template-system/index.html#single-page-applications): In-page section heading.
- [Full-stack applications](https://docs.datarobot.com/en/docs/agentic-ai/cli/template-system/index.html#full-stack-applications): In-page section heading.
- [Microservices](https://docs.datarobot.com/en/docs/agentic-ai/cli/template-system/index.html#microservices): In-page section heading.
- [Common patterns](https://docs.datarobot.com/en/docs/agentic-ai/cli/template-system/index.html#common-patterns): In-page section heading.
- [Database configuration](https://docs.datarobot.com/en/docs/agentic-ai/cli/template-system/index.html#database-configuration): In-page section heading.
- [Feature flags](https://docs.datarobot.com/en/docs/agentic-ai/cli/template-system/index.html#feature-flags): In-page section heading.
- [Authentication](https://docs.datarobot.com/en/docs/agentic-ai/cli/template-system/index.html#authentication): In-page section heading.
- [Best practices](https://docs.datarobot.com/en/docs/agentic-ai/cli/template-system/index.html#best-practices): In-page section heading.
- [Clear documentation](https://docs.datarobot.com/en/docs/agentic-ai/cli/template-system/index.html#clear-documentation): In-page section heading.
- [Sensible defaults](https://docs.datarobot.com/en/docs/agentic-ai/cli/template-system/index.html#sensible-defaults): In-page section heading.
- [Helpful prompts](https://docs.datarobot.com/en/docs/agentic-ai/cli/template-system/index.html#helpful-prompts): In-page section heading.
- [Organized structure](https://docs.datarobot.com/en/docs/agentic-ai/cli/template-system/index.html#organized-structure): In-page section heading.
- [Security first](https://docs.datarobot.com/en/docs/agentic-ai/cli/template-system/index.html#security-first): In-page section heading.
- [Examples](https://docs.datarobot.com/en/docs/agentic-ai/cli/template-system/index.html#examples): In-page section heading.
- [See also](https://docs.datarobot.com/en/docs/agentic-ai/cli/template-system/index.html#see-also): In-page section heading.

## Related documentation

- [Agentic AI](https://docs.datarobot.com/en/docs/agentic-ai/index.html): Linked from this page.
- [CLI](https://docs.datarobot.com/en/docs/agentic-ai/cli/index.html): Linked from this page.
- [Template structure](https://docs.datarobot.com/en/docs/agentic-ai/cli/development/structure.html): Linked from this page.
- [Interactive configuration](https://docs.datarobot.com/en/docs/agentic-ai/cli/template-system/interactive-config.html): Linked from this page.
- [Environment variables](https://docs.datarobot.com/en/docs/agentic-ai/cli/template-system/environment-variables.html): Linked from this page.
- [Get started](https://docs.datarobot.com/en/docs/agentic-ai/cli/getting-started.html): Linked from this page.
- [Work with templates](https://docs.datarobot.com/en/docs/agentic-ai/cli/commands/templates.html): Linked from this page.
- [Command reference: templates](https://docs.datarobot.com/en/docs/index.html): Linked from this page.
- [Command reference: dotenv](https://docs.datarobot.com/en/docs/agentic-ai/cli/commands/dotenv.html): Linked from this page.

## Documentation content

DataRobot templates are pre-configured application scaffolds that help you quickly build and deploy custom applications to DataRobot. Each template includes:

- Application source code
- Configuration prompts
- Environment setup tools
- Task definitions
- Documentation

## Documentation

### Core concepts

- Template structure: How templates are organized.
- Interactive configuration: The configuration wizard.
- Environment variables: Managing .env files.

## Quickstart

### Using a template

```
# List available templates
dr templates list

# Interactive setup (recommended)
dr templates setup

# Manual setup
dr templates clone my-template
cd my-template
dr dotenv setup
dr run dev
```

### Create a template

```
# 1. Create structure
mkdir my-template
cd my-template

# 2. Add metadata
mkdir .datarobot
cat > .datarobot/prompts.yaml <<EOF
prompts:
  - key: "app_name"
    env: "APP_NAME"
    help: "Enter your application name"
EOF

# 3. Create environment template
cat > .env.template <<EOF
APP_NAME=
DATAROBOT_ENDPOINT=
EOF

# 4. Add tasks
cat > Taskfile.gen.yaml <<EOF
version: '3'
tasks:
  dev:
    desc: Start development server
    cmds:
      - "echo "Starting {{.APP_NAME}}"
EOF

# 5. Test it
dr templates setup
```

## Template types

### Single-page applications

Create simple applications with one component.

```
my-spa-template/
├── .datarobot/
│   └── prompts.yaml
├── src/
├── .env.template
└── Taskfile.gen.yaml
```

### Full-stack applications

Create applications with multiple components.

```
my-fullstack-template/
├── .datarobot/
│   └── prompts.yaml
├── backend/
│   ├── .datarobot/
│   │   └── prompts.yaml
│   └── src/
├── frontend/
│   ├── .datarobot/
│   │   └── prompts.yaml
│   └── src/
└── .env.template
```

### Microservices

Use multiple independent services:

```
my-microservices-template/
├── .datarobot/
├── service-a/
│   ├── .datarobot/
│   └── src/
├── service-b/
│   ├── .datarobot/
│   └── src/
└── docker-compose.yml
```

## Common patterns

### Database configuration

```
prompts:
  - key: "use_database"
    help: "Enable database?"
    options:
      - name: "Yes"
        requires: "database_config"
      - name: "No"

  - key: "database_url"
    section: "database_config"
    env: "DATABASE_URL"
    help: "Database connection string"
```

### Feature flags

```
prompts:
  - key: "enabled_features"
    env: "ENABLED_FEATURES"
    help: "Select features to enable"
    multiple: true
    options:
      - name: "Analytics"
        value: "analytics"
      - name: "Monitoring"
        value: "monitoring"
```

### Authentication

```
prompts:
  - key: "auth_provider"
    env: "AUTH_PROVIDER"
    help: "Select authentication provider"
    options:
      - name: "OAuth2"
        value: "oauth2"
        requires: "oauth_config"
      - name: "SAML"
        value: "saml"
        requires: "saml_config"
```

## Best practices

### Clear documentation

Includes a README file with:

- A quickstart guide
- Available tasks
- Configuration options
- Deployment instructions

### Sensible defaults

Provide defaults in `.env.template`:

```
# Good defaults for local development
PORT=8080
DEBUG=true
LOG_LEVEL=info
```

### Helpful prompts

Use descriptive help text:

```
prompts:
  - key: "database_url"
    help: "PostgreSQL connection string (format: postgresql://user:pass@host:5432/dbname)"
```

### Organized structure

Keep related files together.

```
src/
├── api/          # API endpoints
├── models/       # Data models
├── services/     # Business logic
└── utils/        # Utilities
```

### Security first

Follow the security guidelines below.

- Never commit .env files.
- Use strong secrets.
- Restrict file permissions.
- Mask sensitive values.

## Examples

Browse the [DataRobot template gallery](https://github.com/datarobot/templates) to view example templates:

- python-streamlit : Streamlit dashboard
- react-frontend : React web application
- fastapi-backend : FastAPI REST API
- full-stack-app : complete web application

## See also

- Get started
- Work with templates
- Command reference: templates
- Command reference: dotenv
