Configuration Reference

Below you can find tables describing all the possible configuration you can do, as well as TOML examples below those tables showing what that configuration would look like.


The general table is for main Hooked configuration.

configStringHooked.tomlThe configuration file to use. If your configuration file isn't Hooked.toml you should set this accordingly.
directoryStringhooksThe directory Hooked looks in for anything related to files. For example: scripts, templates, etc.
templateOptional stringPath to a custom template to be used when installing scripts. See the install CLI command for more details.
config = "Hooked.toml"
directory = "hooks"
template = ""


Pre-commit hooks are defined using pre_commit arrays of tables.

nameStringUnnamed HookThe name of the hook, useful for figuring out which hook failed after it ran.
command1StringA command to run when the hook is called.
script1StringA script to run when the hook is called. This script should be executable and be located inside the configured general directory.
on_failureStringstopWhat to do when the hook task returns a non-zero status code. Can be either "continue" or "stop".
name = "Command Example"
command = "echo \"Hey, $USER!\""

name = "Script Example"
script = ""
on_failure = "continue"



When both a command and script are defined in a hook, only the command will be run.