mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-16 16:00:58 +00:00
Update custom tools README for subdirectory/index.ts structure
This commit is contained in:
parent
a930eb8489
commit
48e792aa52
1 changed files with 11 additions and 8 deletions
|
|
@ -4,13 +4,15 @@ Example custom tools for pi-coding-agent.
|
|||
|
||||
## Examples
|
||||
|
||||
### hello.ts
|
||||
Each example uses the `subdirectory/index.ts` structure required for tool discovery.
|
||||
|
||||
### hello/
|
||||
Minimal example showing the basic structure of a custom tool.
|
||||
|
||||
### question.ts
|
||||
### question/
|
||||
Demonstrates `pi.ui.select()` for asking the user questions with options.
|
||||
|
||||
### todo.ts
|
||||
### todo/
|
||||
Full-featured example demonstrating:
|
||||
- `onSession` for state reconstruction from session history
|
||||
- Custom `renderCall` and `renderResult`
|
||||
|
|
@ -19,7 +21,8 @@ Full-featured example demonstrating:
|
|||
|
||||
### subagent/
|
||||
Delegate tasks to specialized subagents with isolated context windows. Includes:
|
||||
- `subagent.ts` - The custom tool (single, parallel, and chain modes)
|
||||
- `index.ts` - The custom tool (single, parallel, and chain modes)
|
||||
- `agents.ts` - Agent discovery helper
|
||||
- `agents/` - Sample agent definitions (scout, planner, reviewer, worker)
|
||||
- `commands/` - Workflow presets (/implement, /scout-and-plan, /implement-and-review)
|
||||
|
||||
|
|
@ -28,11 +31,11 @@ See [subagent/README.md](subagent/README.md) for full documentation.
|
|||
## Usage
|
||||
|
||||
```bash
|
||||
# Test directly
|
||||
pi --tool examples/custom-tools/todo.ts
|
||||
# Test directly (can point to any .ts file)
|
||||
pi --tool examples/custom-tools/todo/index.ts
|
||||
|
||||
# Or copy to tools directory for persistent use
|
||||
cp todo.ts ~/.pi/agent/tools/
|
||||
# Or copy entire folder to tools directory for persistent use
|
||||
cp -r todo ~/.pi/agent/tools/
|
||||
```
|
||||
|
||||
Then in pi:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue