tools/filesystem: Add post-edit command support#89
Conversation
Implements post-edit functionality for the filesystem builtin tool, allowing automatic execution of commands after file edits based on file path patterns. Use cases: - Automatic code formatting (like gofmt for Go, shfmt for bash) - Running linters with auto-fix capabilities The feature supports: - Glob-style path patterns (*.go, *.py, etc.) - $path placeholder replacement in commands - Multiple post-edit rules per toolset Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
krissetto
left a comment
There was a problem hiding this comment.
I like this idea. I'm not super sure on the implementation as a config of the filesystem tool though.
This kinda feels like a sort of "tool chaining/triggering" feature, where we can force the trigger of one tool (in this case, a shell command), based on the output conditions of another tool (filesystem). Here it could be worded as something like "if the filesystem tool's input param (file here) fits x condition (the glob), then run the shell command 'whatever' after successful execution of the filesystem tool"
This here could be a good enough quick solution for this specific case, but I have a feeling that thinking about this problem a bit more could lead to a nice solution that's reusable across a wide range of tools.
Any thoughts?
Implements post-edit functionality for the filesystem builtin tool, allowing automatic execution of commands after file edits based on file path patterns.
Use cases:
The feature supports: