Skip to main content

Module custom_commands

Module custom_commands 

Source
Expand description

Custom commands loaded from .opendev/commands/.

Text files in the commands directories become slash commands. Supports:

  • YAML frontmatter for metadata (description, model, agent, subtask)
  • $1, $2, etc. for positional arguments
  • $ARGUMENTS for all arguments
  • Context variable substitution ($KEY → value)
  • Shell substitution: !cmd`` executes the command and inlines its output

§Example

.opendev/commands/review.md contains:

---
description: "Code review with security focus"
model: gpt-4o
subtask: true
---

Review this code for: $ARGUMENTS
Current branch: !`git branch --show-current`
Focus on security and performance.

Structs§

CommandInfo
Summary info for listing commands.
CustomCommand
A custom command loaded from a text file.
CustomCommandLoader
Loads and manages custom commands from command directories.