Description
AI agents frequently need to apply one tool to many paths — e.g., stat every file returned by find. Currently this requires spawning a separate process per file. Add aict each <tool> [flags] which reads newline-separated paths from stdin and runs the given tool on each, collecting all results under a single root element.
Usage
# stat every Go file in the project
aict find . -name "*.go" --plain | aict each stat
# checksum every file found
aict find . -type f --plain | aict each checksums
Proposed XML Output
<each tool="stat" count="42" timestamp="1746123456">
<stat path="main.go" ...> ... </stat>
<stat path="utils.go" ...> ... </stat>
</each>
Implementation Notes
- Read stdin line by line
- For each path, call the registered tool function directly (not via exec)
- Collect results into a wrapper element
- Support
--workers N for parallel execution
- Empty stdin should produce valid XML with
count="0"
Related
internal/tool/tool.go registry
- Phase 4 in ROADMAP.md
Description
AI agents frequently need to apply one tool to many paths — e.g.,
statevery file returned byfind. Currently this requires spawning a separate process per file. Addaict each <tool> [flags]which reads newline-separated paths from stdin and runs the given tool on each, collecting all results under a single root element.Usage
Proposed XML Output
Implementation Notes
--workers Nfor parallel executioncount="0"Related
internal/tool/tool.goregistry