Skip to content

Commands (slash commands) provide reusable prompt templates that can be invoked during conversations. They allow you to define frequently used prompts with parameters.

Overview

Commands can be defined in three ways:

  • Static: Inline command content with Jinja2 templating
  • File: Load command content from external files
  • Callable: Reference Python functions that generate command content

Commands are invoked with /command-name syntax and support parameter substitution.

Configuration Reference

Static Command

Static command with inline content.

Static Command (YAML)
1
2
3
4
- type: static
  content: 'Summarize this text: {text}'  # The prompt template content. Supports ${env.VAR} substitution.
  name: null  # Command name (optional, can be inferred from key).
  description: null  # Optional description of what this command does.

File-based Command

File-based command that loads content from external file.

File-based Command (YAML)
1
2
3
4
5
- type: file
  path: prompts/summarize.txt  # Path to file containing the prompt template.
  encoding: utf-8  # File encoding to use when reading the file.
  name: null  # Command name (optional, can be inferred from key).
  description: null  # Optional description of what this command does.

Callable Command

Callable command that references a Python function.

Callable Command (YAML)
1
2
3
4
- type: callable
  function: mymodule.commands.summarize  # Python function import path (e.g., 'my.package.module.function_name').
  name: null  # Command name (optional, can be inferred from key).
  description: null  # Optional description of what this command does.

Usage Notes

  • Command names should be unique within an agent
  • Commands support Jinja2 templating for dynamic content
  • File-based commands can reference templates with variables
  • Callable commands allow full programmatic control
  • Commands are available in both CLI and web interfaces
  • Parameters can be passed as key-value pairs when invoking commands