Create a Command
-
Within the
.angrealfolder of a project create a file that starts withtask_and ends with.py. -
Define a function.
-
Apply
commanddecorator.
import angreal
@angreal.command(
name='command-name',
about='text-to-display',
when_to_use=['During development', 'For testing features'],
when_not_to_use=['In production deployments', 'When debugging']
)
def command_function():
return
The when_to_use and when_not_to_use fields provide guidance for AI agents and tools about appropriate usage contexts:
- when_to_use: List scenarios where this command is appropriate
- when_not_to_use: List scenarios where this command should be avoided
These fields enhance the machine-readable command tree output and improve AI agent decision-making.