Skip to content

commands-folder

Loads prompt templates from commands/ folders, treating them identically to pi’s built-in prompts/ folder functionality.

Why it matters: Some workflows prefer organizing reusable prompts as “commands” — a semantic distinction that makes the intent clearer. This extension lets you use ~/.pi/agent/commands/ alongside ~/.pi/agent/prompts/ without any functional difference.

Locations

The extension scans:

LocationScope
~/.pi/agent/commands/*.mdGlobal (all projects)
.pi/commands/*.mdProject-local

Project-local commands take precedence over global ones with the same name.

Usage

Identical to prompt templates:

~/.pi/agent/commands/deploy.md
/deploy staging
# File: .pi/commands/review.md
/review --focus security

Format

Same as prompt templates — Markdown with optional YAML frontmatter:

---
description: Deploy to an environment
argument-hint: <environment>
---
Deploy the current project to $1 environment.
Run the deployment script and verify the health check passes.

Argument Substitution

Full support for positional arguments:

SyntaxMeaning
$1, $2, …Positional arguments
$@ or $ARGUMENTSAll arguments joined
${@:N}Arguments from position N to end
${@:N:L}L arguments starting at position N

Example

---
description: Create a new component
argument-hint: <name> [features...]
---
Create a React component named $1 with the following features:
${@:2}
Follow the project's component patterns.

Usage: /component Button "click handler" "loading state"