Skip to content

Conversation

vvoland
Copy link
Contributor

@vvoland vvoland commented Sep 3, 2025

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

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 <[email protected]>
Copy link
Contributor

@krissetto krissetto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants