| name | agent-tools |
| description | Digital Swiss Army knife for everyday labor that standard models can't handle out of the box. Use when: (1) Need to manipulate files (rename, move, copy, delete), (2) Working with JSON/YAML/TOML configs, (3) Running system commands safely, (4) Processing text with regex or transformations, (5) Need utility functions for common operations. |
Agent Tools - Universal Utility Belt
A collection of practical utilities for everyday agent operations.
File Operations
Safe File Manipulation
Always use trash instead of rm when possible:
trash /path/to/file
Bulk File Operations
for f in *.txt; do mv "$f" "${f/.txt/.md}"; done
find . -name "*.log" -mtime +7 -exec trash {} \;
rsync -av --progress src/ dest/
JSON/YAML Processing
JSON Operations (jq)
jq '.' file.json
jq '.field' file.json
jq '.field = "new_value"' file.json > tmp && mv tmp file.json
jq -s 'add' file1.json file2.json
YAML Operations (yq)
yq '.key' file.yaml
yq '.key = "value"' -i file.yaml
yq -o=json '.' file.yaml
Text Processing
Common Patterns
sed -i '' 's/old/new/g' file.txt
grep -oP 'pattern' file.txt
grep -c 'pattern' file.txt
sort file.txt | uniq > deduplicated.txt
awk '{print $2}' file.txt
System Utilities
Process Management
ps aux | grep process_name
lsof -ti:3000 | xargs kill -9
htop
Network Operations
lsof -i :PORT
curl --retry 3 -O URL
curl -X POST -H "Content-Type: application/json" -d '{"key":"value"}' URL
Encoding/Decoding
echo "text" | base64
echo "dGV4dAo=" | base64 -d
python3 -c "import urllib.parse; print(urllib.parse.quote('text'))"
python3 -c "import urllib.parse; print(urllib.parse.unquote('text%20here'))"
jq -R . <<< 'string to escape'
jq -r . <<< '"escaped string"'
Date/Time Utilities
date +%s
date -u +"%Y-%m-%dT%H:%M:%SZ"
date -r 1234567890
TZ="America/Chicago" date
Validation Helpers
jq empty file.json && echo "Valid JSON"
python3 -c "import yaml; yaml.safe_load(open('file.yaml'))" && echo "Valid YAML"
check-jsonschema --schemafile schema.json document.json
Quick Reference
| Task | Command |
|---|
| Safe delete | trash file |
| Find files | find . -name "*.ext" |
| Search in files | grep -r "pattern" . |
| Replace text | sed -i '' 's/old/new/g' |
| JSON pretty | jq '.' |
| YAML read | yq '.key' |
| Port check | lsof -i :PORT |
| Base64 decode | base64 -d |