Commands
Commands allow you to define reusable slash commands (e.g., /review, /plan) that can be invoked in the chat interface. These commands are loaded from .md files in a configured directory and provide a way to standardize or automate common tasks.
Configuration
Directory Setup
- Configure the commands directory in the Peon AI preferences:
- Navigate to Window > Preferences > Peon AI.
- Set the "Commands directory" field to the path containing your command files.
- Path resolution matches the existing skills directory behavior, including support for workspace-relative paths.
Command Files
- Each command is defined in a separate
.mdfile (e.g.,review.md,plan.md). - The filename (without the
.mdextension) becomes the command name (e.g.,/review,/plan). - Files in subdirectories or hidden files (starting with
.) are ignored.
Optional Frontmatter
Add a YAML frontmatter to include a description for the command. This description appears in the slash menu.
Example:
markdown
---
description: Review the code carefully and report findings.
---
# Review Command
Review the code and report any issues.Usage
- In the chat interface, type
/to see a list of available commands. - Select a command to insert its name into the chat input.
- The command body replaces the system prompt for that turn. Standing orders (project context, AGENTS.md) and the skill catalog are still appended after it.
Example
Create a file named
review.mdin the commands directory:markdown--- description: Review the code carefully and report findings. --- # Review Command Review the code and report any issues.In the chat, type
/reviewto use the command.
Effect
- Commands provide a quick way to insert predefined prompts or instructions into the chat.
- They help standardize workflows and reduce repetitive typing.
- The LLM processes the command body as the system prompt for that single turn, ensuring consistent responses.
Implementation Details
- Preferences: The "Commands directory" field in preferences allows you to configure the path to your command files.
- Core: The
CommandServicescans the directory for.mdfiles, parses optional frontmatter descriptions, and createsCommandRecordobjects for each command. - Chat UI: A
SlashMenuPopupappears while typing/to show available commands. The popup disappears once whitespace separates the command from the rest of the message. - Invocation: When a command is invoked, the
AIChatViewparses the command name, reads the command body (with template variables processed), and sets a one-shot system prompt that replaces the base system prompt for the next LLM call only. Unknown commands show an error and abort the send operation.
Notes
- Commands are case-insensitive.
- The command body supports template variables (e.g.,
${variable}). - Tool rules remain per mode (PLAN/DEV/AGENT) as before.
