# 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-07-23T18:01:59.359129+00:00` (UTC).

## Primary page

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

## Sections on this page

- [ドキュメンテーション](https://docs.datarobot.com/ja/docs/agentic-ai/cli/template-system/index.html.md#documentation): In-page section heading.
- [Core concepts](https://docs.datarobot.com/ja/docs/agentic-ai/cli/template-system/index.html.md#core-concepts): In-page section heading.
- [クイックスタート](https://docs.datarobot.com/ja/docs/agentic-ai/cli/template-system/index.html.md#quickstart): In-page section heading.
- [Using a template](https://docs.datarobot.com/ja/docs/agentic-ai/cli/template-system/index.html.md#using-a-template): In-page section heading.
- [Create a template](https://docs.datarobot.com/ja/docs/agentic-ai/cli/template-system/index.html.md#create-a-template): In-page section heading.
- [Template types](https://docs.datarobot.com/ja/docs/agentic-ai/cli/template-system/index.html.md#template-types): In-page section heading.
- [Single-page applications](https://docs.datarobot.com/ja/docs/agentic-ai/cli/template-system/index.html.md#single-page-applications): In-page section heading.
- [Full-stack applications](https://docs.datarobot.com/ja/docs/agentic-ai/cli/template-system/index.html.md#full-stack-applications): In-page section heading.
- [Microservices](https://docs.datarobot.com/ja/docs/agentic-ai/cli/template-system/index.html.md#microservices): In-page section heading.
- [Common patterns](https://docs.datarobot.com/ja/docs/agentic-ai/cli/template-system/index.html.md#common-patterns): In-page section heading.
- [Database configuration](https://docs.datarobot.com/ja/docs/agentic-ai/cli/template-system/index.html.md#database-configuration): In-page section heading.
- [Feature flags](https://docs.datarobot.com/ja/docs/agentic-ai/cli/template-system/index.html.md#feature-flags): In-page section heading.
- [認証](https://docs.datarobot.com/ja/docs/agentic-ai/cli/template-system/index.html.md#authentication): In-page section heading.
- [ベストプラクティス](https://docs.datarobot.com/ja/docs/agentic-ai/cli/template-system/index.html.md#best-practices): In-page section heading.
- [Clear documentation](https://docs.datarobot.com/ja/docs/agentic-ai/cli/template-system/index.html.md#clear-documentation): In-page section heading.
- [Sensible defaults](https://docs.datarobot.com/ja/docs/agentic-ai/cli/template-system/index.html.md#sensible-defaults): In-page section heading.
- [Helpful prompts](https://docs.datarobot.com/ja/docs/agentic-ai/cli/template-system/index.html.md#helpful-prompts): In-page section heading.
- [Organized structure](https://docs.datarobot.com/ja/docs/agentic-ai/cli/template-system/index.html.md#organized-structure): In-page section heading.
- [Security first](https://docs.datarobot.com/ja/docs/agentic-ai/cli/template-system/index.html.md#security-first): In-page section heading.
- [例](https://docs.datarobot.com/ja/docs/agentic-ai/cli/template-system/index.html.md#examples): In-page section heading.
- [See also](https://docs.datarobot.com/ja/docs/agentic-ai/cli/template-system/index.html.md#see-also): In-page section heading.

## 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
- ドキュメンテーション

## ドキュメンテーション

### Core concepts

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

## クイックスタート

### 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" 
```

### 認証

```
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" 
```

## ベストプラクティス

### Clear documentation

Includes a README file with:

- A quickstart guide
- Available tasks
- 設定オプション
- 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.

## 例

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

- スタートガイド
- Work with templates
- Command reference: templates
- Command reference: dotenv
