Skip to main content

How to Debug Template Execution

1

Enable Verbose Mode

praisonai templates run my-template --verbose
2

Check Template Validation

praisonai templates validate ./my-template
3

View Template Info

praisonai templates info my-template --show-variables
4

Check Tool Resolution

praisonai tools show-sources --template my-template

How to Use Templates Doctor

1

Run Doctor Command

praisonai tools doctor
2

Check Specific Template

praisonai tools doctor --template my-template
3

Review Diagnostics

The doctor command will show:
  • Missing tools
  • Invalid tool references
  • Configuration issues
  • Dependency problems
4

Fix Issues

Based on doctor output, fix the identified issues in your template files.

How to Debug Tool Resolution

1

List Available Tools

praisonai tools list
2

Resolve Specific Tool

praisonai tools resolve shell_tool
3

Check Tool Sources

praisonai tools show-sources --template my-template
4

Discover Tools from Packages

praisonai tools discover --include praisonai_tools.video

How to Debug with Python

1

Enable Debug Logging

import logging
logging.basicConfig(level=logging.DEBUG)

from praisonai.templates.loader import TemplateLoader
loader = TemplateLoader()
template = loader.load_template("my-template")
2

Inspect Template Config

print(f"Name: {template.name}")
print(f"Variables: {template.variables}")
print(f"Requires: {template.requires}")
3

Check Tool Registry

from praisonai.templates.tool_override import create_tool_registry_with_overrides

registry = create_tool_registry_with_overrides(
    template_dir=template.path,
    include_defaults=True
)
print(f"Available tools: {list(registry.keys())}")

Common Issues and Solutions

IssueCauseSolution
Tool not foundTool not in registryAdd to requires.tools or tools_sources
Variable undefinedMissing variableAdd to variables in TEMPLATE.yaml
Template not foundWrong pathUse full path or check template name
Permission deniedFile accessCheck file permissions

Debug CLI Options

praisonai templates run <template> [DEBUG OPTIONS]

Debug Options:
  --verbose              Enable verbose logging
  --dry-run              Show what would be executed
  --strict-tools         Fail on missing tools