Skip to content

Commit 3220598

Browse files
committed
flatten dirs. there was only one code directory and I think its better to just flatten it and re-organize if we have other parent dirs
1 parent 7c9d585 commit 3220598

19 files changed

+59
-67
lines changed

README.md

Lines changed: 59 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,65 @@ They are defined in a repository's `.agents/commands` directory and can be
1414
markdown files or use Amp's experimental
1515
support for executable scripts, which begin with, for example `#!/usr/bin/env bash`
1616

17-
## Toolboxes
17+
# Amp Toolbox Templates
1818

19-
Toolboxes allow you to extend Amp with simple scripts instead of needing to
20-
provide an MCP server.
19+
Templates for creating custom tools that extend Amp. See the [Amp Owner's Manual](https://ampcode.com/manual#toolboxes) for complete documentation.
2120

22-
They are defined in a repository's `.agents/tools` directory.
21+
## Quick Start
2322

24-
For more information on toolboxes, see the [Amp Owners Manual](https://ampcode.com/manual#toolboxes)
23+
1. **Set up your toolbox directory:**
24+
25+
```bash
26+
export AMP_TOOLBOX=/path/to/your/toolbox
27+
mkdir -p $AMP_TOOLBOX
28+
```
29+
30+
2. **Copy and customize a template:**
31+
32+
```bash
33+
cp tool-template.js $AMP_TOOLBOX/my-custom-tool
34+
chmod +x $AMP_TOOLBOX/my-custom-tool
35+
```
36+
37+
3. **Edit the template:**
38+
- Update `name` and `description`
39+
- Modify parameters and logic
40+
41+
## Available Templates
42+
43+
### Basic Templates
44+
45+
- **`tool-template.js`** - Node.js with simple key-value parameters
46+
- **`tool-template.py`** - Python with simple key-value parameters
47+
- **`tool-template.sh`** - Bash with simple key-value parameters
48+
- **`tool-template-json.js`** - Node.js with JSON schema for complex parameters
49+
50+
## Testing Toolbox Implementations
51+
52+
Test the `describe` action:
53+
54+
```bash
55+
# JavaScript template
56+
TOOLBOX_ACTION=describe ./tool-template.js
57+
58+
# Python template
59+
TOOLBOX_ACTION=describe ./tool-template.py
60+
61+
# Bash template
62+
TOOLBOX_ACTION=describe ./tool-template.sh
63+
64+
# JSON schema template
65+
TOOLBOX_ACTION=describe ./tool-template-json.js
66+
```
67+
68+
Test the `execute` action:
69+
70+
```bash
71+
# Simple templates (external service integration)
72+
echo "text: hello world" | TOOLBOX_ACTION=execute ./tool-template.js
73+
echo "text: hello world" | TOOLBOX_ACTION=execute ./tool-template.py
74+
echo "text: hello world" | TOOLBOX_ACTION=execute ./tool-template.sh
75+
76+
# JSON template (complex data to external service)
77+
echo '{"files": ["test.txt", "data.csv"], "options": {"verbose": true, "format": "json", "priority": 8}}' | TOOLBOX_ACTION=execute ./tool-template-json.js
78+
```
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)