Skip to content

Add aict each: batch tool for piping find/grep results into another tool #24

@github-actions

Description

@github-actions

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions