Templates

Agent templates define what runs inside the VM — dependencies, repos, services, and the agent's bootstrap behavior.

Template Directory Structure

A template is a directory registered in hub.yaml. It contains at minimum an elasticclaw-config.yaml.

text
templates/
  my-template/
    elasticclaw-config.yaml   # required — bootstrap spec
    bootstrap.sh              # optional — custom bootstrap script
    files/                    # optional — files copied into the VM
      .env.example
      config.toml

elasticclaw-config.yaml

This file defines how the VM is bootstrapped when an agent is created.

yaml
version: "1"
name: my-template
description: "General purpose dev agent"

vm:
  instance_type: r1.small
  os: ubuntu-22.04
  disk_gb: 20

bootstrap:
  env:
    NODE_ENV: development
    REPO_URL: ${GITHUB_REPO_URL}
  steps:
    - name: Install system deps
      run: |
        apt-get update -q
        apt-get install -y git curl build-essential

    - name: Install Node.js
      run: |
        curl -fsSL https://deb.nodesource.com/setup_20.x | bash -
        apt-get install -y nodejs
        npm install -g pnpm

    - name: Clone repo
      run: |
        git clone ${REPO_URL} /workspace
        cd /workspace && pnpm install

    - name: Copy files
      copy:
        - src: files/.env.example
          dest: /workspace/.env

agent:
  model: gpt-4o
  system_prompt: |
    You are a software engineering agent. You have access to a full
    development environment. Work methodically, test your changes,
    and communicate clearly about what you're doing.
  tools:
    - shell
    - file_read
    - file_write
    - git

Bootstrap Steps

Each step under bootstrap.steps runs in order. Available keys:

  • name — display name for the step
  • run — shell commands to execute
  • copy — copy files from template into the VM
  • env — environment variables for this step
Bootstrap runs as root inside the VM. The workspace is typically mounted at /workspace.