plugins/_commands/README.md
YAML-configured slash commands for Agent Zero.
This plugin lets you define reusable /commands as .command.yaml files with either:
.txt template body.py script hookCommands are managed from the plugin modal and can be inserted directly from the chat composer when the first token starts with /.
.command.yaml config files with command metadata{} placeholders and parsed argsEach command is defined by one config file plus one content file in the same scope directory.
Set webui_hidden: true to keep a command resolvable while omitting it from the chat composer picker.
Example text command:
scan.command.yaml
name: scan
description: Scan a Git repository.
argument_hint: /scan --git-url https://github.com/org/repo
type: text
template_path: scan.txt
scan.txt
Please scan repository: {args.flags.git_url}
Raw input:
{raw}
Example python hook command:
optimize.command.yaml
name: optimize
description: Optimize the current request.
argument_hint: /optimize 30%
type: script
script_path: optimize.py
include_history: true
optimize.py
def run(payload):
args = payload["arguments"]
pct = args["positional"][0] if args["positional"] else "10%"
return {
"text": f"Optimize this response by {pct}.",
"effects": [],
}
The parser supports:
/scan https://github.com/org/repo/scan --git-url https://github.com/org/repo/scan --git-url=https://github.com/org/repo/scan -v -q or /scan -vqParsed data is available to:
{} placeholders:
{raw}{args.positional.0}{args.flags.git_url}payload["arguments"]Python hook file must expose:
def run(payload): ...
It can return:
str (used as replacement text)dict with:
text: str (replacement text)effects: list[dict]Supported frontend effects:
{"type": "replace_input", "text": "..."}{"type": "append_input", "text": "..."}{"type": "toast", "level": "info|error|success", "message": "..."}Commands are discovered from these scope folders:
usr/projects/<project>/.a0proj/plugins/_commands/commands/usr/plugins/_commands/commands/plugins/_commands/commands/plugins/<plugin>/commands/ or usr/plugins/<plugin>/commands/Precedence in the chat picker:
_commandsWhen the built-in _commands plugin starts, it migrates files from the older community commands plugin namespace:
usr/plugins/commands/commands/ into usr/plugins/_commands/commands/usr/plugins/commands/skills/ into usr/plugins/_commands/skills/plugins/commands/commands/ folders to matching plugins/_commands/commands/ folderscommands plugin roots so the WebUI does not load two slash-command popovers/ at the start of the inline input to browse commandsThe plugin ships with commands-create-slash-command, a plugin-scoped skill that helps Agent Zero create or update command files.