pi-custom-agents0.1.2
Run a prompt in a fresh Pi agent with /agent, and let your own commands hand work to agents, without Pi starting any on its own
Untested on omp
This is a pi package. No one has reported whether it works on omp yet. If you try it, add your result below.
Reports 0
No reports yet.
Readme
pi-custom-agents
A minimal way to write your own subagents for Pi. An agent is a markdown file with a prompt and, if you like, a model. /agent <name> starts it in the background while you keep working, and you can click it to follow what it's doing. Agents only run when you start them: Pi doesn't spin them up on its own.
pi install npm:pi-custom-agents
Usage
An agent is a markdown file in ~/.pi/agent/agents/. The file name is the agent's name, the body is its prompt, and the frontmatter can set a description, model and context:
---
description: Review this branch before merging
model: openai/gpt-5
---
Review this branch against main for bugs. $ARGUMENTS
/agent reviewruns it in the background while you keep working./agent review focus on the auth codeputs the rest where the prompt says$ARGUMENTS, or after the prompt when it doesn't./agent <prompt>runs any other prompt the same way, with the model you're on./agenton its own lists your agents.--model <model>and--forkbefore the name or prompt override the agent's model and context for one run, for example/agent --model github-copilot/gpt-6.1-terra reviewor/agent --fork try the other approach. Pi matches model names loosely, so--model sonnet:highworks too.
By default, an agent starts without any context. For an agent that should have the conversation's context, add context: fork to its frontmatter:
---
description: Try the other approach we discussed
context: fork
---
Try the other approach we discussed and tell me how it compares. $ARGUMENTS
Each running agent gets a line above the input; click it to see what the agent is doing, and click its title or press esc to close that again. When it's done, its report appears in the chat. Every agent's session is saved, so you can open it with pi --session <id> (the report says which) and carry on where it stopped.
Prompt templates can use agents too: in a run started by a command or template, Pi gets an agent tool, for example "use the agent tool with openai/gpt-5 to look for bugs, then sum up its report". Pi waits for the report, so a template can stop and ask you something in between.
License
MIT