Add Templates

Add templates from GitHub or local paths to PraisonAI

How to Add Templates from Local Path

  1. Create Template Directory
    bash
    mkdir /tmp/my-joke-template
    cd /tmp/my-joke-template
  2. Create TEMPLATE.yaml
    yaml
    name: joke-generator
    version: "1.0.0"
    description: "Generate jokes on any topic"
    
    variables:
      topic:
        description: "Topic for the joke"
        required: true
      style:
        description: "Style of joke"
        default: "one-liner"
    
    requires:
      tools: []
  3. Create agents.yaml
    yaml
    framework: praisonai
    topic: "Joke Generation"
    
    roles:
      comedian:
        role: Stand-up Comedian
        goal: Create hilarious jokes
        tasks:
          generate_joke:
            description: |
              Create a {{style}} joke about: {{topic}}
            expected_output: "A hilarious joke"
  4. Create workflow.yaml
    yaml
    name: joke-generator-workflow
    description: Generate jokes workflow
    
    steps:
      - name: generate_joke
        agent: comedian
        task: generate_joke
  5. Add Template
    bash
    praisonai templates add /tmp/my-joke-template

    Output:

    ✅ Added template: my-joke-template
       Copied to: ~/.praisonai/templates/my-joke-template
  6. Run the Template
    bash
    praisonai templates run my-joke-template --topic "programming" --style "pun"

How to Add Templates from GitHub

  1. Add Template from GitHub
    bash
    praisonai templates add github:MervinPraison/Agent-Recipes/ai-video-editor
  2. Verify Installation

    Template is downloaded to ~/.praisonai/templates/ai-video-editor/

  3. Run the Template
    bash
    praisonai templates run ai-video-editor --input video.mp4

How to Add Template Sources

  1. Add GitHub Repository as Source
    bash
    praisonai templates add-sources github:MervinPraison/Agent-Recipes
  2. Verify Configuration
    bash
    cat ~/.praisonai/templates_sources.yaml

Template Structure

A valid template requires these files:

my-template/
├── TEMPLATE.yaml    # Template metadata and variables
├── agents.yaml      # Agent definitions
└── workflow.yaml    # Workflow steps

Configuration File

Template sources are stored in ~/.praisonai/templates_sources.yaml:

yaml
sources:
- github:MervinPraison/Agent-Recipes
- github:user/custom-templates