Hooks let you run shell commands automatically when simse invokes specific tools. They are defined per-plugin in a hooks.toml file inside the plugin's directory.
Each hook is a top-level entry in <plugin-dir>/hooks.toml with two fields:
matcher = "fs_write|fs_edit"
command = "${PLUGIN_ROOT}/format.sh"
| to match multiple tools.${PLUGIN_ROOT} is replaced with the plugin's directory path.That's it. No other fields or variables.
A plugin that auto-formats files whenever simse writes or edits them:
my-plugin/
hooks.toml
format.sh
hooks.toml:
matcher = "fs_write|fs_edit"
command = "${PLUGIN_ROOT}/format.sh"
format.sh:
#!/usr/bin/env bash
prettier --write .
When simse calls fs_write or fs_edit, the hook fires and runs format.sh from the plugin directory.
hooks.toml files.matcher pattern.command is executed with ${PLUGIN_ROOT} expanded to the plugin's directory path.